Introduction
This motor driver module is a special PPM signal motor controller for aeromodelling remote control. It is designed by DFRobot and it can be controlled by RC transmitter. The driver can convert PPM signal to the motor speed and direction control signal. There are two signal receiving channels (CH1, CH2) and two motor channels (M1, M2) on the board. Each signal input channel uses a standard 50-Hz PPM signal with a duty cycle of 5% to 10%. When the rocker returns to the middle, the motor stops rotating, waggling the rocker up and down (or left and right), and the motor rotates forward or backward. The motor driver supports 7 ~ 12V wide range power input, the maximum input voltage is 40V, and the continuous current of each channel is 3A, the allowable peak current is 6A. When the current is over 6A, the driver chip will be into a protected state (in the protection state, it requires repower to start again). The module has LDO power management system, which can provide an output current of 5V/200mA externally. Therefore, the remote control receiver of the model can be directly connected to the driver board without additional power supply to the receiver.
Features
- 2-way independent motor drive
- Controlled by PPM signal, compatible with servo control signal
- Designed for aeromodelling and fighting robots
- Support professional aircraft model remote control
- 7~12V wide input range
- With overload protection
Specification
- Input Voltage: 7~12V
- Logic Power: 5V (compatible with 3.3V controller)
- Master Chip: STM8S105
- Driver Chip: TLE5205
- Drive Signal:
- 1000~1469us Forward decrement
- 1470~1560us stop domain
- 1561~2000us reverse increase
- 3A current continuous drive capability
- 6A peak current protection
- Supports independent two-channel motor drive
- Dimension: 90mm×30mm
- Weight: 35 g
Board Overview
Note:The pad on the bottom is the battery power port.
Label | Name | Description |
---|---|---|
DC: 7~12V "+" | VCC | 7~12VDC |
DC: 7~12V "-" | GND | GND |
M1 | DC motor port 1 | DC motor |
M2 | DC motor port 2 | DC motor |
CH1 | PPM Signal 1 | 50Hz,PPM Signal |
CH2 | PPM Signal 2 | 50Hz,PPM Signal |
Tutorial
Control Signal
PPM Motor Driver Module supports 2-way independent DC motor drive, driving signal from CH1 and CH2 input, respectively corresponding to M1 and M2 motor drive output. CH1, CH2 can be directly connected to the receiver of aeromodelling remote control (such as FS-IA6B transmitter). It can be also controlled by Arduino Servo code.
Note: PPM Motor Driver Module has 5V power output, it doesn't need to connect power, when you connect to the receiver.
The control signal adopted by the PPM Motor Driver Board is the PPM output signal of the Airmodel Remote Control Standard, which can be directly connected to the Airmodel Remote Control Receiver. The signal is a PWM signal with a frequency of ''' 50Hz ''', sliding remote controller rocker, the high level duration of the signal is controlled by 1000us ~ 2000us.
- When the high level duration of the control signal increases from 1000us to 1469us, the motor turns forward and the speed decreases gradually.
- When the high level duration of the control signal increases from 1561us to 2000us, the motor reverses and the speed increases gradually.
- When the high level duration of the control signal is between 1470us and 1560us (i.e. the joystick returns to the center-point), the motor stops rotating and the motor drive port outputs a low level. (An intermediate stop field has been added due to possible mechanical errors in the remote control.)
Note: PPM Motor Driver Module doesn't have brake function.
Drive Signal
Drive signal refers to the signal used to drive the motor to rotate after the control singal received by the PPM Motor Drvier board is proccessed by the STM8S105 chip. They are two PWM signals with frequency 1000Hz for controlling motor speed and direction respectively.
Requirements
Hardware
- DFRduino UNO R3 (or similar) x 1
- USB Cable
- PPM Motor Driver Modules
- M-M/F-M/F-F Jumper wires
Software
Sample Code
/*PPM output signal is a 50Hz PWM signal, so every control signal should be guaranteed to be 20ms
* The sum of delayMicroseconds in each control signal should be 20ms
* The High level duration of every control signal determines the motor's speed, direction(forward, backward), and stop.
* 1500us high level duration: stop rotating
* Increment in high level duration from 1500us to 2000us: move backward and speed up
* Decrement in high level duration from 1500us to 1000us: move forward and speed up
* delayMicroseconds():since 20ms will overflow, the value inside should perferably not exceed 16000. Delay it twice to achieve 20ms PWM cycle.
*/
uint8_t motor1_pin=3; /*Set control pin for motor 1 */
uint8_t motor2_pin=5; /*Set control pin for motor 2*/
int num = 50;
void motor_rotation(uint8_t pin,int t) /*Motor rotate*/
{
digitalWrite(pin,HIGH);
delayMicroseconds(t);
digitalWrite(pin,LOW);
delayMicroseconds(10000);
delayMicroseconds(10000-t);
}
void all_motor_rotation(uint8_t pin0, uint8_t pin1, int t) /*Two motor rotate at the same speed and direction */
{
digitalWrite(pin0,HIGH);
digitalWrite(pin1,HIGH);
delayMicroseconds(t);
digitalWrite(pin0,LOW);
digitalWrite(pin1,LOW);
delayMicroseconds(10000);
delayMicroseconds(10000-t);
}
void motor_forward_acc(uint8_t pin) { /*Motor speeds up in forward movement*/
for(int i = 0; i<10; i++) {
for(int j = 0; j<num; j++) {
motor_rotation( pin, 1500-i*50); /*Decrement in high level duration from 1500us to 1000us: move forward and speed up*/
}
}
}
void motor_reversal_acc(uint8_t pin) { /*Motor speeds up in backward movement*/
for(int i = 0; i<10; i++) {
for(int j = 0; j<num; j++) {
motor_rotation( pin, 1500+i*50); /*Increment in high level duration from 1500us to 2000us: move backward and speed up*/
}
}
}
void setup()
{
pinMode(motor1_pin,OUTPUT);
pinMode(motor2_pin,OUTPUT);
}
void loop()
{
//motor_forward_acc(motor1_pin); /*Motor 1 speeds up in forward movement*/
//motor_forward_acc(motor2_pin); /*Motor 2 speeds up in forward movement*/
//motor_reversal_acc(motor1_pin); /*Motor 1 speeds up in backward movement*/
//motor_reversal_acc(motor2_pin); /*Motor 2 speeds up in backward movement*/
for(int i =0; i<num; i++) { /*Motor 1 rotates backward*/
motor_rotation( motor1_pin, 1800); /*High level duration is 1800us, which is in 1500us-2000us, motor 1 rotates backward */
}
for(int i =0; i<num; i++) { /*Motor 1 stops rotating*/
motor_rotation(motor1_pin, 1500); /*High level duration equals to 1500us, motor 1 stops rotating*/
}
for(int i =0; i<num; i++) { /*Motor 1 rotates forward*/
motor_rotation( motor1_pin, 1200); /*High level duration is 1200us, which is in 1500us-1000us, motor 1 rotates forward*/
}
for(int i =0; i<num; i++) { /*Motor 1 stops rotating */
motor_rotation( motor1_pin, 1500); /*High level duration equals to 1500us, motor 1 stops rotating*/
}
for(int i =0; i<num; i++) { /*Motor 2 rotates backward*/
motor_rotation( motor2_pin, 1800); /*High level duration is 1800us, which is in 1500us-2000us, motor 2 rotates backward*/
}
for(int i =0; i<num; i++) { /*Motor 2 stops rotating*/
motor_rotation( motor2_pin, 1500); /*High level duration equals to 1500us, motor 2 stops rotating*/
}
for(int i =0; i<num; i++) { /*Motor 2 rotates forward*/
motor_rotation( motor2_pin, 1200); /*High level duration is 1200us, which is in 1500us-1000us, motor 2 rotates forward*/
}
for(int i =0; i<num; i++) { /*Motor 2 stops rotating*/
motor_rotation( motor2_pin, 1500); /*High level duration equals to 1500us, motor 2 stops rotating*/
}
for(int i =0; i<num; i++) { /*Motor 1 and 2 rotate backward*/
all_motor_rotation(motor1_pin, motor2_pin, 1800);/*High level duration is 1800us, which is in 1500us-2000us, motor 1 and 2 rotate backward*/
}
for(int i =0; i<num; i++) { /*Motor 1 and 2 stop rotating*/
all_motor_rotation(motor1_pin, motor2_pin, 1500);/*High level duration equals to 1500us, motor 1 and 2 stop rotating*/
}
for(int i =0; i<num; i++) { /*Motor 1 and 2 rotate forward*/
all_motor_rotation(motor1_pin, motor2_pin, 1200);/*High level duration is 1200us, which is in 1500us-1000us, motor 1 and 2 rotate forward*/
}
for(int i =0; i<num; i++) { /*Motor 1 and 2 stop rotating*/
all_motor_rotation(motor1_pin, motor2_pin, 1500);/*High level duration equals to 1500us, motor 1 and 2 stop rotating*/
}
}
FAQ
Q&A | Some general Arduino Problems/FAQ/Tips |
---|---|
A | For any questions, advice or cool ideas to share, please visit the DFRobot Forum. |