Go to Post Step 1: Get a blue banner. Step 2: Wave it everywhere until your School Board acknowledges your existence. We haven't gotten to Step 1 yet, unfortunately. - Chris is me [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 10-02-2013, 02:51
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Autonomous code issue :(

A few potential problems I see with the overall structure:

1. Your "Wheel Distance" VI's are both inside of a while loop. They will be constantly updating, so the drive motors will never actually reach their goal of 50cm.

2. There is no wait timer in the while loop. You may want to add one to avoid any potential cRIO lag issues.

3. You are writing to the drive motors in 3 separate places that I can see. This is generally not a good idea, as LabVIEW gets confused pretty quick if multiple VI's are giving commands to the same motor.

Number 3 is what is most likely causing the problem. Here is some code that should do what you want:

http://i.imgur.com/R1Ukf8Y.png

Instead of your custom VI, I just created a case structure as a placeholder. It works on the same principle as yours, except there is no need to add the 50cm and then subtract off. Simply reset the encoders using the "Reset Encoder" global variable *before* you enter the while loop/first case, and that way you can be sure they will start at 0. It advances to the next case if both encoders have reached 50cm.

Last edited by propionate : 10-02-2013 at 02:57.
Reply With Quote
 


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 22:50.

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