Library version for DC_Stepper_Controller_Lib with PWM speed control
Dependents: DR-ArmServoTest Auto_DC_pick_class MBed_TR1 ros_button_2021
Diff: README.txt
- Revision:
- 13:675456f1f401
diff -r 3949fd23be49 -r 675456f1f401 README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Thu May 27 05:43:48 2021 +0000 @@ -0,0 +1,27 @@ +/******************************************************* + 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 + \ No newline at end of file