Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Servo Controller

Status
Not open for further replies.

Caspajack

New Member
Hi all,

Firstly I'd better explain what I want to do, then I'll say what I've found on the net and here.

I'm buiding a flight simulator and I want to make some instruments that will look as though they are doing something.
The idea is that when I throw a two pole switch the servo will, (slowly) move a pointer to a given point. Then when the switch is closed again it will move back to the start position.

I've found various circuits using a simple 555 IC controlled by a variable resistor, I believe it might be possible to use two different resistors each side of the switch to get the servo to move to a set point. However I have no idea if this can be made to travel slowly rather than zipping stright to it's resting position.
Any help or suggestions would be appreciated. I should add that I'm quite a novice in this area, although I'm quite proficient in soldering.

Regards
Joe.
 
It's doable. What is your definition of 'slowly'? 2 secs? 10 mins?
 
Yes, servos can be slowed down. The usual way today involves a microcontroller. The principle is nicely described here:

https://www.pololu.com/blog/22/rc-servo-speed-control

One of many examples: https://www.diyrc.com/picaxe-slowdown.htm

Several years ago, a hobbyist did the same thing with a bunch of 555's: https://www.rcgroups.com/forums/showpost.php?p=11052611&postcount=2 (click on go_slow)

Finally, it is said that if one increases the spacing between signals (i.e., decreases the frame rate), a servo will be slowed down. I have never tried it, but suspect it is not a very good method.

John
 
Sorry, I see the point... :eek:

It needs to be about 10-15 seconds from rest to maximum travel. In this instance it's to show the APU start up, where the engine temperature rises slowly. And of course falls when the APU is shut down.

Thanks everyone for the quick response

Regards
Joe.
 
Last edited:
I'll try simulating a circuit to do this using a quad comparator/opamp IC and get back to you; hopefully later today.
 
Here you are, neighbour.:)
The circuit generates 5V servo-control pulses with a repetition period ~ 30mS. Pulse width increases over a period of ~ 10 secs when the NC switch is opened. Pulse width starts at <1mS and ends at >2mS.
VR1 and VR2 set respectively the range of pulse widths and the initial pulse width, but there is some interaction between the controls. The 10 sec period can be increased by increasing C3 and/or R8.
I've attached the .asc file in case anyone wants to run the simulation.
 

Attachments

  • SlowServo.gif
    SlowServo.gif
    15.2 KB · Views: 144
  • SlowServo.asc
    3.2 KB · Views: 141
Here you are, neighbour.:)
The circuit generates 5V servo-control pulses with a repetition period ~ 30mS. Pulse width increases over a period of ~ 10 secs when the NC switch is opened. Pulse width starts at <1mS and ends at >2mS.
VR1 and VR2 set respectively the range of pulse widths and the initial pulse width, but there is some interaction between the controls. The 10 sec period can be increased by increasing C3 and/or R8.
I've attached the .asc file in case anyone wants to run the simulation.

Thanks Alec, that's most impressive and something I would never have even though of... leave alone created ;)

As someone relatively new to this side of the wire, I assume that the servo input is attached to the output from U1b and the positive the 10K trimmer, negative going to ground. I understand that the servo is powered when the NC switch is opened, does it return to rest when the switch is closed again? :confused:

Again excuse my ignornce but what program do you use to simulate these circuits?
In case you're interested I've attached an image of the monster this is going to be used for.

Kind regards,
Joe.
 

Attachments

  • deck.jpg
    deck.jpg
    241.6 KB · Views: 152
I assume that the servo input is attached to the output from U1b and the positive the 10K trimmer, negative going to ground. I understand that the servo is powered when the NC switch is opened, does it return to rest when the switch is closed again?
If V1 is a 6V supply (I chose that arbitrarily as you didn't say what supply you intend using for your sim instruments) then U1b will provide +ve-going pulses of about 5V (the LM324 output is always a volt or so below the +ve supply). That could be the signal input to a standard modeller's servo running from 5V (four NiMH cells). I hadn't considered where your servo gets its supply from, but if it's happy running from 6V then the V+ at the top of VR2 should be ok for the servo V+ and circuit ground would connect to the servo ground. A 10uF (or greater) capacitor (not shown) should be connected across the battery, and a 100n cap (likewise not shown) connected across the + and - supply pins of the LM324 close to those pins, to absorb voltage spikes.
I also hadn't considered switching the servo on and off. Unless you're very concerned about current drain you can leave the servo continuously on while the circuit is powered on. With the minimum pulse width < 1mS the 'home position' of the servo will be at one extreme position of its travel. When the switch is opened the servo will move slowly to the other extreme (or some fixed intermediate position depending on the settings of VR1 and VR2). When the switch is closed again the servo will move rapidly back to the home position (to slow this return down would need mods to the circuit).
what program do you use to simulate these circuits?
LTSpice. A free download from Linear Technology. Used by many members of this forum. Recommended.

Edit: Nice pic. I'm envious. Have those cats qualified as pilots yet?
 
Last edited:
Thanks again Alec for the detailed explantion, I'll get some LM324s and get it onto a breadboard.

I guess the fluffy covers need an explanation. I made the mistake of mentioning to the wife that in reality these seats are covered in sheepskin, (that's a fact if you don't beleive me have a look on airliners.net). So the wife in her kindness bought me these fluffy ones for Christmas... what can I tell you! They have to stay.. :)

Kind Regards
Joe.
 
I may be missing something obvious here, but . . .

If all you want to do is move a meter needle slowly back and forth when you open and close a switch, there's a much easier (and cheaper) way to do it.

Power a voltmeter with (an appropriate) DC voltage that's fed through a resistor and the meter terminals are in parallel with an electrolytic capacitor (it has a + or - marking so be sure to match polarities). The values of the resistor and cap will determine how long it takes the meter to reach full scale. At first, the cap acts as a short (closed circuit, so make sure your resistor is large enough to prevent a fuse from blowing), so the meter reads "0" when voltage is first applied, but as the cap charges, it increases in resistance, so more voltage goes to the meter, and the needle gradually rises to report the voltage supply. By choosing higher values you can even make it fast at first, then gradually slower and slower as the capacitor reaches full charge (and looks like an open switch).

When the power is disconnected, the cap acts as a very small short-term battery that gradually discharges through the meter, so it slowly falls from the full voltage reading to zero. Just put a "Temperature" scale on the meter face.

By choosing good values for the resistor and cap, you can choose the speed that the meter rises to full and drops to zero (can be two different speeds). High values will take a long time to rise and fall, low values will make the needle move quicker.

If you want just the fall-time to be faster, put a second resistor in parallel with the capacitor to give it an additional discharge path. Measure the resistance of the meter itself, use the same value resistor, and the meter will fall twice as fast. Again, different values will also affect the rise time, since the extra resistor is now in the rise circuit, as well.

To save time, you can work with battery power to keep from blowing a fuse, and use potentiometers to get the resistances the way you want, and connect capacitors in parallel or series to get odd values. Capacitors work the opposite of resistors -- caps in parallel handle the same voltage, but have more capacitance. Resistors in parallel handle more wattage, but have lower resistance. Caps in series have less capacitance, resistors in series have more resistance. Multiply R (in ohms) times C (in farads, 1 uF is 1/1,000,000 Farad) to get timing values.
 
Sounds like a good idea and would be worth investigating, however my initial scout through ebay produced lots of meters but the majority of them have a very narrow scale. Somethin like 45 degrees. I already have the housing and the face plate for the gauge so that part is not a problem, yet the only round scale gauges I could find were quite expensive. Averaging over £30.00 which would make the circuit Alec devised a much cheaper option.

I do appreciate you taking the time to reply, particularly when you've gone into such detail. Nevertheless if you know of a dealer selling the round type of meter at a reasonable price I would be grateful.

Kind regards
Joe.
 
Last edited:
I've revised the circuit to allow better control of the servo speed. R8 determines the speed up the scale from the home position; R8 and R10 in parallel determine the speed back down to the home position. I've also included the two caps (C4, C5) I mentioned above, and the pin numbers for the LM324. Note that only two of the op-amps in the LM324 quad package are used here. The other two (unless used for another instrument) should have their inputs grounded.
 

Attachments

  • SlowServo2.gif
    SlowServo2.gif
    23.8 KB · Views: 157
  • SlowServo2.asc
    4.7 KB · Views: 109
alec,
You may find this useful for the Switches in your LTSpice asc files.

E
 

Attachments

  • switch1.zip
    2.1 KB · Views: 111
Thanks, Eric. Already got that, but forgot I had!:eek: I find a voltage source a quick and easy substitute (when appropriate).
 
Thanks again Alec, I can see you've invested some time in my problem. I've ordered a couple of LM324s when thay arrive I'll give it a go.

Kind regards
Joe.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top