|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
paper: LabVIEW Mecanum Programming
|
|
#2
|
||||
|
||||
|
Re: paper: LabVIEW Mecanum Programming
Nice presentation. This should prove helpful to teams just getting started with LabVIEW and mecanum. There's a small error on Page 19 which may lead some astray: Quote:
You can't just pass the joystick angle and gyro angle to the PID as-is. The PID will not like that at all. For example, if the joystick angle is -1 degree and the gyro is reading +359 degrees, the PID will calculate (and act upon) an error of -1-359 = -360 degrees... even though the vehicle is already pointing in the desired direction. To use the LabVIEW PID in this situation, you need to do something like this: Code:
angle_error = joystick_angle - gyro_angle; angle_error -= 360*floor(0.5+angle_error/360); setpoint = gyro_angle + angle_error; process_variable = gyro_angle; Example LabVIEW code for the second line in the code block above can be found here. Last edited by Ether : 20-02-2011 at 02:05. |
|
#3
|
|||
|
|||
|
Re: paper: LabVIEW Mecanum Programming
Thank you Ether. I added in a solution that I used but neglected to include in the first version. Now that I look at your solution closer, however, yours seems a great deal more elegant.
|
|
#4
|
|||
|
|||
|
Re: paper: LabVIEW Mecanum Programming
I have a question on slide 9; what is the blue thing within the case structure? Sorry 1st time programming mechanum drive. Very helpful presentation
|
|
#5
|
|||||
|
|||||
|
Re: paper: LabVIEW Mecanum Programming
I don't know what it is you're referring to. Can you describe the "blue thing" a little better? Blue typically means an integer value.
|
|
#6
|
|||
|
|||
|
Re: paper: LabVIEW Mecanum Programming
Sorry about that; I mean in the true/false case structure, there is the"blue thing" that says"L1 rotate_mode." My question is where is that located in labview?
|
|
#7
|
|||||
|
|||||
|
Re: paper: LabVIEW Mecanum Programming
rotate_mode is a global variable that was defined on the immediately preceding slides. L1 is an enumerated constant that was obviously created by right-clicking the input terminal of the variable and choosing Create Constant.
|
|
#8
|
|||
|
|||
|
Re: paper: LabVIEW Mecanum Programming
Hello,
I did all the steps in page 8, but can not get my robot global data to read the "rotate mode" enum. Any help would be appreciated. Thanx, David |
|
#9
|
|||||
|
|||||
|
Re: paper: LabVIEW Mecanum Programming
I'm not sure what you mean. The robot global data doesn't "read" or "write" the values. It just provides a place that contains them.
Are you trying to say you can't get the global variable to appear on the Teleop block diagram? |
|
#10
|
|||
|
|||
|
Re: paper: LabVIEW Mecanum Programming
Yes sir. That is what I meant. I defined it's values in the Robot Global Value.vi but they won't show in teleoperated.
Thanks, David |
|
#11
|
|||||
|
|||||
|
Re: paper: LabVIEW Mecanum Programming
It's not exactly obvious how to place a reference to an existing global variable. Here's how to do it:
Right-click on an empty spot in the block diagram to call up the function palette. Choose "Select a vi..." and navigate to the folder containing your robot project. Open "Robot Global Data.vi" and you'll have a global variable attached to your cursor (it will likely be named "Enable Vision" -- don't worry about it). Click to place that variable on the block diagram. Now you can click on the middle of the variable to bring up a list of all the globals that are part of the Robot Global Data vi. Choose the one you want. The default is to make a "write" reference. To change it to "read", right-click on the variable and choose "Change To Read". |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|