Go to Post I guess instead of focusing on the stuff we wish we could have changed, we should focus on all of the wonderful stuff we accomplished instead! - Winged Wonder [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
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 16-02-2010, 15:03
Andy Bradley Andy Bradley is offline
Registered User
FRC #0233
 
Join Date: Jan 2010
Location: Florida
Posts: 15
Andy Bradley is an unknown quantity at this point
Is anyone using LabView and can bus?

We are still trying to figure out how to implement can bus using LabView. The example was pretty specific to arcade drive, but I haven't yet clearly understood what the sub VIs do or why. Has anyone out there successfully gotten the can bus to work with LabView?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2010, 02:44
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Is anyone using LabView and can bus?

Quote:
Originally Posted by Andy Bradley View Post
We are still trying to figure out how to implement can bus using LabView. The example was pretty specific to arcade drive, but I haven't yet clearly understood what the sub VIs do or why. Has anyone out there successfully gotten the can bus to work with LabView?
I have. What specifically do you have questions about?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2010, 09:28
Yppiz's Avatar
Yppiz Yppiz is offline
Registered User
FRC #1014 (Bad Robots)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 1776
Location: Dublin,OH
Posts: 33
Yppiz is an unknown quantity at this point
Re: Is anyone using LabView and can bus?

Where would one even get sample code for CAD in labview?
__________________
My friend VICTOR has a JAGUAR and a 2CAN, and from his Lab'sVIEW he can CRIO grande. Do the puns have you VEXed? You're not the FIRST.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-02-2010, 14:56
Andy Bradley Andy Bradley is offline
Registered User
FRC #0233
 
Join Date: Jan 2010
Location: Florida
Posts: 15
Andy Bradley is an unknown quantity at this point
Re: Is anyone using LabView and can bus?

Quote:
Originally Posted by jhersh View Post
I have. What specifically do you have questions about?
Thanks for fielding this.

For starters, what are the differences in the control modes for the open vi: Percent Vbus, Speed, Position, and current - and how do they relate to the status info that can be read back?

Also, can I use the jaguar as a connection point for an encoder without using the sensor to control that particular motor?

Finally, if a potentiometer or encoder is connected to the jaguar, what is displayed for the status->speed value? Counts per sec? degrees?

Thanks again,
Andy
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2010, 15:53
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Is anyone using LabView and can bus?

First, let me warn you that the current snapshot is not functional for the closed loop modes. If you check out the latest SVN code, then things should work for you. I fixed some bugs in the last few days so make sure you are up to date.

Quote:
Originally Posted by Andy Bradley View Post
For starters, what are the differences in the control modes for the open vi: Percent Vbus, Speed, Position, and current - and how do they relate to the status info that can be read back?
The Percent Vbus is the same open loop mode that you get with PWM... it's just higher resolution than the PWM interface. Speed mode uses an encoder as a reference sensor to attempt to maintain a speed you set in spite of load or voltage changes. Position is the same, except that instead of a fixed speed, it uses a fixed position and can use a single- or multi-turn potentiometer or an encoder as a reference. Current mode attempts to drive the motor as a fixed current (which is related to torque) in spite of variable load. They are pretty much independent of the status data.

Quote:
Originally Posted by Andy Bradley View Post
Also, can I use the jaguar as a connection point for an encoder without using the sensor to control that particular motor?
You could, but I wouldn't recommend it since it is slower to read from the Jag than directly from the cRIO's 9403. If you do this, you won't have any feedback for the motor you are actually controlling so you would need to be in open-loop Percent Vbus mode.

Quote:
Originally Posted by Andy Bradley View Post
Finally, if a potentiometer or encoder is connected to the jaguar, what is displayed for the status->speed value? Counts per sec? degrees?
The output is in RPM assuming you configured the number of lines in your encoder. The potentiometer is not a valid speed reference.

If you read the position status, then it is based on the position reference that you select (encoder or pot) and the output is the number of rotations.

-Joe
Reply With Quote
  #6   Spotlight this post!  
Unread 18-02-2010, 20:02
Andy Bradley Andy Bradley is offline
Registered User
FRC #0233
 
Join Date: Jan 2010
Location: Florida
Posts: 15
Andy Bradley is an unknown quantity at this point
Re: Is anyone using LabView and can bus?

Thank you, thank you, and thank you Joe! That helped a lot. Our can bus works now. The only thing that we haven't yet done is write the set/get refnum functions for a single Jaguar. Any idea how to do that? (that is to say, do we try to modify the can library, or write our own from scratch?)
Thanks
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2010, 00:38
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: Is anyone using LabView and can bus?

Quote:
Originally Posted by Andy Bradley View Post
Thank you, thank you, and thank you Joe! That helped a lot. Our can bus works now. The only thing that we haven't yet done is write the set/get refnum functions for a single Jaguar. Any idea how to do that? (that is to say, do we try to modify the can library, or write our own from scratch?)
Thanks
I did that for our team, and it's a bit messy, but not too bad. First of all, the next update of the CANJaguar library will have a RefNum VI set in it, and is accessible on SVN (you'll have to ask Joe how to access that). Second, it might just be easier to bundle all of the RefNum output clusters into one big cluster and run it between Begin and Teleop/Autonomous, where it is then unbundled.

If you look in the "CANJaguar for LabView" folder from First Forge under "CAN Jaguar - MotorControl", there is a SubVIs folder. One of the files in this folder is called "CAN Jaguar Ref.ctl", and is not a VI, it's a cluster. If you right-click on the front panel, go to "Select a VI..." and double-click this file, it will put a cluster on the front panel. You can then copy this to create an in and an out.

If you look at all of the Get and Set RefNum VI's, they're all pretty much exactly the same, except the input clusters are different. You can do the same here. You will need to copy 3 files; "xxxx RefNum Get Set.vi", "xxxx RefNum Registry Set.vi", and "xxxx RefNum Registry Get.vi", where "xxxx" is the new name of your favorite RefNum VI (I used the PWM motor control one). In all of these new VI's, "simply" replace all of the old refnum clusters with the CANJaguar cluster. Remember you will probably have to rewire the terminals on the connector for the VI, and you should also redo the icon a bit so you know what's what.

Once you've modified the VI's you copied into your project folder (and not replaced them, never modify VI's that are still IN the standard LabView libraries, you get lots of errors that way), make sure they're added into the project in LabView, under Team Code. You *should* be able to wire them in normally as RefNums now, but let me know if you have any problems.

Again, it might just be easier to bundle the RefNum clusters together (make sure to name them descriptively so you can see what's what when you unbundle) and wire them through. And, also again, there will be a refnum VI set in the next CANJaguar release.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2010, 03:37
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Is anyone using LabView and can bus?

Quote:
Originally Posted by Andy Bradley View Post
Thank you, thank you, and thank you Joe! That helped a lot. Our can bus works now. The only thing that we haven't yet done is write the set/get refnum functions for a single Jaguar. Any idea how to do that? (that is to say, do we try to modify the can library, or write our own from scratch?)
Thanks
In case you didn't already notice, I posted snapshots of all the latest CANJaguar code under file releases on FIRST Forge. The new shapshot includes the get ref and set ref VIs for CAN Jaguar. It also includes a number of bug fixes, so everyone should definitely upgrade.

-Joe
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone have a working can bus sample? Andy Bradley NI LabVIEW 0 13-02-2010 01:13
paper: Set and display your Auto-Mode using LabVIEW and the Driver Station PhilBot Extra Discussion 0 11-02-2009 12:32
Is anyone using the Labview Dashboard during competition? programmr General Forum 11 05-02-2009 17:06
Labview questions, using motor and pot as a servo martin417 NI LabVIEW 7 05-02-2009 16:43
Can I use C and labview togther Chris11246 NI LabVIEW 2 23-01-2009 18:43


All times are GMT -5. The time now is 22:02.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi