Go to Post So, in the good old FIRST spirit, let's all start brainstorming and sharing ideas, ok? :D - LauraN [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 11-02-2015, 21:32
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,112
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: Auto won't run

Your drive motors are being commanded only once. Things will work better if you add a While around the drive code, with a Wait of 10 or 20 ms to keep the loop from eating up all the CPU time.

The Gyro Get Angle will have to be duplicated inside the loop for the 90 degree turn. (You can't communicate time-varying values into or out of a loop; they take their inputs once when the loop first begins, and produce an output once the loop finally finishes.)
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2015, 19:58
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Auto won't run

Quote:
Originally Posted by Alan Anderson View Post
Your drive motors are being commanded only once. Things will work better if you add a While around the drive code, with a Wait of 10 or 20 ms to keep the loop from eating up all the CPU time.

The Gyro Get Angle will have to be duplicated inside the loop for the 90 degree turn. (You can't communicate time-varying values into or out of a loop; they take their inputs once when the loop first begins, and produce an output once the loop finally finishes.)
Thank you so much, I did that and now the drive works perfectly!

I have another problem, if its not a bother:



After the pistons clamp, it doesn't move to the next part of the flat sequence structure. Can anyone spot the problem? I've been looking at it for the past hour.
__________________
2015 MAR District Champions




Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2015, 21:25
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,112
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: Auto won't run

Quote:
Originally Posted by dubiousSwain View Post
After the pistons clamp, it doesn't move to the next part of the flat sequence structure. Can anyone spot the problem? I've been looking at it for the past hour.
Your "Turn 90 degrees" frame sets the drive state to 4, which I see is supposed to turn at 30% power. But then it immediately sets the state to 3 while it waits for the turn to complete. I assume drive state 3 just sits there doing nothing. Get rid of that extraneous 3 -> State3 underneath the gyro angle indicator in the while loop.

(I suggest that you move the frame labels from above the flat sequence to actually inside the frames they are labeling. That way they will stay connected to the code they are describing if you ever rearrange things.)
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2015, 11:11
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 119
aeastet is an unknown quantity at this point
Re: Auto won't run

Here is the example code. Let me know if you have any questions.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2015, 11:16
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 119
aeastet is an unknown quantity at this point
Re: Auto won't run

How do I attach a zip file?
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2015, 11:26
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 119
aeastet is an unknown quantity at this point
Re: Auto won't run

Another try at it.
Attached Files
File Type: zip First 2015.zip (65.9 KB, 1 views)
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 10:25.

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