Go to Post FRANK, YOU'RE THE MAN. - Libby K [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 19-02-2009, 17:47
professorX professorX is offline
Registered User
AKA: Xavier
FRC #1660 (The Harlem Knights)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New York
Posts: 62
professorX is an unknown quantity at this point
Question Labview Question

How can I debug without having the robot connected?

I want to see if the values of the motor will change once I press a button on a joystick.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2009, 19:10
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,113
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: Labview Question

You'd have to replace all the cRIO-specific VIs with emulated ones, including the Joystick and Motor VIs. It's not a casual undertaking.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2009, 20:41
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Labview Question

If you don't have the robot connected, but you do have the cRIO and DS, then it becomes possible to perform debugging to a basic level. You'd connect the joystick, DS, and cRIO and computer together, run the app, and put a probe on the input to the motor. Clearly the inputs to the FPGA are not going to change without sensors attached, but you can access and update motors and other outputs all you like. The FPGA will dutifully update open circuits and you can test out logic stuff pretty well.

You can test other stuff by writing harness VIs to send sample data into the processing subVI. This HW in the loop testing is pretty much what NI HW and LabVIEW are designed to do.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 21-02-2009, 08:56
professorX professorX is offline
Registered User
AKA: Xavier
FRC #1660 (The Harlem Knights)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New York
Posts: 62
professorX is an unknown quantity at this point
Re: Labview Question

Quote:
Originally Posted by Alan Anderson View Post
You'd have to replace all the cRIO-specific VIs with emulated ones, including the Joystick and Motor VIs. It's not a casual undertaking.
Can you explain how to do this?

I forgot to mention that I don't have the cRIO since we shipped the robot with it.
Reply With Quote
  #5   Spotlight this post!  
Unread 21-02-2009, 10:56
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Labview Question

Quote:
I forgot to mention that I don't have the cRIO since we shipped the robot with it.
Bummer. My post assumed you still had a cRIO. This is doable, but a bit more involved.

In that case, the first thing I'd do is zip and backup everything so that you don't have accidental edits showing up on the robot.

Next determine which portions of your app you want to test out. It will be very difficult to get the whole app up and running -- the PC can't do the FPGA I/O after all, and there are many calls to the FPGA.

Anyway, pick the leaf level code you most want to run on the PC. Drag it from the cRIO target to the My Computer target. Open the VI under the PC portion of the tree. You'll find plenty of broken subVIs when finished loading. You can possibly delete them, or open the subVI, save As to new name, and then delete the diagram to make a stub. In some cases, you may want to have the VI return model data -- a sine wave or random number or constant may be fine.

Once you get the things below your VI ready and you can single run, you will sometimes want to build a quick harness to call your VI with model inputs. This is also a good way to discover what your code does with flaky inputs, things like 0, big numbers, even infinity and NaN.

You can interact directly with the subVI panel and build as many of these harness caller VIs as you feel you need in order to drive your subVI through its paces. Obviously, you need to be very organized here and any changes you make to your code needs to be integrated back carefully without all of the stubbed code changes. So hopefully you don't have too many of these to do.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 21-02-2009, 10:57
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Labview Question

Trying to emulate a physical system is really hard to do, because there are so many things that you have to take into account.

I did give this a try myself, though. I was trying to emulate our turret. I got the spec sheet for the globe motor, found the rpm, multiplied it by 0.5 (50%) to get it's real rpm, divided it by 60 to get the rps, and multiplied it by 360 to get the degrees per second.

To emulate the encoder on the motor, I took the desired speed, multiplied it by 12 (the voltage of the globe motor), and I assumed that there was a linear association between the voltage and the degrees per second (there probably isn't) and convert that value to desired degrees per second. I multiplied that value by time elapsed, and added it to the turret angle.

As you can see, it's a very involved process, and not completely accurate. I was able to find and squash some bugs in the software though, so it's not without merit.
__________________
Twitter Profile
Reply With Quote
  #7   Spotlight this post!  
Unread 21-02-2009, 11:07
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Labview Question

Sounds like you are on your way. As you say, some testing pretty much requires feedback from real world sensors or response from the system, and modeling it can be quite hard. But it is forward progress.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 21-02-2009, 11:07
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Labview Question

Another way (possibly less invasive) would be to use a conditional disable structure. Put all the cRIO specific parts in the default case, and in the other case, use TARGET_TYPE==Windows and use normal front panel controls. See the attached picture for one place where I did this.
Attached Thumbnails
Click image for larger version

Name:	conditional disable.PNG
Views:	25
Size:	6.2 KB
ID:	7539  
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
Labview Rookie Question -- Motors cmh0114 NI LabVIEW 2 23-01-2009 20:44
Labview Programming question pollyproof12 General Forum 2 30-09-2008 16:29
Question about using labView in FRC itsme LabView and Data Acquisition 7 19-01-2007 15:22
Question about the LabView itsme LabView and Data Acquisition 2 07-01-2007 20:16
Question about the LabView itsme NI LabVIEW 1 07-01-2007 19:14


All times are GMT -5. The time now is 21:35.

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