Circuit request. Servo motor feedback control circuit. - Page 1
Forum section: electronics / general

author: wilfred
author_rank: Super Contributor
timestamp: October 19, 2013, 10:02:46 am
content: /.

author: awallin
author_rank: Frequent Contributor
timestamp: October 19, 2013, 11:42:35 am
content: Quote from: wilfred on October 19, 2013, 10:02:46 amServo means feedback control - what feedback do you have from your motor?If you want an all analog solution there are tach-feedback devices that output a voltage proportional to the speed of the motor. An op-amp circuit that keeps the speed of the motor constant would then be fairly simple. But a linear power-stage is really only an option for very low power motors.If you are talking about an R/C servo it usually has a potentiometer as a feedback device. Again a simple op-amp + H-bridge circuit could be used.The usual feedback from a motor is a pair of A/B quadrature encoder pulses.The quadrature encoder feedback + for larger motors we want to run the powerstage with PWM really makes this a good candidate for a microcontroller.Microchip and others have app-notes on this.

author: Kremmen
author_rank: Super Contributor
timestamp: October 19, 2013, 03:24:58 pm
content: I can help but first let's be specific about the terms.1. A "servo" in the most general sense (from Latin root meaning slave) is any mechanism that follows a command. Whatever the nature of that command is in practice.2. A position servo, usually in certain contexts (esp. RC vehicles) abbreviated just "servo" means a device where the angle of an output shaft is controlled by the input. An arm may or may not be attached to the shaft to enable linear motion of something.3. A servomotor is a combination of a motor and a special servodriver controlling it (or sometimes just the motor alone, but in this context). The servodriver controls either position, speed or torque, either directly of the motor shaft or then a joint or axis of a controlled machine (i.e. the feedback is taken from the machine instead of the motor shaft directly).All servos share the property of being feedback systems. Thus you will have a command input to the controller, where it is compared to the relevant feedback signal(s) from the plant (i.e. the motor in this case), and a control output is calculated based on the control law in effect. I won't go into details of control theory but you should familiarize with it so that you have at least a general idea what is involved.Some practical questions that need answering before you can get anywhere:- what will be the nature of the command input? Typically it can be one of analog voltage, pwm duty cycle, or a digital message in some format. All have their uses and no single one is "best" all around.- what will be the nature of the feedback? For a complete solution you need feedback from shaft torque, shaft speed and shaft position. In practice and for a small motor you may safely skip the torque part.- how will you implement the controller? All "professional" servo controllers these days are combinations of processors and FPGAs or ASICs, but a simple one can be implemented using analog circuits without too much trouble.With that sorted out, i understand your question so that you have a motor and you wish to build the servodriver to create the motor/driver combination (alt 2 above). If so, that is entirely doable, for varying values of "doable". Things you need to decide and design are:-Input signal conditioning. The need to do so depends partly on the choice of controller implementation. Say you want to have a pwm input signal and analog controller. Then it would make sense to convert the pwm to voltage and use that as command input.-Position feedback. A simple solution is a potentiometer on the output shaft measuring rotation angle directly. You just need to be careful about selecting the right kind of pot so that you don't break it in case of overtravel etc etc.-The actual controller can be as simple as an op amp with suitable local feedback, or it can be a MCU running a control algorithm of some kind. A PID would be the most common but there are others. Both analog and digital choice have pros and cons.You could probably buy a better servo cheaper from eBay, but hey, where would the fun be in that? So by all means have a go and ask questions. We'll try to help. Once you have your servo running, you will know a lot of things you didn't know today.

author: sacherjj
author_rank: Frequent Contributor
timestamp: October 19, 2013, 03:58:59 pm
content: Kremmen, you are getting exactly what I was thinking of for simple servo.PWM -> Voltage via Low Pass Filter. Pot on output shaft as voltage divider. Logic from Comparator driving simple H-bridge chip or something. This would be different control than the pulse length measure of RC servos though.For that it would be hard to use analog, because the pulse on time is very small and overall generated DC would not vary much.

author: Kremmen
author_rank: Super Contributor
timestamp: October 19, 2013, 04:54:45 pm
content: As you said the controller output can be fed into a simple pwm modulator that creates another pwm signal (not the incoming one). It is not that difficult to do using analog tech - you just need a triangle ramp generator with suitable cycle time, and a comparator to create the pwm duty cycle from the voltage difference of the triangle voltrage and controller output. Another comparator to select the motor direction based on the effective sign of the control signal and there it is, more or less.

author: GK
author_rank: Super Contributor
timestamp: October 20, 2013, 12:31:27 am
content: Quote from: wilfred on October 20, 2013, 12:14:44 amThe servo controller compares the input control voltage (which represents the desired position) to a feedback voltage provided by the pot. In response the motor is driven until the two voltages are equal.If bipolar rails are available the simplest analogue servo controller for a small DC motor would just use a audio amplifier IC. For a single rail a pair of amplifiers could be used in bridge configuration. Think of a standard op-amp application circuit; all you are doing is taking the negative feedback from the pot wiper instead of the op-amp output, while using the op-amp output to drive the motor.The only tricky bit is optimizing the frequency compensation (that will need to be applied) for optimal servo loop dynamics.

author: sacherjj
author_rank: Frequent Contributor
timestamp: October 20, 2013, 02:01:31 am
content: Quote from: wilfred on October 20, 2013, 12:14:44 amIn all honesty, the easiest is probably going to be to take the innards of a servo and just modify what is needed to drive the higher torque motor and work out your physical design (gears). Then link a same resistance pot to the output.

author: Smokey
author_rank: Super Contributor
timestamp: October 20, 2013, 04:36:37 am
content: You need three things to make a position or velocity servo out of a dumb motor.1) Some means of getting position or velocity feedback2) Something to read that sensor feedback and generate a control signal like a microcontroller or DSP.3) Some sort of power amplifier to drive the motor that accepts the commands from the controller.Velocity control is easier since the feedback can be courser. Position is harder because your position resolution is directly related to your feedback resolution.Look up optical encoders from companies like US Digital. They can be added as an aftermarket kit to many motor shafts.http://www.usdigital.com/products/encodersAnother way to go if you just want course resolution is to make a opto transmitter/receiver circuit and print a black-white encoder wheel. There are all kinds of sites that show how to do that.Once you have the feedback, you just need to get a microcontroller that can read it and the rest is software (with some complex control algorithms thrown in for fun). Once you have interpreted the feedback with the processor you need to create a command signal for the power amplifier. What that command signal is depends on what kind of power amplifier you are using. It could be an analog voltage to control a velocity or current mode amplifier, a digital packet representing position or velocity over rs232 or Ethernet, or you can generate the PWM directly to control an h-bridge.The size of your power amplifier depends on the size of the motor and the size of your load. These go all the way from single chips to rack mount units. There are a huge variety available, some open source, some kits, some commercial.If you are just looking for a beefy mid size servo, check out CNC retrofit kits for milling machines. Those will come with the motor with feedback built in, amplifier, and some means of hooking it up to a controller which is usually PC based. They usually also include all the other stuff you need like cables to connect everything.

author: zapta
author_rank: Super Contributor
timestamp: October 20, 2013, 04:38:20 am
content: Quote from: Kremmen on October 19, 2013, 03:24:58 pmSome servos do not require feedback. For example selsyns. Don't know how popular they are these days though.http://en.wikipedia.org/wiki/SynchroThe amplitude of the 3 AC voltage determine the rotation angle of the slave. The voltages can be generated by another selsyn connected in reverse (the one on the right in the video, no electronic required) or by special D/A circuit.Edit: looks like synchros are still in use. For example this D/Ahttp://www.ddc-web.com/Products/74/Default.aspxand this and many other A/D convertershttp://www.analog.com/en/analog-to-digital-converters/synchroresolver-to-digital-converters/ad2s1200/products/product.html

author: awallin
author_rank: Frequent Contributor
timestamp: October 20, 2013, 09:22:53 am
content: check this:http://www.openservo.com/

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2013, 05:36:06 pm
content: Quote from: zapta on October 20, 2013, 04:38:20 amThat does not qualify as a servo in the sense control theory defines the concept. Those things are more like balancing bridge circuits.If there is no feedback, then it is not a servo.http://en.wikipedia.org/wiki/ServomechanismP.S. I haven't tried to model a synchro circuit but a virtual model could include a feedback term because the secondary rotor definitely follows the primary rotor. Whether the analysis would reveal a feedback term i cannot say. But the point is moot in the sense that if there is a (virtual) feedback term, then the synchro actually qualifies as true servo and if there isn't, it isn't a servo.

author: sca
author_rank: Regular Contributor
timestamp: October 20, 2013, 09:54:05 pm
content: The classic IC in older RC servos and ESCs was the ZN409I don't think it's still available, but the data sheet is and should give some ideas.sca