You are on page 1of 13

Servo motor

Electronic Basics #25: Servos and how to use them


https://www.youtube.com/watch?v=J8atdmEqZsc
When it comes to positioning, a stepper motor is usually a good choice.
But there is another popular motor with a driver called a servo which connects
the motor to the controller in an easy-to-use housing.
In this episode I will show you how such a servo works and how you can easily use
it with and without a microcontroller.
Let's get started.
The most common servos are very similar like these three here
They all have a sawtooth shaft, on top of the servo to be able to attach different
types of accessories needed in your projects and 3 wires coming out of the servo.
Brown is ground, red is the power which usually requires a voltage between 4.8V
to 7.2V and orange is the servo control which must be a PWM signal whose
period time is 20 milliSeconds or 50Hz and fill 1 to 2 milliseconds so 5% to 10%
while for 1 millisecond it is -90 degrees of the motor shaft, 1.5 milliseconds equals
0 shaft degrees, a 2 milliSeconds +90 degrees shaft.
So we can take the shaft to a total of 180 degrees.
But before connecting the appropriate signal, let's remove 4 screws to remove
the top and bottom covers.
At the top we can see 4 different sizes of gears that reduce the speed of the
engine from around 3000 RPM to 50 RPM - 100 RPM and thus increases the
torque.
But that's not all, there is also a potentiometer in the servo.
This potentiometer creates a voltage divider that generates a voltage depending
on the position of the motor shaft, and acts as a feedback for the driver circuit, so
the system knows what position the shaft is.
So KC5188, the integrated circuit constantly compares the potentiometer voltage
to the PWM signal and then activates the integrated h-bridge so that the motor
starts to work in any direction.
To achieve a 0V difference between two signals and this is basically how the
average servo works.
Of course, torque and rotational speed among other useful information
They are always listed in the specification.
in case you need something stronger in your design, you can always replace your
servo.
This MG996 consists of metal gears with a larger motor to increase the torque
and an integrated circuit with separated N and P type mosfets to create an h-
bridge that can hold more current.
But let's go back to the controlling signal.
After connecting the servos for separate power supply, we can easily use pin 9
arduino and some code that contains the servo driver library to generate a signal
for servo control.
Using the potentiometer as an analog input on pin A0
I can vary the length of the enable signal between 1 millisecond and 2
milliseconds.
But as you can clearly see, this signal does not make the full 180 degrees of
rotation of the servo shaft.
instead, we need something that will produce 0.5 milliseconds to almost 2.5
milliseconds to take advantage of the full 180 degrees of servo rotation.
The arduino library can handle it very well.
But we don't necessarily need an arduino to do that.
A simple 555 chip can handle it with two resistors, one diode, two capacitors and
a potentiometer in this configuration can produce a PWM signal well.
The on time is from 1.5 milliseconds to 2.5 milliseconds depending on the position
of the potentiometer.
And the time at 0V is between 17.5 milliseconds and 18.5 milliseconds.
Thus, the signal will not have a fixed periodic time of 20 milliseconds.
But the servo won't care too much about such a small detail and it worked as we
intended.
But let's say you need a servo that moves 360 degrees basically how a normal
engine works.
You can use a DC motor with gear ratio.
But your project will work best with an easy-to-mount servo.
It's not a problem.
This is a simple hack on how to do that.
Remove the protection that is attached to one of the gears, remove the auxiliary
potentiometer and replace it with two 10k resistors to create a voltage divider
which I tell the controller that it is always at 0 degrees.
Sending a signal below 1.5 milliSeconds, the shaft moves clockwise and above 1.5
milliSeconds counterclockwise.
in both cases with variable speed but unfortunately the signal after removing the
potentiometer is missing, so the servo will work forever.
And if you're too lazy for this hack, there are also ready-made servos with this
mod, which even allow you to control the 0 degrees angle of the potentiometer.
And after explaining all of this to you, you already know something about servos.
I hope you liked this movie.
And that you've learned something too
Don't forget to Like, Share and Subscribe
Be creative!
And see you next time!
Phim mô phỏng kỹ thuật: Nguyên lý hoạt động của động cơ servo
https://www.youtube.com/watch?v=hg3TIFIxWCo
This industrial robot needs a drive with particularly high demands.
Not only does the robot have to be able to accelerate and decelerate fast – also
precisely positioning is required.
In fact, here is a three-phase servomotor installed.
In this video we will first clarify the term servomotor and servo drive in general,
then the 3-phase-servo drive.
The servomotor is a part of a servo drive - whether brushless DC motor,
synchronous or a robust asynchronous motor.
But one thing in common is the detection of the rotor position by a sensor.
This can be a resolver or an encoder – in this case you see an incremental
encoder.
This sensor device gives feedback to a controller to keep for example the
rotational speed or torque constant or to reach the target position as fast as
possible.
A servo motor system includes the servo motor with its feedback device, a servo
amplifier and a controller.
But how these devices work together?
The servo controller sends low voltage control signals for position, speed or
torque to the servo amplifier.
Now these commands are amplified up to high power, which the motor can use.
The electrical pulses of a sensor are sent back to the amplifier.
This amplifier uses this information to control speed and rotor position.
The job of the servo motor controller, also named as the motion controller, is to
close the loop on the system.
By constantly interchanging data with the servo amplifier, the motor parameters
like torque, speed or position can be adjusted immediately.
Some manufacturers offer modules, which combine the controller and the
amplifier.
So, you would have fewer parts, fewer connections and a smaller footprint.
Talking about an AC servo motor you usually mean a 3 phase synchronous motor
whose rotor field is excited by permanent magnets.
So, you can get a very powerful and brushless motor of small size.
The stator winding produces a rotating magnetic field whose rotating speed and
force is controlled by the amplifier and controller.
In order to position quickly, all these motors must have a low moment of inertia,
which can be achieved by an elongated shape.
The functioning of a synchronous motor was already explained in another video
of our learnchannel.
Please check our playlist.
Watch also our next videos!
Arduino Tutorial: Using a Servo SG90 with Arduino
https://www.youtube.com/watch?v=SfmHNb5QAzc
Dear friends welcome to another video!
This is Nick from educ8s.tv and today we are going to see how to use a servo with
Arduino.
Let’s get started.
In this video I am using an SG90 servo with Arduino.
As you can see I have loaded a simple sketch which makes the servo to rotate
from one end to the other.
This project is very simple to build so it is ideal for beginners.
In addition to that, by knowing how to control a servo you can build more
advanced and interesting projects in the future like a robots that use many
servos!
A Servo is a small device that has an output shaft.
This shaft can be positioned to specific angular positions by sending the servo a
coded signal.
That’s why we need the Arduino, in oder to send that signal to the servo.
Servos in general require a lot of current to operate since they have a motor
inside.
If you only need to control one small servo like this one you can connect it directly
to Arduino.
If you need to control two or more servos you need an external power supply or
battery pack.
Today we are going to use only one servo so we are going to connect it directly to
an Arduino Uno.
We are using an SG90 micro servo today which is a very popular one and very
cheap.
It costs around 3$.
You can find a link for the servo in the description of the video.
The connection with Arduino is extremely easy.
The servo has three leads.
The brown one is the Ground so we connect to it Arduino Ground.
The red one is Vcc so we connect it to Arduino 5V.
The last lead, the yellow one is the signal lead which goes to any digital pin you
like.
We connect it to digital pin 8 today.
As you can see, if we power up Arduino, the servo starts rotating!
It is that easy!
Now let’s see the code of the project.
Arduino team has developed a very easy library in order to control servos.
All you have to do is to include it in your program.
At first you have to create a Servo object and attach it to a digital pin.
In our case it is digital pin 8.
Next all we have to do is to write to the servo an angle and the servo will position
its shaft at this angle.
Easy isn’t it.
So, in this example program, I tell the servo to start from 0, move to 90 degrees,
then wait a second, and return back to a 0 degrees angle.
Now let’s see the program I showed you earlier that make the shaft to rotate
from one end to the other.
It’s just two for loops that increase or decrease the shaft angle by 10 degrees.
You can find the code for both programs in a link in the description of the video.
As you can see controlling a servo is so easy with Arduino.
I am going to build many projects using servos in the future.
I am going to start with a small “Radar” using this servo, an ultrasonic distance
sensor and an Arduino Due with the big 3.2” display we saw a few weeks ago.
Next, I am going to use this servo in a robot so stay tuned!
What kind of project do you plan to build that require servos?
Please post any project ideas in the comments section below.
Before I go, I would like to show you a small footage from Mount Taygetus here is
Greece and I would like to wish you all a Happy New Year!
May the new year that follows be the best you have ever had.
If this is your first time here, I would love to have you subscribed.
In this channel I post videos about DIY projects every Saturday.
I build projects with Arduino, Raspberry Pi, I build robots and simple electronic
circuits.
I love making things and helping people doing the same.
I hope that you will join our community.
Until next Saturday, Watch, Learn, Build!
BLDC motor
Brushless DC Motor, How it works?
https://www.youtube.com/watch?v=bCEiOnuODac&t=5s
In order to make the operation more reliable, more efficient and less noisy, the
recent trend has been to use brushless dc motors.
They are also lighter compared to brushed motors with the same power output.
The brushes in conventional dc motors wear out over time and may cause
sparking.
Thus the brushed dc motor should never be used for operations that demand long
life and reliability.
let's see how a brushless DC motor works.
The rotor of a BLDC motor is a permanent magnet.
the stator has a coil arrangement as shown by applying DC power to the coil, the
coil energize and become an electromagnet.
The operation of a BLDC is based on the simple force interaction between the
permanent magnet and the electromagnet.
in this condition when the coil A is energized the opposite poles on the rotor and
stator are attracted to each other. As the rotor nears coil A coil B is energized.
As the rotor near coil B coil C is energized.
After that coil as energized with the opposite polarity.
This process is repeated and the rotor continues to rotate.
A humorous analogy to help remember it is to think about BLDC operation like the
story of the donkey and the Carrot. where the donkey tries hard to reach the
carrot but the Carrot keeps moving out of reach.
Even though this motor works it has one drawback you can notice that at any
instant.
Only one coil is energized. The two dead coils greatly reduce the power output of
the motor.
Here is the trick to overcome this problem. When the rotor is in this position
along with the first coil which pulls the rotor, you can energize the coil behind it,
in such a way that it will push the rotor. For this instant a same polarity current is
passed through the second coil, the combined effect produces more torque and
power output from the motor.
The combined force also makes sure that a BLDC has a beautiful constant torque
nature with this configuration two coils need to be energized separately.
But by making a small modification to the stator coil, we can simplify this process
just connect one free end of the coils together.
When the power is applied between coils A and B, let's note the current flow
through the coil.
it's just like the separately energized state.
That's how a BLDC works but you might have some intriguing doubts in your
mind.
How do I know which stator coils to energize? How do I know when energizer? So
that I will get a continuous rotation from the rotor.
in a BLDC we use an electronic controller for this purpose. A sensor determines
the position of the rotor and based on this information the controller decides
which coils to energize.
Most often a Hall effect sensor is used for this purpose.
The BLDC design we have discussed so far is known as the outrunner type.
Inrunner BLDC design is also available in the market.
We hope you had a nice introduction on the working of BLDC motors.
Thank you.
Stepper motor
Stepper Motor - How It Works
https://www.youtube.com/watch?v=TWMai3oirnM
Stepper Motor is a brushless motor that rotates in steps. This is very useful
because it can be precisely position without any feedback sensor which
represents an open loop controller. The stepper motor consists of a rotor there is
generally a permanent magnet and it is surrounded by the windings of the stator.
As we activate the widings step by step in a particular order and let current flow
through them, they will magnetize the stator and make electromagnetic poles
respectively.
That will cause propulsion to the motor. So that's the basic working principle of a
stepper motor.
There are several different ways of driving the stepper motor.
The first one is the wave drive or single coil excication. In this mode, we activate
just one coil at a time which means that for this example of motor with 4 coils,
the rotor will make full cycle in 4 steps.
Next is the full step drive mode which provides much higher torque output
because we always have 2 active coils at a given time.
However, this doesn't approve the resolution of the stepper and again the rotor
will make a full cycle in 4 steps.
For increasing the resolution of the stepper, we use the half step drive mode. This
mode is actually a combination of the previous two modes.
Here we have one active coil followed by two active coils and then again one
active coil followed by two active and so on.
So, with this mode we get double the resolution with the same construction. Now
the rotor will make full cycle in 8 steps.
However, the most common method of controlling stepper motors nowadays is
the Microstepping. In this mode we provide variable controlled current to the
coils in a form of sine wave. This will provide smooth motion of the rotor decrease
the stress of the parts and increase the accuracy of the stepper motor.
Another way of increasing the resolution of the stepper motor is by increasing the
numbers of the poles of the rotor or the members of the poles of the stator.
By construction there are three different types of stepper motors: permanent
magnet stepper, variable reluctance and hybrid synchronous stepper motor.
The permanent magnet stepper has a permanent magnet rotor which is driven by
the stators winnings. They create opposite polarity poles compared to the poles
of the rotor which propels the rotor.
The next type, the variable reluctance stepper motor uses a non-magnetize soft
iron rotor. The rotor has teeth that are offset from the stator and as we activate
the windings in particular order the rotor moves respectively so that it has
minimum gap between the stator and the teeth of rotor.
The Hybrid Synchronous motor is a combination of the previous steppers.
It has permanent magnet toothed rotor and also a toothed stator. The rotor has
two sections which are opposite in polarity and their teeth are offset as shown
here. This is the front you commonly used hybrid stepper motor which has 8
poles on the stator that are activated by two windings A and B. So, if we activate
the winding A, we will magnetize 4 poles which two of them will have South
polarity and two of them North polarity. We can see that in such a way to rotors
teeth are aligned with the teeth of the poles A and unaligned with the teeth of
the poles B. This means that in the next step when we will turn off the A poles and
activated the B poles, the rotor will move counterclockwise, and its teeth will
align with the teeth of the B poles. If we keep activating the poles in a particular
order the rotor will move continuously.
Here we can also use different driving modes like the wave drive, full step drive,
half step drive and microstepping for even further increasing of the resolution of
the stepper.
Thanks for watching and for more visit my official website
HowToMechatronics.com.

You might also like