GPS NMEA antenna aiming tracker.

ericgibbs

Joined Jan 29, 2010
21,459
hi C,
I will look at your program, I have not used the 18F2431 so I will have to study the pdf doc's.

You should have the two quadrature signals coming out of your opto interrupter logic.

The Index mark on the encoder disc is important, usually I have it so that when the scanner is pointing due North the Index mark is detected.
I used an optical encoder with 900 counts per rev of the disk, fed this thru an edge detector to give 3600 counts per rev, so I had 0.01 degree resolution.
The encoder Index mark is detected at 000.0 degrees, so the user set up the system to point due North if he wanted Azimuth bearing, when the Index mark was at 000.0 degree.

The problem you have is that you have attached the low resolution encoder to the motor shaft which rotates 10 times faster than the scanner head, so an Reset index mark is meaningless.
Is there any position on the actual scanner head that you could place an Index detector.?

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
I will look at your program, I have not used the 18F2431 so I will have to study the pdf doc's.

You should have the two quadrature signals coming out of your opto interrupter logic.

The Index mark on the encoder disc is important, usually I have it so that when the scanner is pointing due North the Index mark is detected.
I used an optical encoder with 900 counts per rev of the disk, fed this thru an edge detector to give 3600 counts per rev, so I had 0.01 degree resolution.
The encoder Index mark is detected at 000.0 degrees, so the user set up the system to point due North if he wanted Azimuth bearing, when the Index mark was at 000.0 degree.

The problem you have is that you have attached the low resolution encoder to the motor shaft which rotates 10 times faster than the scanner head, so an Reset index mark is meaningless.
Is there any position on the actual scanner head that you could place an Index detector.?

E
Hi E,

On each motor I have two outputs. I've called them CHA and CHB.

Is it true that two 18F2431 PIC are needed for two motors?

Yes, it's too late to add an index mark inside the motor housing, also due to lack of space. The opto encoder is on the 100:1 end of the motor/gearbox, giving 3600 counts at the movement end 0.1 degree of resolution. I can add micro switches externally, for North at 000.0 degree and another for horizontal 000.0 degrees Altitude.

C.
 

ericgibbs

Joined Jan 29, 2010
21,459
Hi C,
On checking your program I see that you are not using the PIC's QEI internal interface hardware, any reason why?

The 18F2431 has only on set of QEA, QEB INX pins, so you could not use just one PIC for two encoders if you use the QEI option.
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
I will look at your program, I have not used the 18F2431 so I will have to study the pdf doc's.

You should have the two quadrature signals coming out of your opto interrupter logic.

The Index mark on the encoder disc is important, usually I have it so that when the scanner is pointing due North the Index mark is detected.
I used an optical encoder with 900 counts per rev of the disk, fed this thru an edge detector to give 3600 counts per rev, so I had 0.01 degree resolution.
The encoder Index mark is detected at 000.0 degrees, so the user set up the system to point due North if he wanted Azimuth bearing, when the Index mark was at 000.0 degree.

The problem you have is that you have attached the low resolution encoder to the motor shaft which rotates 10 times faster than the scanner head, so an Reset index mark is meaningless.
Is there any position on the actual scanner head that you could place an Index detector.?

E
Hi E,

On each motor I have two outputs. I've called them CHA and CHB.

Is it true that two 18F2431 PIC are needed for two motors?

Yes, it's too late to add an index mark inside the motor housing, also due to lack of space. The opto encoder is on the 100:1 end of the motor/gearbox, giving 3600 counts at the movement end 0.1 degree of resolution. I can add micro switches externally, for North at 000.0 degree and another for horizontal 000.0 degrees Altitude.

C.
Hi C,
On checking your program I see that you are not using the PIC's QEI internal interface hardware, any reason why?

The 18F2431 has only on set of QEA, QEB INX pins, so you could not use just one PIC for two encoders if you use the QEI option.
E

Hi E,

The only reason for not using the PICs QEI is my lack of skill, I was trying to use them.

Ok, I'll use one 18F2431 for each motor.

I was wondering about the 18F2431s talking to the 18F4520 main PIC. I assume that the 18F4520 sends serial numbers (Calculated degrees of Azimuth and Altitude) to each 18F2431 which then control the motors.

C.
 

ericgibbs

Joined Jan 29, 2010
21,459
was wondering about the 18F2431s talking to the 18F4520 main PIC. I assume that the 18F4520 sends serial numbers (Calculated degrees of Azimuth and Altitude) to each 18F2431 which then control the motors.
Hi C,
Don't you have block diagram showing the interconnections and the function of each PIC.?
I am working on 18F2431 simple test program for the Encoder that uses the internal QEI functions, I will post it over the weekend.

Eric
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Hi C,
Don't you have block diagram showing the interconnections and the function of each PIC.?
I am working on 18F2431 simple test program for the Encoder that uses the internal QEI functions, I will post it over the weekend.

Eric
Hi E,

Here's a diagram, let me know if it is ok.

I assume it's ok to have the two MOTOR PIC RXs reading from one MAIN PIC TX

I intend to control a 12v motor from each of these MOTOR PICs. I'm just looking into how this is done.

I have previously designed H bridge circuits, but remember how many times I blew the mosfets, by the motor changing direction too quickly:eek::(

C
 

Attachments

Last edited:

ericgibbs

Joined Jan 29, 2010
21,459
hi C,
This demo 18F2431 program will enable you to check your encoder using Oshonsoft..
Note the changes to the LCD PIC pin connections.

To test, use the PIC view in the IDE.
RC3 is the INT0 pin, so when the sim is running, clicking this pin high will create an Interrupt.
If RC2 is Low, the count will go down, if RC2 is High the count will go Up.

You could then modify the program for a PIC, until we hear from Vladimir about the QEI module feature in the IDE.

Eric
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
This demo 18F2431 program will enable you to check your encoder using Oshonsoft..
Note the changes to the LCD PIC pin connections.

To test, use the PIC view in the IDE.
RC3 is the INT0 pin, so when the sim is running, clicking this pin high will create an Interrupt.
If RC2 is Low, the count will go down, if RC2 is High the count will go Up.

You could then modify the program for a PIC, until we hear from Vladimir about the QEI module feature in the IDE.

Eric
Thanks Eric,

The program is working ok in the Sim.

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Here is the latest Schematic for the 4x Channel h_bridge.

Any comments appreciated.

EDIT: Pots etc added.
EDIT: 'N' GND added. Pull up to 12V changed to 5V. (Corrected by JJW #451)

C
H-Bridge 4 Channel.jpg
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,840
The H-bridge has no ground connection.
You can't put pullup resistors to 12V from PIC outputs.
The gate voltage of the P-fets is too low, about 3V
Hi JJW,

I've corrected the connections in circuit #450, thanks for spotting them.

I am under the impression that 'P' mosfets are pulled up from 12v, and in this case approx 9v (negative) which is a mirror image of the 'N'-fet set-up so with reference to 0V looks like app 3v. I'll re-check and report back.

C
 

jjw

Joined Dec 24, 2013
823
Hi JJW,

I've corrected the connections in circuit #450, thanks for spotting them.

I am under the impression that 'P' mosfets are pulled up from 12v, and in this case approx 9v (negative) which is a mirror image of the 'N'-fet set-up so with reference to 0V looks like app 3v. I'll re-check and report back.

C
It is 9V with reference to 0V, -3V with reference to 12V
 

jjw

Joined Dec 24, 2013
823
hi jjw,

33k/[33k+10k] = 0.767 * -12v = -9.2V wrt the +12V line

Eric
If it is 33k then it is ok.
It looks like 3.3k on my screen.
The schematics should not be posted as jpg
Btw. the resistances are quite big, could be problem with switching times
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,459
Hi,
This is my version of the circuit.
Its got the option of regular 2 input control for PWM or 4 input control, with dynamic braking and PWM.
E
EDIT: R1 and R6 are both 4K7
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Hi,
This is my version of the circuit.
Its got the option of regular 2 input control for PWM or 4 input control, with dynamic braking and PWM.
E
EDIT: R1 and R6 are both 4K7
Hi Eric,

Thanks for the circuit.

Am I correct that:
R13 = the motor?

Is it correct that there are no pull ups on the M1 M2 gates?

What wattage are the R15 R12 0.22 Ohm resistors, do they need heat sinks?
Are R8 and R9 10 Ohm or 10K?

C.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,459
R13 is the 12V 1.5A motor, nominal 8 Ohms
The 0.22 Ohm resistors are 2 to 3 Watts rating, no H/S
Use 100 Ohms for R8 and R9.

If a pull up was required on M1, M2, what voltage would it be pulled up too, it cannot be 12V.
The IRF7201 will be conducting sufficiently when Gated from a 5V PIC pin, without a pullup.

If you decide to use the dynamic braking option take care with the PWM switching/ braking section when you write the program.!
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,840
R13 is the 12V 1.5A motor, nominal 8 Ohms
The 0.22 Ohm resistors are 2 to 3 Watts rating, no H/S
Use 100 Ohms for R8 and R9.

If a pull up was required on M1, M2, what voltage would it be pulled up too, it cannot be 12V.
The IRF7201 will be conducting sufficiently when Gated from a 5V PIC pin, without a pullup.

If you decide to use the dynamic braking option take care with the PWM switching/ braking section when you write the program.!
Thanks Eric, all noted.

I can add pull ups easily at this stage, to 5V

I think the motors don't stop immediately, so I will wire them for dynamic braking, and use them if necessary.

I've 'popped' many mosfets, because of incorrect switch over timing:(

C.
 
Top