OCCRA
Go to Post Nutritionally speaking I didn't get enough (MOE) green in my FIRST diet this year! - Mark McLeod [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Media  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-19-2011, 11:53 PM
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
paper: LabVIEW Mecanum Programming

Thread created automatically to discuss a document in CD-Media.

LabVIEW Mecanum Programming by Jogo
Reply With Quote
  #2   Spotlight this post!  
Unread 02-20-2011, 01:22 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 9,126
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
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:
Wouldn't it be convienient to--on the push of a button--rotate to the direction you're traveling?
▪To calculate this angle, do Math.atan2(Joystick X, -Joystick Y)
▪Implement a PID loop--the setpoint is the joystick angle, and the process variable is the gyro angle
The above won't work very well. The joystick angle will be -180..+180, and the gyro angle will be 0..360+

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 : 02-20-2011 at 02:05 AM.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-20-2011, 08:26 AM
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2012, 08:04 PM
maria_edu maria_edu is offline
Registered User
FRC #1811
 
Join Date: Jan 2012
Location: Newark, NJ
Posts: 13
maria_edu is an unknown quantity at this point
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
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2012, 09:16 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2012, 09:22 PM
maria_edu maria_edu is offline
Registered User
FRC #1811
 
Join Date: Jan 2012
Location: Newark, NJ
Posts: 13
maria_edu is an unknown quantity at this point
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?
Reply With Quote
  #7   Spotlight this post!  
Unread 02-02-2012, 09:30 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 02-06-2012, 08:26 PM
2829ron 2829ron is offline
Registered User
FRC #2829
 
Join Date: Jan 2009
Location: USA
Posts: 92
2829ron will become famous soon enough2829ron will become famous soon enough
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
Reply With Quote
  #9   Spotlight this post!  
Unread 02-06-2012, 10:36 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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?
Reply With Quote
  #10   Spotlight this post!  
Unread 02-07-2012, 09:26 AM
2829ron 2829ron is offline
Registered User
FRC #2829
 
Join Date: Jan 2009
Location: USA
Posts: 92
2829ron will become famous soon enough2829ron will become famous soon enough
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
Reply With Quote
  #11   Spotlight this post!  
Unread 02-07-2012, 10:56 AM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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".
Reply With Quote
  #12   Spotlight this post!  
Unread 02-07-2012, 11:00 PM
2829ron 2829ron is offline
Registered User
FRC #2829
 
Join Date: Jan 2009
Location: USA
Posts: 92
2829ron will become famous soon enough2829ron will become famous soon enough
Re: paper: LabVIEW Mecanum Programming

Okay. I got the global variable to show up, and I can connect the constant to it. But when I change the global variable to read, I can't connect my constants anymore. Did I totally mess up somewhere? This is my third year programming, but I've never messed with the global robot data vi.

Thanks,

David
Reply With Quote
  #13   Spotlight this post!  
Unread 02-07-2012, 11:43 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: paper: LabVIEW Mecanum Programming

If you want to put a constant in the global variable, you need to write to it. You would read it if you want to do something with the value it contains.
Reply With Quote
  #14   Spotlight this post!  
Unread 02-08-2012, 08:49 PM
2829ron 2829ron is offline
Registered User
FRC #2829
 
Join Date: Jan 2009
Location: USA
Posts: 92
2829ron will become famous soon enough2829ron will become famous soon enough
Re: paper: LabVIEW Mecanum Programming

Okay. On to page 14 I'm getting tired of asking questions. But thanks to everyone for your help. The rotate mode runs into the case structure and then connects to the symbol I can't seem to find. It's blue with an arrow and a box with a circle under it.

Also, do need to create a global variable called "header"? If so, what properties does it need to have?

And... what is connect to the PID on page 15?

Thanks again,

David

Last edited by 2829ron : 02-08-2012 at 08:57 PM.
Reply With Quote
  #15   Spotlight this post!  
Unread 02-08-2012, 10:53 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,163
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: paper: LabVIEW Mecanum Programming

Quote:
Originally Posted by 2829ron View Post
The rotate mode runs into the case structure and then connects to the symbol I can't seem to find. It's blue with an arrow and a box with a circle under it.
It's called a Feedback Node. You will find it in the Programming>Structures function subpalette. Its output is the value that was connected to its input the previous time through the loop. It changes color based on what type of data it's connected to; in this case it's blue because the data is an (enumerated) integer type.

(The Feedback Node look has changed slightly between LabVIEW 8.6 and LabVIEW 2011. The "box with circle" is now a wider box with an asterisk.)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:20 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi