Looking For a Guide to VEX IME PID Tuning

I am looking for a guide to tuning IME PID values, specifically in EasyC. If there aren’t any made specifically for EasyC, are there any that anyone could recommend to me as a start point?
I understand the effects proportion, integration, and derivative have on the system, I’m just having trouble coming up with initial values for the drive and lift system from which I would then optimize through testing.


Have you seen Jij’s guide on PID:
PID programming guide

His focus was using RobotC, but the Ideas are the same… Also, Dpbailey was working on an EasyC v4.x version, seen in this post, Re: Need help with PID for going straight in autonomous : Post #12 .

Thanks! I remember seeing Jij’s guide before, but I couldn’t find it again.

So I guess my next question is how does EasyC handle its IME PID control? For example, I have found (I think) that each time you update the setpoint for a motor its integral value is reset.
It would be nice to know if the integral value resets when the target is reached, or if it only starts adding up error once within a certain range, etc.
I haven’t found any documentation related to this yet.

That will be an Intelitek Question to be certain, but from reading the “Fine Manual”…

In EasyC v4.0.5.1, the PID Control section of the Help Files says this:

[FONT=Courier New]<< SNIP SNIP SNIP >>

*****The Define PID option allows the user to define which motor will be using the PID function, the P, I and D constants, and the tolerance value. This block is only required if you wish to use different values for P, I or D, or if you wish to change the tolerance value.

*****The Start Process option starts the PID loop, and sets the initial setpoint.

*****The Update Setpoint option allows the user to change the setpoint of the PID loop without having to restart the PID process.

*****The On Target option will return 1 if the PID input is within the tolerance value, and 0 if it is not.

*****The Stop option stops the PID loop.


Which I would infer that when Updating the Setpoint, with the “Update Setpoint option” the Integral value is not changed, ( as well as the proportional, and derivative terms ). To change them requires using the “Define PID option”.

I may need to do more testing, but I worded my previous statement poorly. It seems like each time I use the Update Setpoint option, the lasterror is reset to 0.
The reason I say this is that I had the Update Setpoint inside a while loop and no matter what I set the Ki to, it had far too little effect. When i used an Update Setpoint outside of a while loop the integral started to take effect. From this, I deduced that the lasterror is set to 0 each time Update Setpoint is used. I may be wrong tho.

Or you Might be Right…

Just look at what is happening with the GlobalData Variables in EasyC v4.x in thread, Tournament Order of Progression - unofficial answer.

Good point. Well I’ll try to do a little testing next week and post it. Hopefully I can figure out exactly how the integral term and derivative term work.

Post a Question in the EasyC Technical Support Q&A too… It might save you some steps…