Library version for DC_Stepper_Controller_Lib with PWM speed control

Dependencies:   mbed QEI PID

Dependents:   DR-ArmServoTest Auto_DC_pick_class MBed_TR1 ros_button_2021

README.txt

Committer:
howanglam3
Date:
2021-08-16
Revision:
20:a0d027b80d2c
Parent:
13:675456f1f401

File content as of revision 20:a0d027b80d2c:

/*******************************************************
              DC MODOR CONTROLLER LIBRARY
********************************************************/

            ON/OFF and PID CONTROL SUPPORTED

1. Enable/Disable DEBUG_MODE in DC_Motor_Controller.cpp
   Debug mode will affect the performance!
   If compliation issue occurs, DELETE this file. 
   
2. Declare a motor by classes to use on/off control or PID control.
    DC_Motor_On_Off motor(D6,D3,D4,D5,792);         // non-PID
    DC_Motor_PID motor(D6,D3,D4,D5,792);            // PID
   Parameters: PinName out_M1, PinName out_M2, PinName in_A, PinName in_B, int PPR
   Do NOT use DC_Motor_Controller class! It's only a base class.

3. If using the PID controller, set PID parameters.
    motor.set_pid(0.008, 0, 0);
    
4. Motor control methods supported:
   (speed from 0.0 to 1.0, which will not work in PID controller)  
    void goto_angle(int angle, float speed = 1);    // go to absolute angle
    void move_angle(int angle, float speed = 1);    // move for relative angle
    void reset();                                   // reset the motor
    void set_out(float a, float b);                 // manually set the speed of output
    int get_pulse();                                // get the current pulse