|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||||
|
|||||
|
Re: Autonomous timing of events are to fast
Quote:
Quote:
Show us your Begin vi and we can make a better judgement of where your problems might lie. |
|
#3
|
|||
|
|||
|
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... |
|
#4
|
|||||
|
|||||
|
Re: Autonomous timing of events are to fast
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.
|
|
#5
|
|||
|
|||
|
Re: Autonomous timing of events are to fast
attached is the periodic task code that works when a button is pressed
|
|
#6
|
|||||
|
|||||
|
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.
|
|
#7
|
|||
|
|||
|
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. Last edited by grosh : 25-03-2014 at 09:31. |
|
#8
|
|||||
|
|||||
|
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. |
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
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? |
|
#11
|
||||
|
||||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|