Motor driver: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Wheel motors)
(Protector PCB)
 
(189 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 
= Abstract =
 
= Abstract =
Ardumower uses two different motors:
+
Ardumower uses two different types of motors (all motors can be purchased via the [https://www.marotronics.de/index.php?k=7 shop] [[File: shopping.png|link=https://www.marotronics.de/index.php?k=7]]):
* Two motors (with integrated gearing) for driving (wheel motors)
+
* Two motors (with integrated gearing) for driving (wheel motors) and with integrated encoders (for distance and speed control)
 
* One motor (with high rotation speed) for mowing (mower motor)
 
* One motor (with high rotation speed) for mowing (mower motor)
  
To control a motor, it requires a 'motor driver'.
+
To control the motors, it requires motor drivers. In addition, the motor driver measures the motor current, and allows us to detect obstacles as motor current increases at obstacles. Ardumower uses two dual MC33926 motor drivers, so two channels for left and right motor and two dual channels (connected in parallel) for the mowing motor.
  
= Voltages =
+
It is not safe to connect motors directly to the motor driver. Especially, when quickly turning motors from forward to reverse (or vice verse), high voltage spikes appear, and these could damage the motor drivers in the long run. Therefore, we developed driver protector boards that are connected between motor driver and motor.
There exist 12V motors and 24V motors. As in all modern systems, the Ardumower uses 24V motors. The reason is as follows:
+
  
Assuming that the motor consumes 50W, using 24V results to a motor current: 50W / 24V = 2A.
+
[[File:Ardumower_motordriver_overview.png|800px]]
  
Assuming that the motor consumes 50W, using 12V results to a motor current: 50W / 12V = 4A.
+
= Voltages =
 
+
As in all modern systems, Ardumower uses 24V motors.
The higher the current (A), the more problems arise:
+
 
+
* The motor driver must be suitable for higher current (more expensive)
+
* The PCB traces need to be more thick (more expensive)
+
* The rechargable battery need to support higher current (more expensive)
+
  
So, that's the reason why Ardumower is designed as a 24V system.
+
= Motor driver assembly (dual MC33926) =
 +
Motor driver features: up to 3A with integrated current sensor and thermal shut-down protection
  
= Wheel motors =
 
 
<gallery>
 
<gallery>
File: ardumower_motor.jpg
+
File: Ardumower_motordriver_overview.png | PCB, MC33926, protector and motors
 +
File: Pcb_mc33926.jpg | PCB and MC33926
 +
File:Mc33926.jpg | MC33926 pinout
 +
File:MC33926_schematics.jpg | MC33926 schematics
 
</gallery>
 
</gallery>
The two left and right gear motors are controlled independantly to:
 
  
* drive forward/backward
+
* [https://www.youtube.com/watch?feature=player_embedded&v=DokrJiVzX2I Video instructions: Dual MC33926]
* steer left/right
+
  
The motor features:
+
For wiring of motor drivers, protector and motors, please open manual in section Protector PCB.
* A rotation speed up to 33 rpm allows to move the robot at sufficient speed
+
* A high torque (3Nm) guarantees that the robot can climb small hills as well
+
* Integrated encoders, so it can measure the rotation speed. This allows Ardumower to correct the driving angle
+
  
= Motor driver =
+
=Protector PCB=
A motor driver is a circuit that allows current to flow either one direction or the opposite direction through the motor - depending on wether the motor should turn forward or backward (so called 'H-bridge'). There are many motor drivers available as ready-circuit boards, some can even control two motors (Dual H-Bridge) - if you connect two of their H-bridges in parallel, the maximum motor current can be increased.
+
[[File:warning.png]] When quickly tunring motors from forward to backward (or vice versa), high voltage spikes appear. These high voltage spikes could damage the motor driver in the long run. To eliminate high voltage spikes, it is adviced to use a  [https://github.com/Ardumower/ardumower/blob/master/Dokumentation/Protector%20Board/WORKSHOP%20Protector-Board.pdf Protector board] between motor driver and motor. Two Protector PCBs are required, one for the gear motors, and one for the mowing motor.
  
If the direction of the motor does not need to be controlled, (e.g. for the blades), you do not need an H-bridge, but instead a simple 'switch' (e.g. MOSFET-transistor-circuit).
+
<gallery>
 +
File: Ardumower_motordriver_overview.png | PCB, MC33926, protector and motors
 +
File:Protector_pcb2.jpg | Protector PCB
 +
File:Protector_wiring.png | Protector PCB wiring
 +
File:driver_hw_protection.png | Protector PCB schematics
 +
</gallery>
  
The motor driver is connected through control signals to the Arduino. Example:
+
* [https://github.com/Ardumower/ardumower/blob/master/Dokumentation/Protector%20Board/WORKSHOP%20Protector-Board.pdf Assembly manual: Protector board (required for safe-use of motor drivers!)]
 
+
  Arduino Digital Pin  —>  MOTOR-Direction Pin (DIR)
+
  Arduino PWM Pin      —>  MOTOR-Speed Pin (PWM)
+
  Arduino Analog Pin  <—  MOTOR-Current Sensor Pin
+
 
+
 
+
One pin controls the direction (forward/backward), the other pin controls the speed. One analog input pin is connected to the current sensor. The current sensor module (ACS712-05A) is connected in series with the motor.
+
  
 +
= Wheel motors wiring =
 
<gallery>
 
<gallery>
File:Ardumower_motor_driver_circuit.png
+
  File: Ardumower_motordriver_overview.png | PCB, MC33926, protector and motors
 +
  File: ardumower_motor.jpg | Ardumower gear motor with encoder (8mm diameter, 5900 rpm motor, 0.055 Nm, gear ratio 1/212, output torque 2.45Nm, output rpm 31)
 +
  File: magnetic_encoder.PNG | Motor wiring
 +
  File: wheel_motor_diagram.png | Ardumower gear motor curve (motor only)
 +
  File: Ardumower_gearbox.png | Gearbox specification
 
</gallery>
 
</gallery>
 +
The two left and right gear motors are controlled independently (aka 'differential driving') to:
  
== Popular modules ==
+
* drive the robot forward/backward
=== MC33926 ===
+
* steer the robot left/right
  
Features: up to 3A with integrated current sensor and thermal shut-down protection, for all kind of robot mowers)  
+
Wheel motor features:
 +
* A rotation speed up to 31 rpm allows to move the robot at sufficient speed (at up to meter/sec = 31rpm/60 * PI * 0.25m  = 0.4m/sec using 250mm diameter wheels)
 +
* A high torque (2.45Nm) guarantees that the robot can climb small hills as well (with 2 motors, 0.125 radius wheel, 31rpm = 0.4m/s, acceleration = 0.2 ( 1/2 of nominal speed) [http://www.robotshop.com/blog/en/drive-motor-sizing-tool-9698 see calculator]
 +
* Integrated encoders, so it can measure the rotation speed and the distance
 +
* 24V  (load current ~1A)
  
<gallery>
+
The left gear motor is connected as follows to the protector board:
File:Mc33926.jpg
+
File:Mc33926_example.jpg
+
File:MC33926_schematics.jpg
+
</gallery>
+
'''For the 0.9.3 Version
+
  
'''
+
Motor wiring (left motor):
M1_FB    --- Motor1 current sensor output (Arduino)
+
  Motor (black==== Protector board Motor_1_OUT(1)
  M1_PWM_D1 --- connect with jumper to GND
+
  Motor (red)    ==== Protector board Motor_1_OUT(2)
M1_PWM_D2 --- connect with jumper to VDD
+
M1_IN1    --- Motor1 PWM (Arduino)
+
  M1_IN2    --- Motor1 Dir (Arduino)
+
  EN        --- connect with jumper to VDD
+
M2_FB    --- Motor2 current sensor output (Arduino)
+
M2_PWM_D1 --- connect with jumper to GND
+
M2_PWM_D2 --- connect with jumper to VDD
+
M2_IN1   --- Motor2 PWM (Arduino)
+
M2_IN2    --- Motor2 Dir (Arduino)
+
EN        --- connect with jumper to VDD
+
VDD      --- Arduino 5V
+
  
'''For the SVN Version
+
For right motor, use Protector board Motor_2_OUT(1,2) accordingly.
'''
+
M1_FB    --- pinMotorLeftSense A1
+
M1_SF    --- pinMotorLeftFault 25
+
M1_PWM_D1 --- connect with jumper to GND
+
M1_PWM_D2 --- connect with jumper to VDD
+
M1_IN1    --- pinMotorLeftPWM 5 
+
M1_IN2    --- pinMotorLeftDir 31
+
EN        --- pinMotorEnable  37
+
M2_FB    --- pinMotorRightSense A0
+
M2_SF    --- pinMotorRightFault 27
+
M2_PWM_D1 --- connect with jumper to GND
+
M2_PWM_D2 --- connect with jumper to VDD
+
M2_IN1    --- pinMotorRightPWM  3
+
M2_IN2    --- pinMotorRightDir 33
+
EN        --- pinMotorEnable  37
+
VDD      --- Arduino 5V
+
  
=== L298N ===
+
= Wheel motors odometry wiring =
Features: up to 4A (for Tianchen TC-G158, Ambrogio L50, etc.)
+
Notice: When using a L298N-motor driver, both H-bridges (2A) should be connected in parallel, so that both bridges drive a single motor (max. 4A):
+
  
Connect in parallel:
+
The Ardumower gear motors have integrated encoders. These encoders help us to compute speed and traveled distance. Here's how you connect the motor odometry wires to the PCB.
IN1 with IN4
+
IN2 with IN3
+
OUT1 with OUT4
+
OUT2 with OUT3
+
(Do NOT disconnect the SENSE-lines, except when you want to measure current by a 'shunt' resistor).
+
 
+
Make sure there is a jumper on both ENA and ENB. Also, make sure there is a jumper on S1.
+
  
 
<gallery>
 
<gallery>
File: Motordriver_l298n.JPG
+
  File: magnetic_encoder.PNG | Motor wiring
File: L298driver.jpg
+
  File: ardumower_odometry_encoder.jpg | Encoder signal
File: L298N_schematics.jpg
+
 
</gallery>
 
</gallery>
  
=== L9958 ===
+
Motor odometry wiring (left motor):
Features: Arduino 240W H-bridge Motor Driver Board - SX8847, up to 8A (for Rotenbach SPM08-320 etc.).
+
Motor (brown)  ---- PCB VCC
 +
Motor (green)  ---- PCB GND
 +
Motor (blue)  ---- PCB OdometryLeft (3)
 +
Motor (purple) ---- PCB OdometryLeft (4)
  
Note that this module has an on-board [http://en.wikipedia.org/wiki/78xx linear voltage regulator], which converts the input POWER (typically 24 or 12V) to 5V. Some modules do this with a single voltage regulator (chip VR1 on the module), or in a two-staged approach (VR1 and U2).  
+
For right motor, use PCB OdometryRight accordingly.
  
Converting 24V to 5V with a linear voltage regulator is very inefficient (current in = current out, so if you need 100mA at 5V, the linear voltage regulator requires 100mA at 24V, so you loose 1.9W in this module). Therefore, it is recommended to disconnect the linear voltage regulator from the board, and use the 5V from the switched mode power supply.
+
IMPORTANT: PCB v0.5/1.2 are missing pull-up resistors! You need to add them yourself at the PCB:
  
  L9958 GND---GND
+
  PCB OdometryLeft(3) --- 4.7k --- 5v
L9958 VCC---Arduino 5V
+
  PCB OdometryLeft(4) --- 4.7k --- 5v
L9958 EN---Arduino 5V
+
L9958 DI---GND
+
L9958 DIR---Arduino MOTOR_DIR
+
L9958 PWM---Arduino MOTOR_PWM
+
L9958 MOTOR(+)---motor(+)
+
L9958 MOTOR(-)---motor(-)
+
  L9958 POWER(+)---battery(+)
+
L9958 POWER(-)---battery(-)
+
  
 +
= Mower motor wiring =
 
<gallery>
 
<gallery>
File: Motor_driver_L9958.jpg
+
File: Ardumower_motordriver_overview.png | PCB, MC33926, protector and motors
 +
File: ardumower_mower_motor.jpg | Ardumower mower motor
 +
File: Mower_motor_curve.png | Ardumower mower motor curve
 +
File: Mower2_start_current.png | Mower start current
 +
File: Mower4_blocked_500ms_detect_5s_wait.png | Mower blocked, 500ms detection (max), waittime: 5sec (min)
 
</gallery>
 
</gallery>
 
+
The Ardumower mower motor features:
= Mower motor =
+
The mower motor features:
+
 
* Fast enough to cut the lawn (3150 rpm)
 
* Fast enough to cut the lawn (3150 rpm)
* Enough torque (140 mNm)
+
* Enough torque (140 mNm / 46 W)
 
+
* Quiet mowing (you cannot hear it)
For a the mowing motor, a MOSFET circuit is used. The MOSFET transistor IRLIZ44N (alternatives: IRF1404, IRL540N, RFP30N06LE, FQP30N06L) can already switch a current of 30A at the Arduino 5V control signal (N-LogL). The 10K resistor pulls down to ground when the Arduino starts. The 180 Ohm resistor limits the current at the Gate caused by level switches to about 30mA. The diode (MBR1045) protects  the circuit against current caused by motor induction. A current sensor module (ACS712-30A) is connected in series with the motor.
+
* 24V, load current ~1.0A  (L=2.8mH, R=1.9ohm)
  
 
[[File:warning.png]]'''Security note: For security reasons, always remove mower blades in your first tests!'''
 
[[File:warning.png]]'''Security note: For security reasons, always remove mower blades in your first tests!'''
  
<gallery>
 
File: Ardumower_mower_motor_circuit.png
 
</gallery>
 
  
= Choosing a driver =
+
Here's how you connect the mowing motor to the protector board:
 +
Motor (black)  ==== Protector board Motor_1_OUT(1)
 +
Motor (red)    ==== Protector board Motor_1_OUT(2)
  
When purchasing a motor driver, consider...
+
= Motor decrease noise =
* max. thermal load (short-circuit current)
+
* price
+
  
= Short-circuit current =
+
Here's how you can decrease motor noise:
To not damage the motor driver on the first run, find out the maximum current that can flow through your motors. In other words, find out the 'short-circuit' current. Typical measurement installation:
+
  
Battery === Ampere meter === Motor
+
<gallery>
 +
  File:decrease_motor_noise.png | Decrease motor noise
 +
</gallery>
  
The Amperemeter (e.g. model making) should be able to measure the maximum current (e.g. 30A). The motor to be measured is mechanically blocked (so it cannot rotate).
+
* [https://github.com/Ardumower/ardumower/blob/master/Dokumentation/Motor%20Entstoerung/Motor%20EntstoerungREV20150531.pdf Instructions: Motor-decrease noise REV20150531]
 +
* [http://www.ardumower.de/media/kunena/attachments/1725/Motor-EntstoerungREV20150531.pdf (English comments)]
  
'''Warning'''
 
 
* always remove blades
 
* only connect battery for a short period (1-5 seconds)
 
* always use cables with sufficient wire cross section
 
 
Example measurement:
 
 
* Rotenbach SPM08-320
 
** Wheel motor: 8A
 
** Mowing motor:
 
 
* Ambrogio L50
 
** Wheel motor: 4,5A
 
** Mowing motor: 22A
 
 
* Tianchen TC-G158
 
** Wheel motor: 5,4A
 
** Mowing motor: 16A (both 32A)
 
 
The measured current will only flow in 'worst-case' scenarios, which means when the motor starts or when it is blocked and it will only flow for a short time  (as your battery might not deliver the high current constantly, and so current and voltage will break down).
 
 
 
= Current sensor =
 
To detect certain conditions (robot drives against obstacle, motor blocks etc.), the motor current should be monitored constantly. There are two approaches for sensing current.
 
 
== Approach "Hall sensor module" ==
 
This is the recommended approach for sensing current. These current sensor modules are available for different current ranges.
 
 
* ACS712ELC-05A (185mV/A, max. 5A)
 
* ACS712ELC-20A (100mV/A, max. 20A)
 
* ACS712ELC-30A (66mV/A, max. 30A)
 
* The lower the range, the more precise the measurement.
 
 
== Approach "Shunt resistor (circuit)" ==
 
The current flows across a very small resistor (0.5 Ohm) and the voltage drop is measured
 
  
 +
= Motor controller (PID) =
 +
The speed of the motors is controlled by a software PID controller. You can monitor the quality of the motor speed control via pfodApp (Plot->Motor control):
  
 
<gallery>
 
<gallery>
File: L298n_module_circuit.jpg
+
  File:Speedcontrol.png | Motor speed settings
 +
  File: Odometry_motor_pid_controller.png
 
</gallery>
 
</gallery>
 
=Further links=
 
#[http://www.ardumower.de/index.php/en/forum/maehwerk/74-10a-pwm-controller-modul-fuer-den-arduino 10A PWM controller module modification]
 

Aktuelle Version vom 22. Februar 2017, 09:45 Uhr

Abstract

Ardumower uses two different types of motors (all motors can be purchased via the shop Shopping.png):

  • Two motors (with integrated gearing) for driving (wheel motors) and with integrated encoders (for distance and speed control)
  • One motor (with high rotation speed) for mowing (mower motor)

To control the motors, it requires motor drivers. In addition, the motor driver measures the motor current, and allows us to detect obstacles as motor current increases at obstacles. Ardumower uses two dual MC33926 motor drivers, so two channels for left and right motor and two dual channels (connected in parallel) for the mowing motor.

It is not safe to connect motors directly to the motor driver. Especially, when quickly turning motors from forward to reverse (or vice verse), high voltage spikes appear, and these could damage the motor drivers in the long run. Therefore, we developed driver protector boards that are connected between motor driver and motor.

Ardumower motordriver overview.png

Voltages

As in all modern systems, Ardumower uses 24V motors.

Motor driver assembly (dual MC33926)

Motor driver features: up to 3A with integrated current sensor and thermal shut-down protection

For wiring of motor drivers, protector and motors, please open manual in section Protector PCB.

Protector PCB

Warning.png When quickly tunring motors from forward to backward (or vice versa), high voltage spikes appear. These high voltage spikes could damage the motor driver in the long run. To eliminate high voltage spikes, it is adviced to use a Protector board between motor driver and motor. Two Protector PCBs are required, one for the gear motors, and one for the mowing motor.

Wheel motors wiring

The two left and right gear motors are controlled independently (aka 'differential driving') to:

  • drive the robot forward/backward
  • steer the robot left/right

Wheel motor features:

  • A rotation speed up to 31 rpm allows to move the robot at sufficient speed (at up to meter/sec = 31rpm/60 * PI * 0.25m = 0.4m/sec using 250mm diameter wheels)
  • A high torque (2.45Nm) guarantees that the robot can climb small hills as well (with 2 motors, 0.125 radius wheel, 31rpm = 0.4m/s, acceleration = 0.2 ( 1/2 of nominal speed) see calculator
  • Integrated encoders, so it can measure the rotation speed and the distance
  • 24V (load current ~1A)

The left gear motor is connected as follows to the protector board:

Motor wiring (left motor):

Motor (black)  ==== Protector board Motor_1_OUT(1)
Motor (red)    ==== Protector board Motor_1_OUT(2)

For right motor, use Protector board Motor_2_OUT(1,2) accordingly.

Wheel motors odometry wiring

The Ardumower gear motors have integrated encoders. These encoders help us to compute speed and traveled distance. Here's how you connect the motor odometry wires to the PCB.

Motor odometry wiring (left motor):

Motor (brown)  ---- PCB VCC
Motor (green)  ---- PCB GND
Motor (blue)   ---- PCB OdometryLeft (3)
Motor (purple) ---- PCB OdometryLeft (4)

For right motor, use PCB OdometryRight accordingly.

IMPORTANT: PCB v0.5/1.2 are missing pull-up resistors! You need to add them yourself at the PCB:

PCB OdometryLeft(3) --- 4.7k --- 5v
PCB OdometryLeft(4) --- 4.7k --- 5v

Mower motor wiring

The Ardumower mower motor features:

  • Fast enough to cut the lawn (3150 rpm)
  • Enough torque (140 mNm / 46 W)
  • Quiet mowing (you cannot hear it)
  • 24V, load current ~1.0A (L=2.8mH, R=1.9ohm)

Warning.pngSecurity note: For security reasons, always remove mower blades in your first tests!


Here's how you connect the mowing motor to the protector board:

Motor (black)  ==== Protector board Motor_1_OUT(1)
Motor (red)    ==== Protector board Motor_1_OUT(2)

Motor decrease noise

Here's how you can decrease motor noise:


Motor controller (PID)

The speed of the motors is controlled by a software PID controller. You can monitor the quality of the motor speed control via pfodApp (Plot->Motor control):