Go to Post It sounded like a good idea, and then I thought about it. :-/ - Wetzel [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 05-02-2012, 17:17
jwatson12 jwatson12 is offline
Mr. Watson
FRC #1025 (Impi Warriors)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Michigan
Posts: 17
jwatson12 is an unknown quantity at this point
Programming loop for limiter swith

Hi All:

We are working with a slingshot solution that is tied to a motor control. The motor only needs to turn in one direction. The tensioner that winds back our slingshot will automatically release or fire if there is no way to stop the action unless we stop pressing the button. So, we are programming a swith that will be triggered to tell the motor to stop just short of firing. The puzzle here is that the switch must be triggered twice before stopping the motor before re-firing.

Once the driver presses the trigger button, the ball should fire, then automatically recoil, count two switch counts and stop. Then fire next time the same button is pressed.

Any ideas? Thanks in advance!
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2012, 18:34
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: Programming loop for limiter swith

Try setting the switch input as a Counter in LabVIEW. Then you can stop the motor when its value reaches 2. Use a press of the joystick button to start the motor and reset the counter to zero when you want to fire again.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2012, 18:58
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming loop for limiter swith

Here's another way to keep count.
Attached Thumbnails
Click image for larger version

Name:	Count.png
Views:	76
Size:	15.9 KB
ID:	11744  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2012, 13:47
jwatson12 jwatson12 is offline
Mr. Watson
FRC #1025 (Impi Warriors)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Michigan
Posts: 17
jwatson12 is an unknown quantity at this point
Re: Programming loop for limiter swith

Thank you for your responses! I am looking for the controls in the function palette to call out the counters but do not see anything that resembles the count and keep count objects from the example. Where would I find this?
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2012, 16:38
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: Programming loop for limiter swith

Mark's example uses feedback nodes (they're in the programming subpalette). If the switch stays active for a long enough time, what he suggests will work. If the switch is just a very brief contact that might get missed between loops of the code, you should definitely use the FPGA counter.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2012, 08:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming loop for limiter swith

I tend to use polling for slow sensors like mechanical limit switches. It helps debounce them to sample at the 20ms Teleop rate (or greater in Periodic Tasks). Mechanical switches tend to flicker a little as they are engaging and can produce phantom counts if your data acquisition is too fast.

The Counters are a necessity for fast sensors, like a light sensor watching a spinning shooter wheel.
Be aware there have been some issues reported with Counters that haven't been tracked down, so test the application if you use them. If they pass a test they should be fine.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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 22:30.

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