Choosing RC Servo Controller

Hi, I hope this is the correct group for my enquiry.

I need to integrate an RC servo motor into my project and I'm trying to find the best way to control it. I'm unable to generate the PWM control signal myself so I'm need to buy a servo controller. I don't have any serial comms available, however, only digital IO lines. The only servo controllers I've found so far are controlled via 232 (or USB) - does anyone know of any controllers that I could control with digital IO? For example, one pin to turn movement on/off, one pin to set direction. Something simple like that. I've got sensors that provide position feedback so I know when to stop the movement (but I don't necessarily know exactly where that position will be).

Any help would be much appreciated!

Thanks, Rob

Reply to
rgagarrett
Loading thread data ...

It's pretty easy to generate PPM (not PWM) signals to control a hobby servo with just a 555 & a couple of resistors & capacitors. A potentiometer can be used to vary the pulse width. It's also pretty easy to do with any microcontroller. What kind of "digital IO" do you have in mind?

Google "serial", "servo", & "controller" for a huge selection of OTS products.

JM

Reply to
John Mianowski

snipped-for-privacy@gmail.com wrote in news:120e578e-c698-40d4-90aa-47ce63dd1b94 @m73g2000hsh.googlegroups.com:

RC servos take a pulse width in, and use it to generate a position. I think if you want the interface you describe, you'll need to build it yourself.

--
Scott
Reverse name to reply
Reply to
Scott Seidman

** You need to know how a standard RC servo operates.

It rotates fast and stops dead at the position set by a variable lenght input pulse repeated at a 50 Hz rate. The end positions of it rotation are at 1mS and 2 mS with 1.5 mS giving the mid point.

If you disable the control pulses, the servo ceases operation an will no longer hold its position with motor force.

Or is it your plan to remove the internal servo drive IC and position pot and substitute your own system ?

...... Phil

Reply to
Phil Allison

You could control an RC servo by wiggling a digital IO line up and down in the right fashion.

Hang on lets take a step back. It sounds more like you could use a stepper motor driver than a servo. What are you trying to do?

Although a bit of software could generate the right waveforms.

ISTR Nominally 50Hz rep rate with a 1-2ms pulse to indicate requested position. Plenty of hobby PIC based sample code out there.

Regards, Martin Brown

** Posted from
formatting link
**
Reply to
Martin Brown

A RC servo needs a 150ms pulse, increasing in length if it moves one way, decreasing in length mkes it move the other way. It in fact has already position feedback from a potentiometer on its shaft, so a certin pulse width corresponds to a a specific poition. Perhaps what you are looking for is a _STEPPER_ motor with controller. IIn such a case you have directon signal (0/1), and a step signal, that you can also create yourself as 0/1/0 pulses.

Reply to
panteltje

If you have a timer or enough processing power available, you can control an RC servo by simply wiggling a digital I/O line high and low in a specific way: You must create a pulse roughly every 20ms, and the pulse width must be varied between 1ms and 2ms to move the servo from one end to the other of its available throw.

You can control an RC servo that way if you rip out the internal controller and drive the motor directly using a few transistors. By doing so, the servo is, of course, no longer a servo, but just a motor.

It is entirely possible to design a controller to do what you want, but it will be a waste of time, because you are essentially doing the same signal conversion twice.

In that case, all you need is a motor. You already have the controller part of the servo.

You probably need a gearbox of some sort as well, so it may actually be a good idea to rip the controller out of an RC servo. If you choose that approach, you should also modify the servo mechanically to remove the end stops.

--
RoRo
Reply to
Robert Roland

** Wrong - it's 1.5 mS.

..... Phil

Reply to
Phil Allison

Thankyou everyone for your help on this issue. Perhaps a few more details about my situation would help! I've got some specialist custom electronics already built that's used for accurate stepper motor control - we use this already in applications such as moving syringes (for use in scientific laboratory pumps). I'd like to use these electronics to combine the syringe pump with a valve that switches between two positions. The valve is moved with an RC servo motor. The motor drive electronics includes some 0-5V digital IO lines, but they're not suitable for creating the PPM signal required for the servo motor.

In the light of the responses here I think the easiest thing for me to do is to build my own controller using a 555 chip which I can control via the IO lines. I know this should be straight forward, but I didn't know whether there was a controller board already out there that does what I want.

Thanks again for the help, Rob

Reply to
rgagarrett

** Sounds like a plan ....

..... Phil

Reply to
Phil Allison

On a sunny day (Wed, 16 Jul 2008 09:26:22 +1000) it happened "Phil Allison" wrote in :

I stand corrected, amazing how fast one forgets things one programmed not so long ago...

Reply to
Jan Panteltje

"Jan Panteltje" "Phil Allison"

** Those familiar with RC gear know there is a pulse stream sent by the transmitter with a repetition rate of about 40 / 50 Hz. The number of pulses sent is one more than the number of channels and can be as high as 10 - which must fit into a 20 to 25 mS long frame.

The rest is history - as they say.

...... Phil

Reply to
Phil Allison

On a sunny day (Wed, 16 Jul 2008 20:38:10 +1000) it happened "Phil Allison" wrote in :

Yes, in remote controlled toys et. I have used the RC servos for camera control, driven by a PIC:

formatting link
The software has the option of stopping the repeating of the pulse, as when not much force is applied the servo will stay where it is. That will save power (a lot). It all depends on the application.

Reply to
Jan Panteltje

Do you mean a PWM signal? PPM signals are used for remote controls for RC models, but a RC servo motor usually is controlled with a PWM signal, like described in the other posting and which you can see here:

formatting link

If you need two different pulse widths, which you can switch with a digital signal, I would use a microcontroller, e.g. the PIC12F508, which you can buy for $1.25. The program is about 100 lines of assembler, including comments and the output pulse can be adjusted with 64 us resolution:

formatting link

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

No, PPM is what was referenced & PPM is what is described in your link (even says so in the text).

PWM (Pulse Width Modulation) is often used for controlling motors, & is described below (I know it's unfashionable to refer to Wikipedia, but it happens to have a good presentation):

formatting link

JM

snipped-for-privacy@frank-buss.dehttp://www.frank-buss.de,http://www.it4-systems.de

Reply to
John Mianowski

Maybe I misunderstood the page, but for me it looks like PPM is the way how the FM receiver transmits the signal. The German page of Wikipedia has a nice diagram, which describes PPM:

formatting link

It says that the pulse width is constant, which is not the case for the animation in the page I referenced. For me it looks like PWM, but the length of the full cycle is not important, only the length of the high impulse, so it is not the usual PWM, where the duty cycle is important.

This Wikipedia page says it, too, that a PWM signal is used for controlling servo motors:

formatting link

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

They're talking about Pulse PHASE Modulation, not Pulse WIDTH Modulation or Pulse POSITION Modulation. Alsok known as Phase Modulation. The entry notes that this modulation technique is rarely used in the field, which isn't quite right; PPM is widely used in R/C systems & has been for about 50 years. Phase Modulation, though, isn't widely used. Here's the PM entry in English:

formatting link

That isn't right, & it's not consistent with what's farther down the page, where they describe PPM in a little bit of detail.

Wikipedia says that PPM is used to control (hobby) servos in another (correct) entry:

formatting link

"Applications for RF Communications

Narrowband RF (Radio Frequency) channels with low power and long wavelengths (i.e., low frequency) are affected primarily by flat fading, and PPM is better suited than M-FSK to be used in these scenarios. One common application with these channel characteristics is the radio control of model aircraft, boats and cars. PPM is employed in these systems, with the position of each pulse representing the angular position of an analogue control on the transmitter, or possible states of a binary switch."

Actually, that isn't 100% correct, either. It should read, "PPM is employed in these systems, with the WIDTH of each pulse representing the angular position of an analogue control on the transmitter..." I've done a lot of work with R/C systems, & I'm very confident in my understanding of the difference between PPM & PWM. The page that you linked to earlier (which I've seen before) is an excellent reference on the subject of PPM.

While PPM is widely used to transmit position data from a R/C transmitter, through a receiver, & ultimately TO a hobby servo, electronic speed control (ESC), or other motion/position-controlling device, PWM is the typical ESC output TO an electric motor, with the pulse duty cycle serving to govern the motor's speed. This modulated full-voltage pulsing is much better at controlling motor speed than the other alternative, which is varying the voltage level, especially at slower speeds. PWM is typically used WITHIN a hobby servo, by the controller to drive the motor, while the input TO the hobby servo is PPM. In fact, hobby servos' controller boards make excellent low- power variable-speed reversing motor controllers if the position feedback is eliminated or set to a fixed value.

JM

Reply to
John Mianowski

This is a bit confusing. The German word for pulse-position modulation is Pulsphasenmodulation.

This looks like an analog modulation concept, but I think it would be the same like pulse-position modulation, if you use square waves, because then the phase is simply the position. And after some googling I think you are right, that pulse-position modulation is used in R/C systems. But looks like it is interpreted a bit different, e.g. on this page:

formatting link

you can see high pulses of different lenghts, but it is really just an inverted pulse-position modulation, with different positions of low impulses of the same length :-)

You mean PPM from this page?

formatting link
I think this is nearly correct: The page says, that multiple channels can be transfered and this page:
formatting link
shows the scope diagrams for the output of the NE5044 where you can see how it looks like.

But the signal of each single channel is a PWM signal and fed into the control input of the servo motor. This is the reason for the strange definition of about 20 ms cycle time and 1 ms to 2 ms for controlling the angle of a servo motor: I think it is very simple to decode a PPM signal and fed the different PWM signals to the servo motors, without any postprocessing.

Last but not least, my PIC program, which generates a PWM signal, should work with a servo motor and should do what the OP needed, if the description of the pulse length and pause between pulses is right.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

I don't think that's a "native" German word at all ;-)

The 2nd diagram on this page shows what the input of the transmitter/ output of the receiver would look like. On the transmitter's end, an ENCODER samples the various analog inputs (sticks, knobs, switches, etc.) & multiplexes them into a string of pulses. The example shows 8 "channels" of position data that correspond to 8 input devices. There's an extra-long "start" pulse & a fixed gap between pulses. The width (duration; length of time) of each pulse corresponds to its associated input device's position.

The receiver outputs this pulse string to a DECODER (de-multiplexer) that distributes each pulse to its appropriate device. The cycle repeats every 20 msec. so every 20 msec. a new Pulse #1 is distributed to Channel 1, a new Pulse #2 is sent to Channel #2, etc. The servo, ESC, etc. that is attached to Channel #1 only sees the 1st of 8 pulses, refreshed at about 50 times per second.

Don't worry about the "inverted" signal. Some manufacturers use Positive Shift while others use Negative Shift. It works the same either way, but you have to make sure you know which shift a given system uses since they aren't compatible with one another. Some newer radios can be configured to work either way (just not both at once).

page?

formatting link

Right, but it doesn't give any specific example.

Right. The 2nd figure shows what would be seen either at the input to the transmitter (output of NE5044 encoder) OR the output of the receiver, before the pulse string gets decoded. You can see the 8 individual channels' variable-width pulses, with the longer "start" (also referred to as "sync") pulse that's used to synchronize transmitter & receiver (the receiver's decoder needs to know where the start of the 8 pulses is).

No, each individual pulse is a PPM signal. For PPM, a specific pulse width translates to a specific angular position, at least in a hobby servo. In PWM, width is not important; duty cycle IS. Duty cycle means the percentage, over a defined period of time, that the signal is "high". In a 20 msec. period, 100% duty cycle would be "high" for the full 20 msec. That never happens in the R/C pulse string.

Not strange at all. For each channel (the example shows 8 channels), there is a 1-2 msec. pulse that indicates each of 8 devices' positions. The 8 pulses are repeated every 20 msec.

No, each of the 8 pulses is "split" out & fed to an individual "channel" on the receiver. 8 different servos, speed controls, or whatever can be plugged into each "channel" of the receiver. The servo that is plugged into Channel 1 gets the 1st pulse. The servo that is plugged into Channel 2 gets the 2nd pulse, .. , the servo that is plugged into Channel 8 gets the 8th pulse. Each servo gets an updated position (via pulse) every 20 msec.

Probably not. The duty cycle may be outside of the range that a hobby servo expects (i.e. 1-2 msec. "on time" every 20 msec., or a 5-10% duty cycle range). If you are generating RANDOM-width pulses, not the specific-width pulses expected by a hobby servo, there's no telling what results you might get from the hobby servo, position-wise.

A hobby servo expects a regular (i.e. every 20 msec., approx.) pulse between 1-2 msec. in length. Suppose a hobby servo has a range of motion of 180 degrees. The "9 o'clock" position would correspond to a

1 msec. pulse. The "3 o'clock" position would correspond to a 2 msec. pulse. The "12 o'clock" position would correspond to a 1.5 msec. pulse. Other pulse widths would produce angular positions accordingly. If you create a series of 1.0 msec. pulses, the servo will move to 9 o'clock & stay there. If you gradually increase the pulse widths, the servo will move clockwise until the pulse widths stabilize or reach 2.0 msec., at the 3 o'clock position.

On the other hand, if you subject the hobby 1servo to a series of random-width pulses typical of a PWM signal, 2 things are going to happen: First, the hobby servo will only respond to those pulses between 1-2 msec. Pulses with widths outside this range may produce unexpected results; perhaps no response at all, or maybe "slamming" the servo to one or the other extreme of its range. Second, because of the random pulse widths typically generated by PWM, the hobby servo will "jitter" all over the place instead of holding on a single position, or smoothly moving across its range. You're also probably going to have a lot of trouble producing the appropriate "start" pulse. PWM does not necessarily need to produce random pulse widths, but many are set up that way to prevent a "ringing" in the motor. Since duty cycle is all-important in PWM, while pulse width is not, any number of odd-width pulses can be put into a given time period as long as the correct duty cycle is maintained.

Here are some decent explanations of PWM:

formatting link
formatting link

PWM is often used for controlling DC motors, not hobby servos. PPM is useless for controlling DC motors.

PPM: Single pulse per period; pulse width directly corresponds to analog position; cycle time can vary depending on pulse widths transmitted. PWM: Pulse widths may be random; may be multiple pulses per period; duty cycle corresponds to analog position; cycle time is fixed. PM: Pulse widths consistent, position in time (phase) corresponds to analog position; cycle time would be variable due to inter-pulse timing.

JM

Reply to
John Mianowski

This is a bit hairsplitting, but if you have a PWM signal with a constant wavelength of 20 ms, changing the duty cycle from 5% to 10% is the same what you call a PPM signal.

My PIC program generates pulses with 1 ms length and 2 ms length, with very low jitter (I didn't add additional code for exact synchroniation with the timer, so the jitter should be less than 3 clock cycles, which is 3 us for the internal RC clock). After the pulse there is a pause of 20 ms. It is not a PWM signal with constant wavelength, because the pause length is constant (which could be enhanced), but I think it should work.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.