Go to Post This is how students can be inspired! - Rich Wong [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 08-03-2016, 19:48
chubchub5577 chubchub5577 is offline
Registered User
FRC #1802
 
Join Date: Nov 2015
Location: Kansas City, Kansas
Posts: 17
chubchub5577 is an unknown quantity at this point
Limit Switches

I have code with two limit switches to move up or down a PG71. That motor is on a slide and when I hit the up button it'll go up. when I hit the down button nada. But when I physically hit the bottom limit switch the motor will move up until let go. once the top one is hit the motor is stuck until I move it off of the limitswitch and I physically move it down because my button does not work. Pictures down below thanks for any help!
__________________
Team Stealth 1802 Kansas City, Kansas
Lead Programmer
Team Ambassador
Financial Director
Tempus Fugit!!

Last edited by chubchub5577 : 08-03-2016 at 19:50.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-03-2016, 22:12
Hitchhiker 42's Avatar
Hitchhiker 42 Hitchhiker 42 is offline
Roboter
AKA: Mark Lavrentyev
FRC #4557 (FullMetal Falcons)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Cromwell, CT
Posts: 471
Hitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to behold
Re: Limit Switches

I think your issue is with the in range/coerce towards the right of the code. You might want to see about replacing that with a T/F select (like the ones in it already) to choose between the three values. Have it so that "if limit_bottom true, give 0 for down, give 1 for up (if pressing)".
__________________



2016 - NE District Championship Entrepreneurship Award
2016 - Hartford District Industrial Design Award
2016 - Waterbury District Engineering Inspiration Award
Reply With Quote
  #3   Spotlight this post!  
Unread 08-03-2016, 23:36
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 243
BitTwiddler is on a distinguished road
Re: Limit Switches

I think your logic of using the coerce function is very clever. However I think you want a constant of -1 for the lower limit switch coerce function to allow the motor to go up.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-03-2016, 23:46
Eryl2000's Avatar
Eryl2000 Eryl2000 is offline
Registered User
FRC #3024 ("My Favorite Team")
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Ashland, OR
Posts: 3
Eryl2000 is an unknown quantity at this point
Re: Limit Switches

Hi,
Let me see if I have this correct. You are currently for a lift up/down command, setting a value of +/-1, and then trying to correct that value depending on whether the limit switch on the top/bottom is pressed.

I would recommend a different approach. After getting a command to lift, check first if the limit switch is pressed. if it is, do nothing; if it is not, assign the correct +/-1 depending on lift direction.
Hope this helps.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-03-2016, 00:18
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,112
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: Limit Switches

I think your problem is the values going to the bottom range input of the In Range and Coerce function. The select function controlled by the TuskBottomStop switch will give it either 0 or 1, which will keep the motor from ever going down, and will force the motor to go up when the switch is pressed.

Try changing the 1 to a -1 instead.
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 03:48.

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