You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Brett, first thanks for your trouble to do this. Im writing code to make a treadmill motor run at constant speed irrespective of the load. The code is for a PIC16F690 and my work so far is detailed on my github https://github.com/happymacer/PF906-treadmill-motor-controller- (Ive yet to upload the first version of code )
I can run the motor without PID at the moment by setting the duty cycle and the value of the duty cycle is an absolute value rather than an increment from the prior speed setting (Im using fixed speed increments selected by button presses). The PID is supposed to keep the motor at the set speed as the motor load increases.
I have been implementing your code in C and I have come unstuck because all the PID example code I have seen so far seem to be an incremental value, so when I make the output of the PID the duty cycle the first time will be fine due to the large error, but the next will be a small error and hence a small duty cycle so when i plug that into the registers for the PWM, the motor will slow right down.
So Im thinking I need to add the new PID output to the previous and drop that into the PWM registers. Is that correct or have I messed up?
The text was updated successfully, but these errors were encountered:
Hi Brett, first thanks for your trouble to do this. Im writing code to make a treadmill motor run at constant speed irrespective of the load. The code is for a PIC16F690 and my work so far is detailed on my github https://github.com/happymacer/PF906-treadmill-motor-controller- (Ive yet to upload the first version of code )
I can run the motor without PID at the moment by setting the duty cycle and the value of the duty cycle is an absolute value rather than an increment from the prior speed setting (Im using fixed speed increments selected by button presses). The PID is supposed to keep the motor at the set speed as the motor load increases.
I have been implementing your code in C and I have come unstuck because all the PID example code I have seen so far seem to be an incremental value, so when I make the output of the PID the duty cycle the first time will be fine due to the large error, but the next will be a small error and hence a small duty cycle so when i plug that into the registers for the PWM, the motor will slow right down.
So Im thinking I need to add the new PID output to the previous and drop that into the PWM registers. Is that correct or have I messed up?
The text was updated successfully, but these errors were encountered: