DC motor closed-loop control software

DC motor closed-loop control software

youmagine

This program uses an Arduino for open-loop control of a DC-motor. Motor motion is detected by a single encoder sensor. Two inputs named SETPOINT and DIRECTION allow changing the target position. Serial port prints current position and target position every second. Serial input can be used to feed a new location for the servo (no line return). Pins used: Digital inputs 2 & 8 are connected to the single encoder signal. Digital input 3 is the SETPOINT input. Analog input 0 is the DIRECTION input. Digital outputs 5 & 6 control the PWM outputs for the motor (I am using half L298 here). Please note PID gains kp, ki, kd need to be tuned to each different setup. Motor's specs : https://www.mabuchi-motor.co.jp/en_US/cat_files/rs_385sh.pdf Update: I have just added a new version of the firmware that uses an additional interrupt on pin change will allow 4x encoder resolution. PWM output frequency has been raised outside of the audible range too (31Khz) but output pins have been changed, so check the comments in the code. Update2: I have uploaded the capture of an analyzer showing the signals from the encoder, the setpoint and direction pins and the PWM outputs of an ongoing print operation. The saleae software can be downloaded to browse through the capture (use latest beta). https://www.saleae.com/Downloads Update3: I have added a much more elaborate version of the controller code now with EEPROM support and serial port setting of PID values https://github.com/misan/dcservo/blob/master/dcservo.ino

Download Model from youmagine

With this file you will be able to print DC motor closed-loop control software with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on DC motor closed-loop control software.