Javelin running to fast
Enrique
Posts: 90
I’m driving a stepper motor using a Javelin. I noticed that sometimes the motor would spin much faster than usual. After taking some signal samples using an USBee probe I noticed that in those cases the Javelin was actually running faster.
·
Has anybody had a case of the Javelin clock sometimes running faster than usual?
·
Has anybody had a case of the Javelin clock sometimes running faster than usual?
Comments
If there would be a different crystal frequency (javelin uses 25MHz) then those uarts
would never work in which case we would have seen posts about
uarts never working. As I have not seen such posts it is more likely
there is something in your program setup that sometimes makes
your steppers run faster.
regards peter
··
·
I have a very simple program the uses pins 0-3 to drive the motor and I used pin 4 to check how many times the main loop iterates on every timeout.
·
In both the fast and the slow cases the program loops four times for every phase change, just that in the fast case the pin 4 pulses are 1.6 ms apart and in the slow case they are 2.77 ms apart.
·
I am uploading the program and I saved the logic probe samples in case someone wants to take a look at them.
·
·
Enrique
the call to motor.Run(), so you just have
while (true) {
· CPU.pulseOut(1,pin);
}
That would really show if you have a fast javelin.
The motor.Run() takes different timing depending on the step value.
As a result·you could miss a timeout just, in which case an
addtional timeout test is done before Run returns.
That could explain the 1.17msec difference.
regards peter
I measured the pin4 interval both in the fast and the slow run when there is a phase change and when there isn’t, these are the results I got.
Run No phase change Phase change
Slow 2.7ms 4.4ms
Fast 1.6ms 2.6ms
How do you explain this?
Enrique
related to the use of the Timer function timeout().
That's why I asked to run just a while (true) loop with the
pulseOut call. That·should give persistent results
no matter how many times you reset the javelin.
If however, you get the same variation running just
the pulseOut command, then the cause could be
the crystal I suppose.
regards peter