Hi every one I suppose to control speed of DC Motor using LPC1768(MOTOR CONTROL PWM). is it feasible to implement a digital PID controller using 1768? or i must use a more advanced micro controller. if YES, can you help me with writhing the codes? how can i implement a PID with c codes? Do you have sample codes for initial setup for Motor Control PWM?
thanks
Thanks Dear Dhaval I have worked with QEI peripheral before. and i am more comfortable with registers than CMSIS library. i had a brief review of MCPWM part in LPC1768 datasheet. but i think that part of datasheet isn't as good as i thought!!
i decided to learn it using sample codes but unfortunately most of the codes have been written using CMSIS library.
as i learnt, MCPWM consists of PWM + QEI, but it is not easy to calculate position without using interrupt(or i don't know how to do it!!)
i want to implement a digital pid controller that drives the motor at constant velocity. i know that my controller should fetch the qei velocity every time period and generate appropriate voltage(in pwm form). and i think it is easier to use PWM+QEI instead of MCPWM.
but i don't know what's the effect of PID calculation's time waste during interrupt, on pid accuracy?(i want to refresh pid calculation every 50us and clock frequency of 1768 is 100 MHz) is it feasible to earn 50us refresh time? how much clock pulses were spent in a simple (without extra codes) interrupt?