|
Re: PID Control algorithm(to control PWM Duty Cycle based on Current)
The conversion units from amps to duty cycle is included in the constant values Kp and Ki.
e.g. (6A - 5A) * (Kp %/A) = Kp%
To get the duty cycle, add all components:
(error * Kp) + (integrated error * Ki) = duty cycle.
The constants Kp and Ki are usually determined experimentally, through trial and error. I would recommend tuning your motor at a constant voltage to determine Kp (start with Ki = 0), and then changing the voltage to determine Ki.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
|