PPM_2x3A_DC_Motor_Driver_SKU__DFR0513-DFRobot

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

Specification

Board Overview

Motor Driver Front

Motor Driver Back

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.

warning_yellow.png 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.

Control signal waveform diagram

warning_yellow.png 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.

Drive Signal

Requirements

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.

More Documents