Go to Post When FIRST teams are as numerous and as well supported as basketball teams, we will know that our culture is preparing young people to compete in the 21 st century and we are spending our 2 million minutes wisely. - N7UJJ [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 16-02-2009, 00:05
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: coding for limit switch

Instead of forcing the motor to run for "a while" when a limit switch is tripped, you can just use the switch to keep the motor from going any further in the wrong direction. Don't worry about moving it away, just worry about keeping it from going past the limit.

The typical way to do this is to splice into the speed control value. Set it to zero if one limit switch is active and the incoming value is positive, or if the other switch is active and the value is negative. This will stop the motor as it drives into the limit, and you can rely on other signals to drive the motor back.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2009, 01:14
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: coding for limit switch

If you do just stop when you hit the limit switch,your PID will probably generate a significant amount of error for a relativley long period of time. If you're using the error amount to perform hardware diagnostics(like we did last year), this could cause false positives
__________________
Get yer robot source code here!
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
limit switch solomason519 Programming 9 09-02-2010 08:50
What is the essay for the Limit Switch? reader_girl932 Kit & Additional Hardware 0 11-02-2008 16:55
Using a limit switch to limit motion ManicMechanic Programming 16 20-12-2007 00:54
Limit Switch for PCM GeorgeC Programming 4 16-02-2007 13:21
limit switch wedellm Electrical 4 16-02-2007 13:01


All times are GMT -5. The time now is 21:34.

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