AELEXIAN EMPIRE
Would you like to react to this message? Create an account in a few clicks or log in to continue.

SERVO MOTOR

Go down

SERVO MOTOR Empty SERVO MOTOR

Post by ultrasonic™ Fri Aug 27, 2010 9:01 pm

What is a Servo?
SERVO MOTOR Servomotor

Anatomy of a Servo
Servos consist of four basic components: a motor, gear reduction, feedback device (typically a variable resistor potentiometer), and a control board. The motor, using a series of gears, turns the output shaft and the potentiometer simultaneously. The potentiometer is fed into the servo control circuit and when the control circuit detects that the position is correct, it stops the motor. The figure shows a disassembled servo.
SERVO MOTOR Servoooooooo
SERVO MOTOR Servopinconfig

Controlling a Servo
Servos are controlled with a 5vdc positive-going variable pulse width that repeats every 20mS. The pulse length determines the servo output shaft position but the 20mS frame rate is not position critical. The frame rate does need to repeat at least every 20mS or it will loose power or even stutter. The servo was designed for pulse widths that vary from 1.0mS to 2.0mS, where 1.5mS is centered. In the normal range the servo will move +/- 45 degrees from the centered (neutral) position.

Most servos can be positioned to around +/- 90 degrees from neutral by expanding the range to 0.75mS to 2.25mS. However, care must be taken to avoid commanding a servo beyond its capabilities. Personal experience with Hitec servos reveals all of the standard size servos can achieve a full 180 degree range. Micro and special purpose servos are often limited to less than 180 degrees.

Hitec digital servos are a special case. They only recognize a range of 0.90mS to 2.10mS and will only provide a +/- 70 degree range of motion unless the end stops are changed with their servo programmer. When I change the range of a Hitec digital servo I simply set the left and right end stop values to 200. This provides a full 180 degree rotation but still uses the 0.90mS to 2.10mS pulse range. Another anomaly with Hitec digital servos is they do not require constant updating to hold position. Once a digital servo has received a single positioning pulse it will hold position until it is powered down or receives a new positioning pulse.
SERVO MOTOR Servoangle

- ajak -
ultrasonic™
ultrasonic™
24V BATTERY
24V BATTERY

Posts : 4475
Join date : 2010-08-19
Age : 38
Location : Davao City

Back to top Go down

SERVO MOTOR Empty Re: SERVO MOTOR

Post by ultrasonic™ Fri Aug 27, 2010 9:07 pm

A servo motor consists of several main parts, the motor and gearbox, a position sensor, an error amplifier and motor driver and a circuit to decode the requested position. Figure 1 contains a block diagram of a typical servo motor unit.

The radio control receiver system (or other controller) generates a pulse of varying length approximately every 20 milliseconds. The pulse is normally between 1 and 2 milliseconds long. The length of the pulse is used by the servo to determine the position it should rotate to.

Servo Motor Block Diagram
SERVO MOTOR Servoblock
Figure 1. Servo Motor Block Diagram

Starting from the control pulse we will work though each part of the diagram and explain how it all fits together. Once we have gone through how the servo works we will investigate how the control pulses can be generated with a microcontroller.

Pulse width to voltage converter

The control pulse is feed to a pulse width to voltage converter. This circuit charges a capacitor at a constant rate while the pulse is high. When the pulse goes low the charge on the capacitor is fed to the output via a suitable buffer amplifier. This essentially produces a voltage related to the length of the applied pulse.

The circuit is tuned to produce a useful voltage over a 1ms to 2ms period. The output voltage is buffered and so does not decay significantly between control pulses so the length of time between pulses is not critical.

Position Sensor

The current rotational position of the servo motor output shaft is read by a sensor. This is normally a potentiometer (variable resistor) which produces a voltage that is related to the absolute angle of the output shaft.

The position sensor then feeds its current value into the Error Amplifier which compares the current position with the commanded position from the pulse width to voltage converter.

Error Amplifier

The error amplifier is an operational amplifier with negative feedback. It will always try to minimise the difference between the inverting (negative) and non-inverting (positive) inputs by driving its output is the correct direction.

The output of the error amplifier is either a negative or positive voltage representing the difference between its inputs. The greater the difference the greater the voltage.

The error amplifier output is used to drive the motor; If it is positive the motor will turn in one direction, if negative the other. This allows the error amplifier to reduce the difference between its inputs (thus closing the negative feedback loop) and so make the servo go to the commanded position.

The servo normally contains a single integrated circuit and a hand full of discreet components to implement the entire control system.

Controlling a Servo Motor with a Microcontroller

From the above we can determine that we need to generate a pulse approximately every 20ms although the actual time between pulses is not critical. The pulse width however must be accurate to ensure that we can accurately set the position of the servo.

PWM modules


Many microcontrollers are equipped with PWM generators and most people initially consider using these to generate the control signals. Unfortunately they are not really suitable.

The problem is that we need a relatively accurate short pulse then a long delay; and generally you only have one PWM generator share between several servos which would require switching components outside the microcontroller and complicate the hardware.

The PWM generator is designed to generate an accurate pulse between 0% and 100% duty cycle, but we need something in the order of 5% to 10% duty cycle (1ms/20ms to 2ms/20ms). If a typical PWM generator is 8 or 10 bits say, then we can only use a small fraction of the bits to generate the pulse width we need and so we loose a lot of accuracy.

Timers

A more beneficial approach can be implemented with simple timers and software interrupts. The key is realising that we can run a timer at a faster rate and do a single servo at a time, followed by the next and the next etc. Each of the outputs is driven in turn for its required time and then turned off. Once all outputs have been driven, the cycle repeats.

This approach is demonstrated in the PIC servo controller project.

The timer is configured so that we have plenty of accuracy over the 1 to 2 millisecond pulse time. Each servo pin is driven high in turn and the timer configured to interrupt the processor when the pulse should be finished. The interrupt routine then drives the output low.

For simplicity, the output pins can be arranged on a single port and the value zero (0x00) written to the port to turn off all pins at once so that the interrupt routine does not need to know which servo output is currently active.

After the pulse has ended, the microprocessor sets up the next pulse and begins the process again.

- ajak -
ultrasonic™
ultrasonic™
24V BATTERY
24V BATTERY

Posts : 4475
Join date : 2010-08-19
Age : 38
Location : Davao City

Back to top Go down

SERVO MOTOR Empty Re: SERVO MOTOR

Post by ultrasonic™ Fri Aug 27, 2010 9:12 pm

Guide to PWM and PPM

PWM and PPM are two common words used in the R/C industry. PWM stands for Pulse Width Modulation and PPM stands for Pulse Position Modulation. Some devices that use PWM for control are ESC's (electronic speed controls) and servos. PWM is a technique used to relay data in the form of a varying pulse width.

You may be already familiar with binary, 1's and 0's; where a 1 is represented as 'on' and a 0 as 'off'. An example of this would be a light switch. Turning the switch on would indicate a 1, off a 0. In the case of a PWM/PPM signal, a voltage applied indicates a 1 and vice versa. However, in the case of R/C electronics this 'on/off' data is not enough, this is where the pulse width comes in.

The way we relay data to a servo for instance is the time the pulse is on. In the case of R/C electronics this time is usually around 1-2 milliseconds. A servo or ESC will monitor this pulse and begin counting when the pulse is detected and stop counting when the pulse stops. The time the pulse is on will determine the servo position. For example, sending a servo a 1ms pulse will make the servo swing completely left while a 2ms pulse will swing the arm completely right.

Generally in R/C equipment an entire PWM pulse will last a total of 20ms. The entire pulse is called a frame. A complete frame will include both the time the pulse is high (1-2ms) and the time the pulse is low. The image below represents a typical PWM frame.
SERVO MOTOR Servoooooooopulse

Although the frame lasts 20ms the important part of the pulse is the time the pulse is on; 1-2ms. Although the time between pulses is not as important it does play an important role. Usually keeping the time between pulses around 20ms is best. If the delay is longer, a servo for example will lose holding power. A pulse can be generated much faster but 20ms is best for most situations.

So what is the point in waiting up to 20ms? This is an R/C specific and will help understand PPM. Again, PPM stands for Pulse Position Modulation. PPM basically is several PWM signals lined up back to back. A PPM frame looks like this:
SERVO MOTOR Servoooooooopulses

Aside from the gaining servo holding power, the reason for the 20ms frame is just having the ability to line up several PWM signals in the same frame. Like I said before, the time the pulse is on is what is important because we are able to strip out this relevant data from a PPM frame to re-generate a PWM frame. For example, if a radio only sent 1 PWM signal at a time, it would take 20ms per channel. If you have an 8 channel radio each update would take 160ms. The same data can be packed into a PPM frame and only take 20ms per update. Transmitters and receivers are the two most common R/C devices that use PPM.

The following are lists of common devices that use PPM and PWM.

R/C Devices that use PWM Pulses:

* Servos
* Electronic Speed Controllers
* R/C switches
* R/C lights
* R/C receivers
* Data loggers
* Autopilot/Stabilization systems
* Servo Controller

R/C Devices that use PPM Pulses:

* R/C transmitters
* R/C receivers
* Autopilot/Stabilization systems


- ajak -
ultrasonic™
ultrasonic™
24V BATTERY
24V BATTERY

Posts : 4475
Join date : 2010-08-19
Age : 38
Location : Davao City

Back to top Go down

SERVO MOTOR Empty Re: SERVO MOTOR

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum