![]() |
LabVIEW PID for angles
Is there a LabVIEW PID vi that has the built-in smarts to generate the proper error angle (magnitude and sign) if given a joystick command (e.g atan2(Xj,-Yj)*(180/pi)) as the setpoint and the gyro angle as the process variable? |
Re: LabVIEW PID for angles
I don't fully understand what your question says, but I think I can figure out why you're asking it.
Would it be sufficient for your purpose if there were a function that took two angles and added a multiple of 360 degrees to the first angle so that it was within 180 degrees of the second one? Or maybe you want to subtract two angles and modify the difference by adding a multiple of 360 degrees so that it was within the range -180 to +180? |
Re: LabVIEW PID for angles
Quote:
I am asking if LabVIEW has a PID designed to handle angular process_variable and setpoint inputs directly, without having to do something like this externally: Code:
angle_error = joystick_command - gyro_angle;Not that this is difficult to do, just wondering if there is a PID with this built-in capability. |
Re: LabVIEW PID for angles
Quote:
It seems that the specific application you have in mind assumes motor control of a mechanism capable of continuous rotation and negligible time for changing direction. That's not the only kind of mechanism one might want to control based on angle. Since each application is going to have its own requirements, a built-in function would have to have a lot of options, and it still might not accommodate some needs. I think you're trying to ask whether there is a built-in function that combines PID with the specific way you want angular errors to be computed. You're the one who knows how you want it to work, so I don't think it's any great burden to have you implement that part of it yourself. |
Re: LabVIEW PID for angles
Just to confirm, no. If there are special conditions with the input or output of the PID, you add those to the front or back.
By the way, the integer divide is the LV way to do modulo math. Greg McKaskle |
Re: LabVIEW PID for angles
Quote:
There is a lot of interest here on CD about using gyro angular position to control robot orientation. A continuous-rotation wrapper around the LabVIEW PID might for some folks be a helpful addition to the WPI Library next year. |
Re: LabVIEW PID for angles
Quote:
Quote:
|
Re: LabVIEW PID for angles
2 Attachment(s)
Quote:
Code:
If your compiler supports the REMAINDER function "x REM y" per IEC 60559 (mine does not so I have not tested this) as specified on Page 235 Section 7.12.10.2 of ISO/IEC 9899:TC3, then I believe the following should work: Code:
The above can be done in LabVIEW as shown in either of the two attached screenshots. |
| All times are GMT -5. The time now is 11:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi