|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Programming Autonomous pneumatic kicker
Quote:
Let's use the kicker as an example. State 1: Precharge Kicker State 2: Wait for "Fire" signal. Release kicker. State 3: Wait .5 sec. for kick to complete. State 4: Retract kicking mechanism. State 5: Wait for retraction to complete. State 6: Latch mechanism. Return to state 1. The best advice I can give at this point is to visit http://www.lvmastery.com/tipjar It will teach you all you need to know to start building state machines. (This is not a paid advertisement for LVMastery.com) I'm attaching an example vi. You will also need to create the DevRefNum's in the begin.vi. Last edited by billbo911 : 03-03-2010 at 11:46. Reason: Added Kicker State Machine.vi |
|
#2
|
|||
|
|||
|
Re: Programming Autonomous pneumatic kicker
I am trying to make a very similar state machine kicker myself.
My problem is this: Say you tell your program to "wait" in a particular state for two seconds while a piston extends... I would expect the rest of your program to "freeze" for two seconds while that state machine code waits to execute. We want to be able to continue driving around and entering comands while our ball kicker state machine does its thing. |
|
#3
|
||||
|
||||
|
Re: Programming Autonomous pneumatic kicker
Quote:
Last edited by billbo911 : 06-03-2010 at 21:48. |
|
#4
|
||||
|
||||
|
Re: Programming Autonomous pneumatic kicker
Hi,
I tried you example, changed everything around and put it in the main vi, but it did not function properly and i could not drive my motors in teleop. I'm trying to make so that when a button a latch is released by a piston retracting to fire a kicker from the default, then two pistons extend to reach the kicker and the latch piston extends to grab the kicker. Then the two pistons retract to rearm the device and the cycle repeats. I tried to implement that to your example but with no luck and also while running I could not drive the motors on the robot. Thanks for any help. |
|
#5
|
|||
|
|||
|
Re: Programming Autonomous pneumatic kicker
You can of course do what you want with your code, but the framework gave you places to put code so that you wouldn't need to modify Robot Main.
Any code that you put into TeleOp or the Robot Main loop needs to finish within 20ms or it will start to affect the joystick code handling. This can be done provided you write the code to retain when something started and do time comparisons to determine when to move to the next kicker stage, note that time, etc. OR You can write the code with delays, but put that code into a parallel loop such as Periodic. Then in teleOp, you read the joystick and other stuff and if the conditions are right, you trigger a kick by setting a global. In periodic, you poll the global and start the sequence. At the end of the sequence, you clear the global. Greg McKaskle |
|
#6
|
||||
|
||||
|
Re: Programming Autonomous pneumatic kicker
Quote:
You can put such a state machine in teleop along with other state machines and they will all peacefully coexist - i.e. they will all appear to execute "simultaneously", since none of them contain any code that "freezes" the processor waiting for time to elapse. ~ |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Team 1522's pneumatic kicker | kornjones | Robot Showcase | 0 | 15-02-2010 20:59 |
| pic: Pneumatic Kicker Rev_0 preparing to fire | professor1212 | Extra Discussion | 5 | 18-01-2010 00:31 |
| pic: Pneumatic Kicker Rev_1 | professor1212 | Extra Discussion | 6 | 17-01-2010 23:07 |
| pic: Pneumatic Kicker Rev_0 | professor1212 | Extra Discussion | 0 | 17-01-2010 01:15 |
| pneumatic programming | stephenthe1 | Programming | 5 | 16-02-2006 12:01 |