Servo Motors, how do they work?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is a servo motor it's used in precision engineering applications and it uses internal electronics as well as mechanical gears to achieve precise control so we're going to learn how they work and also how to program one in this video which is sponsored by private internet access you can get a three year subscription with four extra months for free for only 1.98 per month using the link in the video description their vpn service helps safeguard your online privacy and can protect up to 10 devices at a time to let you browse the web with increased anonymity it works with all major streaming services and it runs on windows mac android ios and even linux they offer a 30-day money-back guarantee so do check them out i'll leave a link for you in the video description down below a servo motor looks something like this it converts electrical energy into mechanical energy this type of motor is used for precise control and we can connect different attachments to achieve this we control the position of a servo motor by using a controller so we often find it used in robotics and automation and even for the steering of remote control cars usually when we connect a dc motor to a power supply it just rotates constantly but a servo motor is different these will not instantly rotate instead these are sent signals which tell the motor exactly how far to rotate typically the motor will rotate just 180 degrees but we can get smaller or larger values these are closed loop type there's usually a pin inside to physically stop the motor rotating further some servo motors will not have this and are able to rotate the full 360 degrees these ones are known as open loop type closed loop provides the best control and these are more commonly used so we will focus on this type in this video on the side of the servo motor we usually find a weight value this is not the weight of the motor it represents the torque of the motor or how much force it can apply this small motor has a rating of 9 grams this larger one has a rating of 25 kilograms this is how much force the servo motor can apply to a lever we normally find this measured in kilogram centimeters or ounce inches what does this mean well for example this servo motor is rated for 25 kilograms so at one centimeter from the shaft it can support 25 kilograms but at two centimeters it can only support 12.5 kilograms and at three centimeters it can only support 6.25 kilograms we can find more information on the data sheet in this example we see it can be connected to a supplier of between 4.8 and 7.2 volts the higher the voltage applied the higher the torque will be so the stronger the motor will perform but as we can see the motor has limits and it will stall if it exceeds these limits when the motor stalls we can see the current dramatically increases the operating current depends on the load applied as well as the voltage the motor consumes more power when moving it uses very little to hold its position the higher the voltage applied the faster the motor will rotate we measure this rotation in seconds taken per 60 degrees of rotation the physical size of the servo motor increases with the torque rating that's because it needs larger gears and a larger electrical motor to achieve this let's look inside one to see the main parts and understand how it works by the way we have also covered stepper motors and dc motors previously do check them out links down below when we look at a servo motor we see the main housing with the electrical connections entering the side in this case the red wire is the positive voltage wire the brown wire is the ground and the orange wire is the pulse width modulation signal wire these colors do vary by manufacturer on the top we find a small splined gear we can connect various attachments to this to make use of the rotation inside the unit we first find a number of gears and these are supported by some bearings on one side we have the output and on the other side we have the input the input is connected to a dc motor which will drive the gears this setup is known as a compound gear train the gears are arranged in this way to ensure a compact design the motor has a high rotational speed but a low torque so the gears help convert this into a low speed but high torque output in this example there is an 11 tooth pinion gear on the motor this connects to a 61 tooth gear which is directly joined to a 12 tooth gear this connects to a 48 tooth gear which is directly connected to a 13 tooth gear this connects to a 47 tooth gear which is joined to a 13 tooth gear and this connects to the final gear which has 42 teeth so for this example using some arbitrary numbers if the input was 259 rpm with 1 newton meters of torque then the output would be 1 rpm but 259 newton meters of torque therefore we have converted high speed low torque into low speed high torque there are losses which i've purposely ignored for this example we have covered how to calculate this in our previous video on gear trains do check that out links down below the dc motor is connected to a small circuit board inside the unit this controls the rotation of the motor as well as the direction of rotation also connected to the circuit board is a potentiometer this connects to the output gear of the servo this is just a variable resistor as the final gear rotates it rotates the potentiometer which changes the resistance and the circuit board reads this to know the position of the output let's see how this works but first where have you seen these motors used or what would you use them for let me know in the comment section down below a controller sends a signal to the servo motor which determines which position it should rotate to the controller could be something like an arduino or even a simple servo tester this is a pulse width modulation signal which means it sends pulses of voltage down the wire the width of the pulse can be varied it's similar to if we press a switch to turn a light on and off the longer we press the switch the longer the pulse of electricity these pulses are sent every 20 milliseconds so we have around 50 pulses per second or 50 hertz we can use an oscilloscope to see these pulses for example this is the signal sent by an arduino and this is the signal sent from the servo tester the width of the pulse determines the position of the servo if we send a wide pulse the servo moves to the left if we send a small pulse it rotates to the right we can move to any position between these two points by simply changing the width of the pulse as long as the pulse remains the same the motor will hold its position as soon as there is a change the servo motor moves we can see here that when i rotate the dial on the servo tester it's changing the width of the pulse and the servo motor's position changes to align with this signal as i increase the voltage for the power supply the height of the pulse also changes but the position of the motor remains the same if we use an arduino board we can run a program to control the position or we can even use a potentiometer to control the position manually ourselves we will learn how to build this later on in the video the signal enters the servo's circuit board and is converted to a voltage it passes through a comparator and then to a motor driver the motor driver controls the rotation of the dc motor it uses an internal h bridge circuit to control the direction of rotation either clockwise or counterclockwise to get to the required position this rotation causes the gears to rotate which causes the final gear and servo arm to also rotate connected to the final gear is the potentiometer you might recognize a potentiometer to look more like this they essentially work exactly the same the resistance increases and decreases between a minimum and a maximum value as the arm is rotated you can see here that the multimeter is measuring the resistance and when i turn the shaft the resistance changes this acts as a voltage divider if we apply a voltage across the potentiometer for example 5 volts we can then measure the change in voltage due to the varying resistance this change is proportional to its position when the arm is turned fully to the left the voltage is 5 volts at the center it is 2.5 volts and when turned fully to the right it is 0 volts the potentiometer is also connected to the comparator in the internal circuit board and the voltage is monitored to provide feedback we know that the resistance changes between a minimum and a maximum value as the potentiometer dial is turned so the comparator is going to compare the voltage of the potentiometer to the voltage of the controller signal if there is a difference then the motor will turn until the difference is close to zero then the server knows it is in the correct position so it will wait there until there is another change we will learn how to control a server motor in just a moment but i just want to remind you to check out our sponsor private internet access using the link below where our viewers can get a three year subscription with four extra months for free for just 1.98 per month with this you can enjoy safer internet access across 10 devices click the link in the video description down below we're going to learn how to program an arduino to control a servo using a potentiometer for this project you'll need an arduino a breadboard a servo motor a potentiometer some wires and a power supply first connect a wire from the 5 volt port to the positive rail of the breadboard then connect another wire from the ground port to the ground rail now connect from the 5 volt rail to the left side of the potentiometer then connect the right side to the ground rail then connect the center pin to port a0 next connect from the 5 volt rail to the servo motor then connect the ground wire to the servo and finally connect the signal wire to port 9 of the arduino the circuit should look something like this so now we need to connect the arduino to our pc so we can write the code you can download my arduino code for free links down below for that the basic code is very easy we just type this at the top this tells the arduino that we are using commands from the pre-made servo library then we need to create an object basically we declare the name of the servo so that we can tell it what to do i will call this servo 1 then we tell the arduino which of its pins is connected to the servo motor in our case we have pin 9 so we type that now as we are using an external potentiometer as an input device to control the servo motor we will need to declare this also so we type this which just lets the arduino know which port it will receive a signal on then we type this line of code in this just links the named servo to the pin which we have also declared next we type this code in this is saying that we need to read the value from the analog input of the potentiometer which is connected to port a0 the arduino reads the voltage through this pin but it doesn't understand voltage because this is an analog signal port so it will generate a number between 0 and 1023 depending on the voltage when the potentiometer is all the way to the left it receives the full voltage so it is 1023 when it is turned all the way to the right it is at 0 volts so we read 0. the value changes as we turn the dial the servo doesn't understand these numbers though it wants to know a rotational degree between 0 and 180 degrees so this is creating a map or conversion scale to say that if the signal is 0 then the position is 0 degrees if the signal is 1023 then the position should be 180 degrees the final line just sends the information to the servo it writes to the servo to let it know what to do so then we send the code to the arduino and shortly after we will be able to control the servo position with the potentiometer once you understand this you can make more advanced circuits check out one of the videos on screen now to continue learning about engineering and i'll catch you there for the next lesson don't forget to follow us on facebook twitter instagram linkedin tick tock and the engineeringmindset.com
Info
Channel: The Engineering Mindset
Views: 1,896,183
Rating: undefined out of 5
Keywords: servo motor, servomotor, servo, automation, electronics, arduino, servo motor control, control, servo motor working, motion control, dc servo motor, stepper motor, servo drive, engineering, motors, microcontroller, servo motor working principle, servo motors, electrical engineering, arduino tutorial, aerospace engineering, control system, potentiometer, pulse width modulation, pwm, fp sigma, servo motor basics, servo motor tutorial, mechanical engineering, inside servo motor, servos, how
Id: 1WnGv-DPexc
Channel Id: undefined
Length: 15min 11sec (911 seconds)
Published: Sun Jan 23 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.