[SOLVED] PI value to duty cycle

Status
Not open for further replies.

ashugtiwari

Full Member level 4
Joined
Dec 12, 2008
Messages
218
Helped
45
Reputation
90
Reaction score
44
Trophy points
1,308
Visit site
Activity points
3,310
Hello All,
Im currently working on DC motor control project and have designed one PI controller to control its speed and current. The PI controller takes the difference between actual and reference speed and finds the error and then using simple z-domain PI controller calculations I generate PI value. Now, the question is how to convert the PI value into the % duty cycle value for controlling DC motor speed?

Please reply. Thanks for answers.

Ashutosh
 

I found the answer.
The PI calculations should be done in one of the format like Q15 i.e. 16 bit integer format, so all the input and output values are in same format. Then output of PI can be scaled to PWM resolution easily by a simple scalar multiplier.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…