PID problem with 'D' in ver 2.5 & 2.5.1
21 Aug 2012 17:12 #23503
by joekline9
Replied by joekline9 on topic Re:PID problem with 'D' in ver 2.5 & 2.5.1
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;
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.
21 Aug 2012 17:15 #23504
by PCW
Replied by PCW on topic Re:PID problem with 'D' in ver 2.5 & 2.5.1
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
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.
21 Aug 2012 17:32 #23505
by joekline9
Replied by joekline9 on topic Re:PID problem with 'D' in ver 2.5 & 2.5.1
I will try this.
Thanks
Thanks
Please Log in or Create an account to join the conversation.
21 Aug 2012 18:55 - 22 Aug 2012 18:49 #23510
by joekline9
Replied by joekline9 on topic Re:PID problem with 'D' in ver 2.5 & 2.5.1
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.
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