So, looking at Kevin Watson's velocity PID code...
Chiefly I'm looking at the differences between the normal position-based code and the velocity, as we currently have a working normal PID. Looks like it comes down to this line:
Code:
motor_info[motor].vel = ((vel_last * 9) + (motor_info[motor].pos - pos_last) * HZ) / 10;
Now, I understand that acceleration is being calculated rather than velocity like the position PID, but, two questions to Kevin or whoever might be knowledgeable:
1 - Where exactly is the 9/10 bit coming from? Is some form of scaling the old value? If not, how was it derived?
2 -What is the purpose of the hertz? I know what it is, just not what it does.
Sorry, I know I could just replicate that line, but I'm apprehensive about adopting code I have no idea what does. Any help is appreciated.