DC Motor Speed Control System
A speed controller for a 48V DC motor, built by four of us for Circuit Theory & Design II at Lakehead. The job was to run it at 40 rpm and hold that while a magnetic brake loads it.
An ESP8266 sends a PWM signal and its inverse, at 500 Hz, to an H-bridge that drives the motor both ways. The duty cycle decides which way wins. An ST188 infrared sensor reads the speed, and a PI loop adjusts the duty cycle. A duty cycle of 76.6% gives 40 rpm with no load. The gains ended at Kp 0.09 and Ki 0.001.
It averaged 37.5 rpm with no load and 47.5 rpm at full load. With no load the speed swung between 30 and 60.
What we learned
- The motor wouldn't reverse. It had run one way for most of its life, and its field winding had magnetised. We switched to a separately excited setup.
- The motor's shaft is bent. That is most of why the speed swings with no load.
- The speed sensor on the motor was dead. Earlier groups had likely wired it to a supply with no resistors. We bought a new one and 3D printed a casing to match.
pulseIn()waits up to a second for a signal. Inside the main loop, it turned our 500 Hz PWM into 0.5 Hz. An interrupt fixed it.- Two 140Ω resistors rated for 1W were dissipating about 4W, and burned out. Swapping them for 1.2kΩ fixed that.
- The transistors needed heat sinks. In an H-bridge they shouldn't, so ours were never fully saturating. We didn't get to fix that one.