DC Motor Control

This week I worked on controlling a DC motor using the pulse width modulation (PWM) in the dsPIC30F4011 to adjust the speed of the motor. The code I started with would drive the motor at 75% duty cycle for two seconds then 25% for two seconds and repeat, this code can be found here. The DC motor pulls a lot more current than the PIC can supply so I needed to use a driver chip (SN754410NE), This chip would amplify the current enough to drive the motor. On this chip we can apply the PWM to the enable pin on either side giving us the ability to switch the chip on and off very quickly and this turns on and off the motors, this switching will then change the speed. If the enable pins were left alone the motor would just run at full speed. Continue reading