Go to Post It means Dave Lavery isn't on the Game Design Committee this year. If he were, you probably would have found a banana instead. - Alan Anderson [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-03-2014, 21:49
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Autonomous timing of events are to fast

Yes, the a button press is used to turn on the frontMotors in periodic tasks. The frontMotors are turned off in the false case of the button press.

How do I fix this so they do not conflict with eachother?
Reply With Quote
  #2   Spotlight this post!  
Unread 30-03-2014, 22:05
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Autonomous timing of events are to fast

In periodic task, you can set-up a case structure where when the robot is in auto, it does not do the function you have in periodic task. This structure would go over the entire function of what you're doing when you press the button. There's other ways, such as developing a global Boolean variable that executes your periodic task function during auto. I highly recommend doing the global Boolean method, after reading the posts before this.
__________________
VEX & FRC Student Team Member #357 Royal Assault 2010-2014 "Dare Mighty Things"
2014-2019 Attending Drexel University Major:Electrical Enginnering

Last edited by Kevin Phan : 30-03-2014 at 22:07.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-03-2014, 22:12
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: Autonomous timing of events are to fast

Quote:
Originally Posted by grosh View Post
How do I fix this so they do not conflict with eachother?
There are better ways to integrate Periodic Tasks actions with Autonomous, but you'd have to completely revamp how you do things, and now is probably not the time to do that. The "cheap" fix is actually pretty easy:

Instead of setting the motor itself in your Autonomous sequence, set a global variable. Where the Periodic Tasks case is setting the motor value to 0, set it instead to the value of that global variable.
Reply With Quote
  #4   Spotlight this post!  
Unread 30-03-2014, 22:48
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Autonomous timing of events are to fast

Thanks again for helping.

I've never used global data before so I watch a youtube video. I think I added the global variables, but don't have access to the robot to check. I've attached screenshots with the changes I've made. Could you check to see if I've added them correctly?
Attached Thumbnails
Click image for larger version

Name:	set global.PNG
Views:	16
Size:	10.7 KB
ID:	16706  Click image for larger version

Name:	periodic task.PNG
Views:	13
Size:	15.6 KB
ID:	16707  Click image for larger version

Name:	autonomous.PNG
Views:	13
Size:	47.8 KB
ID:	16708  Click image for larger version

Name:	global data.PNG
Views:	17
Size:	20.1 KB
ID:	16705  
Reply With Quote
  #5   Spotlight this post!  
Unread 30-03-2014, 23:33
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: Autonomous timing of events are to fast

Quote:
Originally Posted by grosh View Post
Could you check to see if I've added them correctly?
I don't understand what your "read global variable" loop is intended to do. It's going to be continuously overwriting the global with the current motor value, which is likely to interfere with anything else trying to write the global. If that loop was newly added as part of implementing the global variable, remove it.

There is nowhere I can see that actually sets the motor value. You replaced the spot in Periodic Tasks where that was being done with another global variable write, where all you needed to do was replace the constant 0 with a read of the variable. The only places that should be writing the global are what used to be setting the motor value in the autonomous sequence.

I also don't see why you added a rearMotors global. Was something interfering with it as well?
Reply With Quote
  #6   Spotlight this post!  
Unread 05-04-2014, 20:09
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Autonomous timing of events are to fast

I cleaned up and attached the code with corrections. I can't check the code on our robot until district championships, so I am relying on your feedback to get this running.

Thanks again!
Attached Thumbnails
Click image for larger version

Name:	periodic task.PNG
Views:	6
Size:	15.5 KB
ID:	16774  Click image for larger version

Name:	auto.PNG
Views:	8
Size:	50.2 KB
ID:	16773  
Reply With Quote
  #7   Spotlight this post!  
Unread 05-04-2014, 22:03
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Autonomous timing of events are to fast

Why do you have the driver station writing a value to the frontMotors, my interpretation from Alan is to write your frontMotor global values from the periodic task to your motors. You can still have your driverstation determine what the value of the frontMotors.
__________________
VEX & FRC Student Team Member #357 Royal Assault 2010-2014 "Dare Mighty Things"
2014-2019 Attending Drexel University Major:Electrical Enginnering
Reply With Quote
  #8   Spotlight this post!  
Unread 05-04-2014, 22:09
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Autonomous timing of events are to fast

We read from the driver station so that it is easy to tune the motors for a shot. Will it not work this way? Our shot was fairly consistant in our last district event and can set it in the global. Do I need to do this to make the global work? I'm new to globals.

Last edited by grosh : 05-04-2014 at 22:23.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-04-2014, 22:26
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Autonomous timing of events are to fast

Edit: I think I'm reading your code wrong. Your frontMotor values are suppose to be set in periodic task and you're doing something that I can't see in auto, correct. The code is fine. Sorry for the confusion.
__________________
VEX & FRC Student Team Member #357 Royal Assault 2010-2014 "Dare Mighty Things"
2014-2019 Attending Drexel University Major:Electrical Enginnering

Last edited by Kevin Phan : 05-04-2014 at 22:32. Reason: Misinterperrtation
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 08:48.

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