Go to Post We are not here to build robots, or to win a contest, or to travel to cool places or to bring home trophies. we are here to see what a career in engineering and science is like; anything else that happens along the way is frosting on the cake - KenWittlief [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 06-03-2010, 17:24
I am error's Avatar
I am error I am error is offline
The Error
FRC #0686 (Bovine Intervention)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Frederick
Posts: 20
I am error is an unknown quantity at this point
Exclamation How to automate between extending and retracting of cyinders

Hi all,
We are using pneumatics to arm our and release our kicker. I want to automate the process where once a button is pressed a cylinder is retracted (i know how to program a solenoid) to fire, then autonomously two different cylinders extend to grab the kicker and pull back to rearm the kicker. My question is how to automate the process. Thanks for any help.
__________________
I am Error. Yes.

Reply With Quote
  #2   Spotlight this post!  
Unread 07-03-2010, 09:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to automate between extending and retracting of cyinders

Quote:
Originally Posted by I am error View Post
Hi all,
We are using pneumatics to arm our and release our kicker. I want to automate the process where once a button is pressed a cylinder is retracted (i know how to program a solenoid) to fire, then autonomously two different cylinders extend to grab the kicker and pull back to rearm the kicker. My question is how to automate the process. Thanks for any help.
Set up a state machine with different states, for example:

- ready to fire

- firing

- arming

... and cycle through the states. (You may need additional states for delays or limit switch events depending on your design)

See the LVMastery video on state machines.



~
Reply With Quote
  #3   Spotlight this post!  
Unread 07-03-2010, 16:13
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,113
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: How to automate between extending and retracting of cyinders

If it's always going to be the same automated tasks in the same order with the same timing, and if you're never going to want to control any of the same actuators manually at the same time, there's another way to do it that might be simpler. Add a parallel task (you can put it in the Periodic Tasks vi) that consists of a never-terminating while loop. Inside that loop, use a flat sequence with each step of the process in its own frame alongside an appropriate delay. In the very first frame, put a while loop that terminates only when a global variable is set true. Set that variable false again in the very last frame. In your main code, whenever the automatic sequence is needed, set that global variable true and the parallel task will do its thing.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-03-2010, 16:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to automate between extending and retracting of cyinders

Quote:
Originally Posted by Alan Anderson View Post
If it's always going to be the same automated tasks in the same order with the same timing, and if you're never going to want to control any of the same actuators manually at the same time, there's another way to do it that might be simpler. Add a parallel task (you can put it in the Periodic Tasks vi) that consists of a never-terminating while loop. Inside that loop, use a flat sequence with each step of the process in its own frame alongside an appropriate delay. In the very first frame, put a while loop that terminates only when a global variable is set true. Set that variable false again in the very last frame. In your main code, whenever the automatic sequence is needed, set that global variable true and the parallel task will do its thing.
Alan's approach is certainly simpler at the human interface level, which is a big plus, and therefor highly desirable for some teams. But it is more complex for the computer (basically the idea is to let the underlying RTOS - Wind River - work its magic and handle the necessary multitasking). However, since the cRIO is so powerful, that concern is minimal (for what we're doing anyway).

Greg, if you are reading, could you please comment on how the RTOS handles a parallel task which is doing nothing but cycling in a while loop waiting for a global boolean to change state? Is the RTOS smart enough to reduce that task's time slice so as not to waste processing resources?

~
Reply With Quote
  #5   Spotlight this post!  
Unread 07-03-2010, 21:24
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How to automate between extending and retracting of cyinders

Quote:
Is the RTOS smart enough to reduce that task's time slice so as not to waste processing resources?
The LV loop and OS will do what the diagram requests. It is important for the programmer to insert a delay into the loop using a Wait or other notification node, or the loop will always need to run. The loop will then be scheduled by the OS along with all other active tasks.

As long as the number of globals used to trigger parallel tasks stays small and the polling rate is kept in check, I feel OK recommending their use, but they are certainly not the best notification mechanism. Once you are looking for something new to learn, feel free to look at the other notification mechanisms. The RT FIFO gives lots of control and is the more deterministic choice. Others include the Notifier, Semaphore, Rendezvous, Queue, and the Occurrence. These provide non-polling, more event-driven mechanisms to coordinate multiple tasks.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 08-03-2010, 00:20
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,113
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: How to automate between extending and retracting of cyinders

An Occurrence would be a much better choice than a continuously-polled global variable. There are a few reasonable ways to create it and pass it to both Teleop and the sequence task; I would probably create it in Begin and wire it to a global variable for use elsewhere.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retracting a cylinder? greatman05 Pneumatics 5 11-02-2010 15:24
Data delay between Crio and DS Tom Line NI LabVIEW 9 17-02-2009 08:40
how to generate P.W.M pulse between 0-100 d.c yossi56 Programming 3 01-03-2008 14:15
How do I get distance between Camera and the target? sjung9442 Programming 5 27-01-2006 09:44
Retracting power wiring ? mdatkins Electrical 5 09-02-2005 07:50


All times are GMT -5. The time now is 22:03.

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