04-10-2012 11:25 AM - edited 04-10-2012 11:27 AM
Hi guys i have bought and built a Nxt Lego Segway for a college project which uses the light intensity sensor as a way to balance itself through Labview
Bellow is the programme i have so far which beside maybe neading a bit more fine tunning is working with the P & I side of PID
I side
And P side
So i am finally on the Derivative side now from what i understand Derivative = ( the current error) – ( the previous error) But
If the current error it s worse than the previous error then the Derivative term should correct the Error, But if the error is better than the previous error the Derivative term should stop the correction of the error as it is getting close to the zero error line (robot balanced) and the point where their should be no error correction.
SO what i am wondering if anyone can help me set this up is their a function on labview which you can set that if a number is less than previous do nothing but if higher (worse error ) allow it to go through ???
hopefully what im asking makes sence if not fire away with questions.
Thanks in advance
Matt
04-11-2012 03:34 AM
Hi Matt-p
I think what you are looking for may be along these lines.
Essentially, by using the shift register we are always able to reada the previous error back in at the beginning of the loop after filling it from the previous operation. The case structure then allows the comparison functions output to be acted upon.
I hope this helps.
Cheers
04-11-2012 07:53 AM
Hi Liam
Thank you for the reply so the above will act in .. if the "latest error" is greater than "previous error" it will allow it to go through to the case structure but if smaller it will not,
So do i make my calculation before above is done so, ""current error - previous error = derivative"" , then use above to see if its greater or less than last ""derivative""
how do i then send that signal number gotten if its bigger and true out of the case structure up to my formula node marked Ed(derivative error) ???
if that makes sense
Thanks again
Matt