Electrical – soft starter code for avr

avrdc motorpwm

I need to control 2 DC motors (Maxon RE40) using an AVR (atmega328) through pwm.
I was wondering what is the right way to approach the situation.

Should I increment the duty-cycle at a specific time interval or I should just take care that the difference between two consecutive duty-cycle its not too large?

I want the system to be as responsive as possible but also take care of the motors.

I need to understand the way a soft start should be designed (in software) and what are the possible trade offs.

Thanks

Best Answer

But the motor has to change from full speed in one to another direction or form zero to full speed, that's why we use motors. You can limit the current and consequently the acceleration. the H bridge shall output such voltage that the current remains always in the margins. The best you can do is a PI regulator, the setpoint is rated motor current and the feedback is measured current. When you will start, the regulator will output a certain duty cycle setpoint and it will be increased by regulator output when the motor will gain speed (back EMF compensation). $$M=J\alpha + M_{load}$$ $$M \propto I_a$$ $$U_a=I_a*R_{winding}+U_{backEMF}$$ $$U_{backEMF}=k[V/krpm]*n[rpm]$$