Subject:
|
Faster Firmware/Motor Control
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Tue, 17 Jul 2012 16:59:23 GMT
|
Viewed:
|
25114 times
|
| |
| |
Hi all,
One of the common ways I like to control the speed of a gearmotor (in NQC) is by
introducing a loop, for example, like this:
while(true)
{
OnFwd(motor);
Wait(a);
Off(motor);
Wait(b);
}
I often do this as a motor approaches a setpoint (say an offset from a target
position as measured by a rotation sensor) or the like. Variable a and b could
be defined somewhere else but usually are around 1/100 or 2/100 of a second.
Any more than that and the motion gets jittery. I sometimes swap out Off for
Float, depending on the application (unloaded the motors tend to glide right
through the Float, however).
I seem to remember hearing someone (Dick Swan?) built some Firmware a while back
that ran much faster and allowed for 1/1000 second (millisecond) intervals for
the Wait command, instead of 1/100 (decisecond). Any truth to that?
Obviously if I could cut down the time delay, the sawtooth of "On" to "Off" gets
a lot crisper and the whole thing would work a lot better.
Thanks in advance,
-Iain
|
|
Message has 1 Reply:
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|