30 Oct 2012 23:14 #26077 by andypugh
Replied by andypugh on topic Servo Tuning Advice

Are there any simple tricks to make the ouput scale positive? I wonder if I have a positive/negative problem screwing with the PID math..

The PID isn't happy with negative coefficients, but you don't have that, so it ought to be OK.

30 Oct 2012 23:32 #26080 by PCW
Replied by PCW on topic Servo Tuning Advice
You can see how slowly the I term slews the PID output at the end of motion
with say 300u of error, so it still seems way to slow to me

30 Oct 2012 23:35 #26081 by andypugh
Replied by andypugh on topic Servo Tuning Advice

You can see how slowly the I term slews the PID output at the end of motion
with say 300u of error, so it still seems way to slow to me

This might be one of those times that the ability to vary I with error would be useful.

31 Oct 2012 01:09 - 31 Oct 2012 01:12 #26088
Replied by Todd Zuercher on topic Servo Tuning Advice
I tried the 500K and things came in line faster, so I went nuts and tried 1 million and 10million, at 10 million it finally became unstable during the move
so I backed it off to 4million and this is what it looks like. Now the following error seems to be proportional to the velocity. Changing FF1 doesn't seem to change it, (at FF1=+/-500 it became unstable)

##### Attachments:
Last edit: 31 Oct 2012 01:12 by Todd Zuercher.

31 Oct 2012 01:46 #26090 by PCW
Replied by PCW on topic Servo Tuning Advice
Something odd is going on here, the I term should pull in the ferror during the cruise phase but its doing nothing (flat top on ferror during cruise)

Is it possible you have the pid.N.maxerrorI set so its limiting the contribution of the intergral term to the PID output?

you can plot the PID integral term to trace this issue

Also FF1 should make a visible difference in the following error but you have to adjust is in small increments and note the sign of the error (and a negative FF1 is never right)

FF1 cannot cause instability by itself (its not a feedback or gain term) but it can cause big errors that may trigger other latent instabilities

31 Oct 2012 02:31 #26093
Replied by Todd Zuercher on topic Servo Tuning Advice
There are no pid.N.maxerrorI lines in my hal file.

A negagive FF1 is what gave the best result during crusing before I added all this I.
So this is starting to sound like something might be wonky somewhere, but what?

How do I plot the PID integral term? I could not find a pin or signal for it.

31 Oct 2012 02:45 #26094 by PCW
Replied by PCW on topic Servo Tuning Advice
you have to enable debug for the PID comp to spill-its-guts

31 Oct 2012 03:07 #26095
Replied by Todd Zuercher on topic Servo Tuning Advice
Where do I put the debug=1?

31 Oct 2012 03:13 #26096 by PCW
Replied by PCW on topic Servo Tuning Advice
man pid