PID problem with 'D' in ver 2.5 & 2.5.1

More
21 Aug 2012 17:12 #23503 by joekline9
It seems that in 2.5 pid.c error_d is calced using command not "error - prev error".
Is this intended? I dont think this will work for me.

Ver 2.5:
/* compute command and feedback derivatives to dummysigs */
if(!(pid->prev_ie && !*(pid->index_enable))) {
*(pid->commandvds) = (command - pid->prev_cmd) * periodrecip;
*(pid->feedbackvds) = (feedback - pid->prev_fb) * periodrecip;
}
/* and calculate derivative term as difference of derivatives */
*(pid->error_d) = *(pid->commandv) - *(pid->feedbackv);
pid->prev_error = tmp1;

Ver 2.4:
(tmp1 contains current pos error)
/* calculate derivative term */
*(pid->error_d) = (tmp1 - pid->prev_error) * periodrecip;
pid->prev_error = tmp1;

Please Log in or Create an account to join the conversation.

More
21 Aug 2012 17:15 #23504 by PCW
The:
net x-vel-fb => pid.x.command-deriv

is the culprit, this should be

net x-vel-fb => pid.x.feedback-deriv

(and likewise for y,z,a)

This is a pncconf bug

Please Log in or Create an account to join the conversation.

More
21 Aug 2012 17:32 #23505 by joekline9
I will try this.
Thanks

Please Log in or Create an account to join the conversation.

More
21 Aug 2012 18:55 - 22 Aug 2012 18:49 #23510 by joekline9
changing "pid.x.command-deriv" to "pid.x.feedback-deriv" did the trick.

Beware anyone using pncconf .

I am not knocking pncconf, I love it. You just need to know about this bug.

Thanks for your help guys.
Last edit: 22 Aug 2012 18:49 by joekline9.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum