misan / dcservo

Position control of DC motors
312 stars 113 forks source link

STM32 with hardware encoders #64

Open paukstelis opened 5 years ago

paukstelis commented 5 years ago

I've been working on using STM32 for dcservo. I've forked and added what I have done: https://github.com/paukstelis/dcservo.git . It is mostly specific for the printer I'm working on, but it could serve as a basis for anyone else looking to do this.

I have recently noticed a weird problem that I can't quite wrap my mind around. I always have some trouble dialing in motor PIDs, but I've recently noticed overshoot only when I use very slow feedrates. The motors clearly overshoot and then correct. At higher feedrates there is no overshoot. Has anyone else noticed this kind of speed dependence?

misan commented 5 years ago

Not sure what can be the cause. There is usually a dead-band where the motor does not react to low output values, maybe you want to compensate it to see if it improves the response.

BTW, I love the idea of the hardware support for the encoders.