ysba
Advanced Member level 4
- Joined
- May 26, 2013
- Messages
- 108
- Helped
- 23
- Reputation
- 46
- Reaction score
- 23
- Trophy points
- 1,298
- Activity points
- 2,136
Hi,
I'm working with a closed loop application and I'm getting stucked at the PID control. The PID itself is not my problem, but how to implement it in the MCU (I'm using PIC24FJ). I'm using a 250kHz PWM, and running the core at 32MHz, so my duty cycle resolutin is only 6 bits. So, how can I convert the 10 bits AD result in a 6 bits PWM duty cycle? And also, which variable type is best for the control calculations? Could someone give me a good reference? Thanks.
I'm working with a closed loop application and I'm getting stucked at the PID control. The PID itself is not my problem, but how to implement it in the MCU (I'm using PIC24FJ). I'm using a 250kHz PWM, and running the core at 32MHz, so my duty cycle resolutin is only 6 bits. So, how can I convert the 10 bits AD result in a 6 bits PWM duty cycle? And also, which variable type is best for the control calculations? Could someone give me a good reference? Thanks.