I've been trying it, but so far only whistling. Is it supposed to be wired as the original circuit or each direction wire pairs to 12 or 13?Have you tried the latest program in post #499.?
hi,direction wire pairs to 12 or 13?
Hi Eric,hi,
This is how we should test at the moment, using ONLY pins 12 and 13 of the 16F886, with the 100R and 1K pairs connected to these pins, as I have previously described.
E
EDIT:
Re-posted the original connections drawing
Hi E,hi C,
Now that you have PWM speed and direction control for your Pan and Tilt motors, I would suggest that you complete the scanner head metal work assembly.
Use Manual control of the Pan and Tilt motors [ extend the wires to the outside of the head from the ADC speed control pots and the 2 Direction buttons Up/Down, Left/Right.]
Determine the maximum Slew rates required for Pan and Tilt [ note the ADC pot voltage settings], also the 'over run' degrees of the Head position.
On the ADC input pots, have a push button that will set the ADC input voltage to zero.
So determine the optimum slew rates and then when pushing the ADC Zero input, note how far the head over runs after pressing the button.
Lets know what you measure.
Future work
You will also have to decide how and in what format you are going send Azimuth and Elevation data from the Neo RX/ 18F4520 PCB to the motor 16F886 PCB's
The 18F2431 Quad is going to be a major problem for you when using Oshonsoft Basic for programming as the IDE simulator does not support the Quad or ADC functions.
Your planned micro-switch Indexing of the 0 degree North and Horizontal level for your encoder discs will have to resolve to better than +/-0.05 degree, if the quadrature counters are to stay in sync.
E
BTW: IMO its too early to start laying out another PCB. For these tests, use the existing modified PCB with a 16F886 and the last program I posted.
Hi Eric,hi C,
Did you read my Thread regarding the 18F2431 mods required to make prommers work.
E
http://forum.allaboutcircuits.com/threads/pic-18f2431-programming-problem.102740/
Hi Eric,hi,
Looking at the 18F2431 quad module, how many QA pulses do you expect from the encoder for a 360 degree rotation of the Head unit.?
Eric
Hi E,hi,
OK.
I have written a number of routines for checking the coding for the 18F2431 quad module using Oshon Basic, they work OK in Sim and in a PIC.
It will be an easy task to add the CCP [ PWM] drive ASM routines.
As you are counting 3600 pulse per Head rev, what format do you plan to use for sending the Neo PIC Azimuth value to the the 18F2431.?
The method I have tested is UART, 'A123' [ all ASCII ] no Crlf,
Also did you intend using the MAXCNT counter or the INDEX for keeping the encoder in sync with the Neo values.?
Reason for asking is it makes sense for me to write routines that suit your programming.
E
hi,The AZ index only sends a '1' at North, to re-set the AZ to zero. I don't fully understand how the encoder will keep in sync, but I think the interrupts only trigger when MAXCNT and POSCNT match, but I need to check a bit more. I'll go with whatever you suggest. Remembering the overrun when the motor is at full speed, I can't see how it won't 'hunt' around the 'match point', if we can't reduce the PWM as the tracker gets near to 'match point'
Hi Eric,hi,
Assume MAXCNT and POSCNT counters 'match' option has been configured in the program to generate and Interrupt.
The MAXCNT holds the maximum count that the POSCNT can count UP too before it rolls over from 359 to 000 or DOWN 000 to 359, at the same time generates an Interrupt.
eg:
If MAXCNT is preloaded with say 359 [ max count degrees in a circle] then if the POSCNT counter is counting UP, when it reaches 359, the module generates an Interrupt on the next QA, the POSCNT will be reset to Zero and the count up when receiving more QA pulses.
When counting down, the POSCNT will count down to Zero and on the next QA pulse it will preload the POSCNT with 359 and the count down from there, also generate an Interrupt.
The potential problem with this config option is the 359 UP or the 0 > 359 DOWN interrupt may not be in sync with the Head North. I realise its possible to point the Head North and initialise the POSCNT to zero.
When the 18F4520 sends the Remote Azimuth value the 18F2431 will PWM drive the Head towards that Azimuth value, you will have to keep reading the POSCNT until the to Azim values match.
OR
If you configure the POSCNT to reset on the INDEX pulse [ which should be at Head North], every time the Head passes thru North the INDEX will be re-synced. ie:000 or 360 depending on UP/DOWN.
So when the 18F4520 sends the Remote Azimuth value the 18F2431 will PWM drive the Head towards that Azimuth value, you will have to keep reading the POSCNT until the to Azim values match.
This is the method I would suggest.
E
Look at the attached figure from the d/s the POSCNT and MAXBUF have a second name depending on the configuration.Reading a previous QUAD explanation from you, you mention POSCNT, MAXCNT, POSBUF and CAPBUF. Am I correct that these words are slightly different in the data sheet and need to be studied? i,e, POSCNT=POSCNTL or POSCNTH
I dont see why you have posted the EDIT.???EDIT: Just read that if PIC is set for IC then POSBUF and CAPBUF are used if set to QEI then POSCNT, MAXCNT are used. I think IC is used when sensing 3 phase motors (Brushless) for speed control.
Hi E,hi,
I know there are 360 degrees in a rev.
So is due North, 000 degree or 360 degree or both.?
As the INDEX occurs after the next DOWN, QEA/QEB pulse after zero [000], the POSCNT cannot reset to 360 , else there would be no change.?
Also when counting UP, the counter resets on the next QEA/QEB pulse at MAXCNT, if it was preloaded with 360, it would reset to 000, so no change again.!
Look at the attached figure from the d/s the POSCNT and MAXBUF have a second name depending on the configuration.
I have had to use the CAPBUF label in the program as Oshonsoft does not recognise the POSCNT and MAXBUF , only the CAPBUF's.
I dont see why you have posted the EDIT.???