| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| en:iot-open:hardware2:actuators_motors [2023/10/03 10:54] – pczekalski | en:iot-open:hardware2:actuators_motors [2023/11/23 11:26] (current) – pczekalski |
|---|
| ==== Actuators ==== | ====== Actuators ====== |
| | {{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ |
| Actuators are devices that can do a physical action to the surrounding world. Most actuators are based on one of the forms of electric motors, sometimes directly, sometimes using a gearbox and advanced control logic.\\ | Actuators are devices that can do a physical action to the surrounding world. Most actuators are based on one of the forms of electric motors, sometimes directly, sometimes using a gearbox and advanced control logic.\\ |
| An electric motor is an electromechanical device which can turn electrical energy into mechanical energy. The motor turns because the electricity that flows in its winding generates a magnetic field that inducts the mechanical force between the winding and the magnet. Electric motors are made in many variants, of which the simplest is the permanent-magnet DC motor. | An electric motor is an electromechanical device which can turn electrical energy into mechanical energy. The motor turns because the electricity in its winding generates a magnetic field that inducts the mechanical force between the winding and the magnet. Electric motors are made in many variants, of which the simplest is the permanent-magnet DC motor. |
| |
| === DC Motor (One Direction) === | == DC Motor (One Direction) == |
| DC motor is a device which converts direct current into mechanical rotation. DC motor consists of permanent magnets in the stator and coils in the rotor. Applying the current to coils creates an electromagnetic field, and the rotor tries to align itself to the magnetic field. Each coil is connected to a commutator, which in turn supplies coils with current, thus ensuring continuous rotation. Some motors have a tachometer functionality as the loopback signal that generates a pulse train of frequency proportional to the rotation speed. Tacho signal can be connected to a digital or interrupt input of a microcontroller, allowing for determining actual rotation speed. DC motors are widely used in power tools, toys, electric cars, robots, etc. (figure {{ref>dcmotor1}}). The connection schematic for a small DC motor is present in figure {{ref>dcmotor2}}. | DC motor is a device which converts direct current into mechanical rotation. DC motor consists of permanent magnets in the stator and coils in the rotor. Applying the current to coils creates an electromagnetic field, and the rotor tries to align itself to the magnetic field. Each coil is connected to a commutator, which supplies coils with current, thus ensuring continuous rotation. Some motors have a tachometer functionality as the loopback signal that generates a pulse train of frequency proportional to the rotation speed. Tacho signal can be connected to a digital or interrupt input of a microcontroller, allowing for determining actual rotation speed. DC motors are widely used in power tools, toys, electric cars, robots, etc. (figure {{ref>dcmotor1}}). The connection schematic for a small DC motor is present in figure {{ref>dcmotor2}}. |
| |
| <figure dcmotor1> | <figure dcmotor1> |
| |
| |
| === DC Motor With H-Bridge === | == DC Motor With H-Bridge == |
| |
| The H-bridge has earned its name because of its resemblance to the capital ‘H’ wherein all the corners are switches, and the electric motor is in the middle. This bridge is usually used for operating permanent-magnet DC motors, electromagnets and other similar elements because it allows operating with significantly bigger current devices using a small, driving current. | The H-bridge has earned its name because it resembles the capital 'H' wherein all the corners are switches, and the electric motor is in the middle. This bridge is usually used for operating permanent-magnet DC motors, electromagnets and other similar elements because it allows working with significantly bigger current devices using a small, driving current. |
| By switching the switches, it is possible to change the motor direction. It is important to remember that the switches must be turned on and off in pairs (figure {{ref>hbridge1}}). | By switching the switches, it is possible to change the motor direction. It is important to remember that the switches must be turned on and off in pairs (figure {{ref>hbridge1}}). |
| |
| </figure> | </figure> |
| |
| When all of the switches are turned off, the motor is in free movement. It is not always acceptable, so two solutions can be implemented. If both positive or negative switches are turned on at the top or at the bottom, then the motor coil is shorted, not allowing it to have a free rotation – it is slowed down faster. The fastest option to stop the motor is to turn the H-bridge in the opposite direction for some period of time. **Remember!** Neither of these braking mechanisms is good for the H-bridge or the power source because of excessive current appearance. That is why this action is unacceptable without a particular reason because it can damage the switches or the power source. The motor management can be reflected in the table {{ref>hbridgetable}}. | When all switches are turned off, the motor is in free movement. It is not always acceptable, so two solutions can be implemented. If both positive or negative switches are turned on at the top or the bottom, then the motor coil is shorted, not allowing it to have a free rotation – it is slowed down faster. The fastest option to stop the motor is to turn the H-bridge in the opposite direction for a while. |
| | |
| | <note warning>Neither of these braking mechanisms is good for the H-bridge or the power source because of excessive current appearance. This action is unacceptable without a particular reason because it can damage the switches or the power source.</note> |
| | |
| | The motor management can be reflected in the table {{ref>hbridgetable}}. |
| |
| <table hbridgetable> | <table hbridgetable> |
| </table> | </table> |
| |
| The complicated part is implementing and controlling the aforementioned switches, usually as relays or appropriate power transistors. The biggest drawback of relays is that they can only turn the engine on or off. Transistors must be used if the rotation speed needs to be regulated using the pulse width modulation. The MOSFET-type transistors should be used to ensure a large amount of power.\\ | The complicated part is implementing and controlling the switches mentioned above, usually as relays or appropriate power transistors. The biggest drawback of relays is that they can only turn the engine on or off. Transistors must be used if the rotation speed needs to be regulated using the pulse width modulation. The MOSFET-type transistors should be used to ensure a large amount of power.\\ |
| Nowadays, the stable operation of the bridge is ensured by adding extra elements. All elements can be encapsulated in a single integrated circuit, e.g. L293D (figure {{ref>L293D_1}}). | Nowadays, the stable operation of the bridge is ensured by adding extra elements. All elements can be encapsulated in a single integrated circuit, e.g. L293D (figure {{ref>L293D_1}}). |
| |
| </figure> | </figure> |
| |
| === Stepper Motor === | == Stepper Motor == |
| A certain angle or step can move stepper motors. The full rotation of the motor is divided into small, equal steps. Stepper motor has many individually controlled electromagnets; turning them on or off makes a motor shaft rotate by one step. Changing the switching speed or order can precisely control the rotation's angle, direction or speed. Because of their exact control ability, they are used in CNC machines, 3D printers, scanners, hard drives, etc.\\ A popular stepper motor is present in figure {{ref>steppermotor1}} and its controlling circuit in figure {{ref>steppermotor2}}.\\ | A certain angle or step can move stepper motors. The full rotation of the motor is divided into small, equal steps. Stepper motor has many individually controlled electromagnets; turning them on or off makes a motor shaft rotate by one step. Changing the switching speed or order can precisely control the rotation's angle, direction or speed. Because of their exact control ability, they are used in CNC machines, 3D printers, scanners, hard drives, etc.\\ A popular stepper motor is present in figure {{ref>steppermotor1}} and its controlling circuit in figure {{ref>steppermotor2}}.\\ |
| An example of use can be found in the source ((https://learn.adafruit.com/adafruit-arduino-lesson-16-stepper-motors/breadboard-layout)). | An example of use can be found in the source ((https://learn.adafruit.com/adafruit-arduino-lesson-16-stepper-motors/breadboard-layout)). |
| </figure> | </figure> |
| |
| <figure steppermotor1> | <figure steppermotor2> |
| {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_stepper.png?200 | Arduino Uno and stepper motor schematics}} | {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_stepper.png?200 | Arduino Uno and stepper motor schematics}} |
| <caption>Arduino Uno and stepper motor schematics</caption> | <caption>Arduino Uno and stepper motor schematics</caption> |
| </code> | </code> |
| |
| === Servomotor === | == Servomotor == |
| |
| The servomotor includes the internal closed-loop position feedback mechanism that precisely controls its position angle. To set the angle, the PWM technique is used. Additionally, it is possible to control the speed of angle change, acceleration and deceleration of the rotation.\\ | The servomotor includes the internal closed-loop position feedback mechanism that precisely controls its position angle. To set the angle, the PWM technique is used. Additionally, it is possible to control the speed of angle change, acceleration and deceleration of the rotation.\\ |
| |
| From the figure {{ref>servomotor}}, it can be seen that the length of the servomotor impulse cycle is 20 ms, but the impulse length itself is 1 ms or 2 ms. These signal characteristics are true for most enthusiast-level servomotors but should be verified for each module in the manufacturer specification, e.g. to obtain a full rotation of 180 degrees, it may be necessary to go beyond standard 1ms<->2ms duty cycle.\\ | From the figure {{ref>servomotor}}, it can be seen that the length of the servomotor impulse cycle is 20 ms, but the impulse length itself is 1 ms or 2 ms. These signal characteristics are true for most enthusiast-level servomotors but should be verified for each module in the manufacturer specification, e.g. to obtain a full rotation of 180 degrees, it may be necessary to go beyond standard 1ms<->2ms duty cycle.\\ |
| The servomotor management chain meets the impulse every 20 ms, but the pulse width shows the position that the servomotor has to reach. For example, 1 ms corresponds to the 0° position but 2 ms – to the 180° position against the starting point. When entering the defined position, the servomotor will keep it and resist any outer forces that are trying to change the current position. The graphical representation of the control signal and its impact on the position of the servomotor is presented in image {{ref>servomotor}}. | The servomotor management chain meets the impulse every 20 ms, but the pulse width shows the position the servomotor has to reach. For example, 1 ms corresponds to the 0° position but 2 ms – to the 180° position against the starting point. When entering the defined position, the servomotor will keep it and resist any outer forces trying to change the current position. The graphical representation of the control signal and its impact on the position of the servomotor is presented in image {{ref>servomotor}}. |
| |
| <figure servomotor> | <figure servomotor> |
| {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:servo1.png?560 | The pulse width modulated signal for different positions of servomotor}} | {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:servo1.png?580 | The pulse width modulated signal for different positions of servomotor}} |
| <caption>The pulse width modulated signal for different positions of servomotor</caption> | <caption>The pulse width modulated signal for different positions of servomotor</caption> |
| </figure> | </figure> |
| |
| Just like other motors, servomotors have different parameters, where the most important one is the time of performance – the time that is necessary to change the position to the defined position. The best enthusiast-level servomotors do a 60° turn in 0.09 s. There are three types of servomotors: | Just like other motors, servomotors have different parameters, where the most important one is the time of performance – the time necessary to change the position to the defined position. The best enthusiast-level servomotors do a 60° turn in 0.09 s. There are three types of servomotors: |
| * **positional rotation servomotor** – most widely used type of servomotor. With the help of a management signal, it can determine the position of the rotation angle from its starting position; | * **Positional rotation servomotor** – most widely used type of servomotor. With the help of a management signal, it can determine the position of the rotation angle from its starting position. |
| * **continuous rotation servomotor** – this type of motor allows setting the speed and direction of the rotation using the management signal. If the position is less than 90°, it turns in one direction, but if more than 90°, it turns in the opposite direction. The speed is determined by the difference in value from 90°; 0° or 180° will turn the motor at its maximum speed while 91° or 89° at its minimum rate; | * **Continuous rotation servomotor** – this type of motor allows setting the speed and direction of the rotation using the management signal. If the position is less than 90°, it turns in one direction, but if more than 90°, it turns in the opposite direction. The speed is determined by the difference in value from 90°; 0° or 180° will turn the motor at its maximum speed while 91° or 89° at its minimum rate. |
| * **linear servomotor** – with the help of additional transfers, it allows moving forward or backward; it doesn’t rotate. | * **Linear servomotor** – with the help of additional transfers, it allows moving forward or backwards; it doesn't rotate. |
| |
| Unfortunately, using Arduino, the servomotor is not as easily manageable as the DC motor. For this purpose, a special servomotor management library ''Servo.h'' has been created. Using PWM signal in other MCUs may involve the use of hardware or software timers and may impact other features as the number of hardware timers used to be limited. Thus ''Servo.h'' implementation may vary between microcontrollers and SDKs. | Unfortunately, using Arduino, the servomotor is not as easily manageable as the DC motor. For this purpose, a special servomotor management library, "Servo.h" has been created. Using PWM signal in other MCUs may involve the use of hardware or software timers and may impact other features as the number of hardware timers used to be limited. Thus, "Servo.h" implementation may vary between microcontrollers and SDKs. |
| |
| Sample standard servo is present in figure {{ref>stdservo1}} and connection in figure {ref>stdservo2}}. | Sample standard servo is present in figure {{ref>stdservo1}} and connection in figure {{ref>stdservo2}}. |
| |
| <figure stdservo1> | <figure stdservo1> |