I am having a potentiometer which gives an analog voltage in range of 0-5V. I am considering this POT as throttel input for motor. If i change the pot speed increase and decrese on the basis of voltage comming from pot. I am sensing the analog voltage from ADC of my ATMEL mcu. My MCU is working on 5V.
Let say analog input from the POT is 2V. And i am assuming that command signal is 200 RPM fpr motor. My motor have hall sensor o/p from which i am able to read current speed of the motor which is say 120 RPM.
error = set_speed - current_speed = 200 -120 = 80 RPM
Now i apply the PID to this error signal(80 RPM) i will get some controller o/p.
Motor speed is controlled by changing the PWM duty cycle (16 bit register). But big question is that PWM use to control the speed of the motor. Now how to use this controller output to change the PWM duty of my MCU
How PWM relates to controller o/p signal to adjust the speed ?