Go to Post Everyone needs to start working with what they are given, and start appreciating FIRST, not complaining about what they think FIRST is doing wrong. - Marygrace [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 24-03-2014, 23:28
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
Autonomous timing of events are to fast

In auto we want to 1)move forward for two seconds, 2)stop driving and spin up our shooter motors for a couple of seconds, 3) then retract a pair of cylinders with shooter motors still spinning with about a second wait to make sure the cylinders have fully retracted, 4) and finally stop the shooter motors and extend the cylinders. see attached code

We use a stacked sequence to complete these tasks. It drives forward for 2 seconds just fine. The PROBLEM... in the seconds step the shooter motors (frontMotor and rearMotors) start for a split second and stop. Then after about the two seconds the cylinders (frontliftCylinder and rearliftCylinder) retract for a split second and then extend.

Why are the shooter motors and cylinders only acting for a split second in sequence 2 and 3?
Attached Thumbnails
Click image for larger version

Name:	autonomous.jpg
Views:	76
Size:	88.3 KB
ID:	16650  
Reply With Quote
  #2   Spotlight this post!  
Unread 24-03-2014, 23:58
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
... in the seconds step the shooter motors (frontMotor and rearMotors) start for a split second and stop.
Did you enable the motor safety on those two motors? If you did, that will shut the motors off if you don't constantly set their values at least every 100 milliseconds. The safety is off by default on non-drive motors, and there's usually not a good reason to turn it on.

Quote:
Then after about the two seconds the cylinders (frontliftCylinder and rearliftCylinder) retract for a split second and then extend.
Are the lights on the Solenoid module turning on for the appropriate amount of time, with the cylinder itself just taking a while to respond? Or do the module's lights also act for only a split second?

Show us your Begin vi and we can make a better judgement of where your problems might lie.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-03-2014, 00:10
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 did not enable the motor safety.

The solenoid lights turn on only for a slight second also.

We use the same sequences 2 and 3 in periodic tasks during teleop and it works fine.

I've attached a picture of our Begin VI.

Thanks for helping...
Attached Thumbnails
Click image for larger version

Name:	begin VI.PNG
Views:	43
Size:	23.0 KB
ID:	16651  
Reply With Quote
  #4   Spotlight this post!  
Unread 25-03-2014, 00:16
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
We use the same sequences 2 and 3 in periodic tasks during teleop and it works fine.
Periodic Tasks also runs during Autonomous. It might well be turning things off immediately after your autonomous code turns them on. If you don't understand what to look for, post your Periodic Tasks vi and we can help you check for conflicts.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-03-2014, 00:22
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

attached is the periodic task code that works when a button is pressed
Attached Thumbnails
Click image for larger version

Name:	shooter button.PNG
Views:	39
Size:	24.7 KB
ID:	16652  
Reply With Quote
  #6   Spotlight this post!  
Unread 25-03-2014, 01:51
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

I don't see where you're turning off the motors or setting the solenoids back to Forward. If that's being done in the False case, as I suspect, then we've found your problem. Before I start giving suggestions, I would like to verify my suspicions. Can you post the actual vi, and not just a screen capture of it? If you don't want to share your entire Periodic Tasks, least give us a vi snippet of the relevant loop.
Reply With Quote
  #7   Spotlight this post!  
Unread 25-03-2014, 09:26
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

Alan- you are correct. Our false case, in Periodic Tasks, turns the motors off and sets the solenoids forward. So, are you suggesting we should turn motors off and set the solenoids forward in the true case of the Periodic task? Then deleting these actions in the false case of the Periodic Tasks.

attached is the Periodic Task VI and a screen capture...Please make any suggestions as to how to improve our code. Everything we know we have learned through CD. Learning code this way is kind of like learning calculus through youtube. We can usually make it work, but we're not so efficient at it.
Attached Thumbnails
Click image for larger version

Name:	shooter button- false.PNG
Views:	17
Size:	16.2 KB
ID:	16654  
Attached Files
File Type: vi Periodic Tasks.vi (53.8 KB, 3 views)

Last edited by grosh : 25-03-2014 at 09:31.
Reply With Quote
  #8   Spotlight this post!  
Unread 25-03-2014, 11:16
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

Moving the things out of the False case and into a final frame of your sequence should work. That'll make it stop interfering with the auto code.

But I have a different suggestion. Since your Periodic Tasks code works properly, why not just make use of it in Autonomous as well? I'd add a boolean global variable and OR it with the joystick button into the Case block. To fire the sequence in Autonomous mode, just set the variable True for a half second, then set it back False, to simulate someone pressing the button. That way you don't have the same function duplicated in multiple places, and if you ever want to change how the firing sequence works there is exactly one place to do it.
Reply With Quote
  #9   Spotlight this post!  
Unread 25-03-2014, 23:17
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

Works!!! I delete the code in the false case and added a sequence to the code in the periodic tasks.

Also, thanks for the suggestions of using global variables. I'm not going to try this before this weeks competition, but will play with them in the off season.

Thanks again!

Last edited by grosh : 25-03-2014 at 23:28.
Reply With Quote
  #10   Spotlight this post!  
Unread 30-03-2014, 21:39
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

Help again!? We have another similar issue with the frontMotor not running in autonomous. The frontMotor twitches but does not stay on. I believe it is because in periodic tasks we have the frontMotor set to turn off in a false case. (see attached) I believe like before telling the frontMotor to be zero in periodic tasks is interfering with the frontMotors turning on in autonomous...true?

How do I fix this?
Attached Thumbnails
Click image for larger version

Name:	autonomous.PNG
Views:	12
Size:	45.1 KB
ID:	16702  Click image for larger version

Name:	intake-periodic tasks.PNG
Views:	13
Size:	19.9 KB
ID:	16703  
Reply With Quote
  #11   Spotlight this post!  
Unread 30-03-2014, 21:44
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

Is there a button press that executes the case structure? Since you can't press the button during auto and periodic runs at the same time as auto the two will conflict.
__________________
VEX & FRC Student Team Member #357 Royal Assault 2010-2014 "Dare Mighty Things"
2014-2019 Attending Drexel University Major:Electrical Enginnering
Reply With Quote
  #12   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
  #13   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
  #14   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
  #15   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:	global data.PNG
Views:	17
Size:	20.1 KB
ID:	16705  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  
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 04: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