Subject:
|
Re: using PWM output to control Lego motors
|
Newsgroups:
|
lugnet.robotics, lugnet.technic
|
Date:
|
Wed, 2 Feb 2005 22:50:40 GMT
|
Viewed:
|
3332 times
|
| |
| |
In lugnet.robotics, Joe Strout wrote:
> In lugnet.robotics, Rob Hendrix wrote:
>
> > PWM for servo pulse is on a three wire system (Pos, Neg, and data). The
> > pulse is a series of different length square waves sent to the servo or ESC
> > in a certain length of time. This pulse is then translated by the servo or
> > ESC as a "position" it needs to set its output at (whether that be a
> > mechanical position [servo] or voltage PWM "position" [ESC].
> >
> > An ESC converts the servo pulse PWM to a different kind of PWM. This PWM is
> > like the one LEGO uses on the RCX. It is a series of square waves which are
> > either ON or OFF during a certain length of time to simulate different
> > voltages. They theory is to simulate 4.5 volts on a 9 volt system, just
> > turn off your power source half the time. PWM like LEGO uses runs on a 2
> > wire system (Pos, Neg).
>
> Thank you, this clarifies things for me quite a lot. I was thinking that PWM
> was PWM, but now I see the important difference -- one is a means of
> transmitting data, and the other is a means for controlling current (integrated
> over many pulses).
>
> > Doesn't seem cost effective to buy one receiver and 4 ESCs for your project.
>
> This comment seems to imply that there's a better solution... but I don't see it
> at this point. What did you have in mind?
>
> Thanks,
> - Joe
The signals output by the RC receiver will drive servos or RC motor speed
controllers. The signal consists of a pulse of 1-2ms width in an 18ms cycle.
For a servo, 1ms corresponds to 45 degrees turn one way, 1.5ms to centre and 2ms
to 45 degrees turn the other way. For a speed controller it is forward and
reverse instead of +/-45 degrees.
A speed controller for RC cars is usually designed to work with 7.2V and up to
40A current (up to 568A peak) from NiCd batteries. Lego gearmotors require 9V
at only 300-500mA. Therefore an RC speed controller is unsuited to Lego motors.
With sufficient expertise you could build your own speed controller:
I would suggest a circuit that mixes the incoming pulse with a fixed pulse of
1.5ms in 18ms, synchronising the fixed pulse cycle to the incoming pulse. That
way, a pulse is generated that has the duration of the difference between the
incoming pulse length and 1.5ms. The circuit will probably require a Phase
Locked Loop in order to lock onto the incoming pulse. The difference pulse has
length proportional to the speed output required. The phase locked loop
consists of a phase detector (the mixer), a low-pass filter to clean up the
difference pulse and a voltage-controlled oscillator that generates the fixed
pulse of 1.5ms in 18ms. The loop acts to synchronise to the incoming pulse by
the VCO varying the 18ms slightly. Once it has locked it should stay locked,
since the receiver will always output a signal even if the transmitter is off.
The VCO typically runs on for a few cycles anyway, even if the incoming signal
is lost.
The rest of the circuit would detect the direction - whether the incoming pulse
was longer or shorter than 1.5ms - and turn the difference pulse into PWM for
the motor, using an H-bridge of transistors or a standard motor driver IC. The
Melexis MLX10402 is the motor driver used in the RCX and Code Pilot, so this is
very suitable for driving gearmotors.
Any practical electronics experts willing to make such a circuit?
Mark
|
|
Message is in Reply To:
5 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|