Controlling DC Motor with Microcontroller
Here’s a quick article to create a digital controller without too many theories: “PID without PhD”
The article writes a fairly complete digital handbook, discussing from digital control theory to source code, minus Rotary Encoder & PWM. Tim Wescott, Applied Control Theory for Embedded Systems, Newnes 2006
Yesterday I had tinkering a few hours, the summary as follows. Some things that might make the problem:
1. Specifications Rotary Encoder, able to how many rpm?
2. Interfacing encoder into a microprocessor. Is the signal from the encoder well received in the microprocessor?
3. External interrupt settings, is it correct?
4. Time to interrupt: Does the CPU quite quickly process the data before the next interrupt comes? Is lower interruptions a priority CPU allowance?
5. Is there any other process in the microprocessor that rebutted the CPU ration?
Use of interruptions in STM32:
Alternative Motor Driver
Alternative Motor drivers: