Go to Post While those ideals might exist in black and white perfection; in the real world, with very rare exception, they can only be implemented as compromises in shades of gray. - gblake [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 02-02-2014, 15:32
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Limit Switch Programming Help

Hi Guys,

We are building a catapult mechanism to shoot the ball and to set the position of the catapult to ready to shoot, we are using a limit switch. I want the program to run 2 motors until the limit switch is on while i'm pressing a button on joystick, so the catapult will stop itself when it's stretched enough.

I wrote this in teleop, but it didn't work. Where am i wrong? I wrote their begin and finish parts as well.

Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2014, 15:39
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Limit Switch Programming Help

Are you by any chance using Jaguars? You could always wire your limit switch directly to the inputs on the Jaguar itself and let it do all the work.

On the other hand, how is your limit switch wired? Remember that the Digital Sidecar inputs are always pulled high until you pull them low. Wire your limit switch with the signal wire going to COM and the negative wire to the NO terminal.

With this wiring, you will also need to switch your comparison values (switch the 0 and 1) so that when the switch is pressed (goes false) it will stop your motors
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2014, 18:23
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: Limit Switch Programming Help

Quote:
Originally Posted by eren96 View Post
I wrote this in teleop, but it didn't work. Where am i wrong?
You say it didn't work. What did it do instead of what you wanted?

Are you sure your limit switch is giving you True and False values in the direction you expect? Use the Test mode and view the switch's value on the Dashboard to see what it really does.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2014, 16:58
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: Limit Switch Programming Help

Quote:
Originally Posted by Cecil View Post
Are you by any chance using Jaguars? You could always wire your limit switch directly to the inputs on the Jaguar itself and let it do all the work.

On the other hand, how is your limit switch wired? Remember that the Digital Sidecar inputs are always pulled high until you pull them low. Wire your limit switch with the signal wire going to COM and the negative wire to the NO terminal.

With this wiring, you will also need to switch your comparison values (switch the 0 and 1) so that when the switch is pressed (goes false) it will stop your motors
I don't use Jaguars as motor controllers. I wired the white wire to the NC and black wire to the COM and wired the other side of the PWM cable directly to the one of the DIO s on the Digital Side Car, but i have still problems with that.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2014, 17:01
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: Limit Switch Programming Help

Quote:
Originally Posted by Alan Anderson View Post
You say it didn't work. What did it do instead of what you wanted?

Are you sure your limit switch is giving you True and False values in the direction you expect? Use the Test mode and view the switch's value on the Dashboard to see what it really does.
When I press the button, motors move for a moment and then stops. The movement isn't continous as I press the button. How can I use the test mode to test this? Do I need to edit the Test VI ?
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2014, 18:05
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: Limit Switch Programming Help

Where have you put this code (Teleop, Periodic Tasks)?

What does your Begin look like for creating the motor?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2014, 21:26
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: Limit Switch Programming Help

The code you posted looks okay. Is there somewhere else in the program that might be continually turning off your winch motors, like in Periodic Tasks? Is the case input connected directly to a joystick button, or is there some other processing before it reaches the case?

Is your motor wiring correct, with both motors turning in a direction that doesn't make them fight each other? Install only one winch motor circuit breaker and try running it, then remove that breaker and install one on the other winch motor. Do the motors run as expected one at a time?
Reply With Quote
  #8   Spotlight this post!  
Unread 06-02-2014, 10:07
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: Limit Switch Programming Help

Quote:
Originally Posted by Alan Anderson View Post
Is there somewhere else in the program that might be continually turning off your winch motors, like in Periodic Tasks?
This sentence solved my problem.

Not in Periodic Tasks, but in Teleop I was controlling those motors with one more button as well. I solved this by combining two case. So now, when i m not pressing that button, the motors aren't set themselves to 0 value.

Thanks for your help.
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 21:04.

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