Log in

View Full Version : Switch


DarthMaulCIS
10-02-2014, 18:35
So my team may or may not use a switch to stop our winch.
I think it would use Digital Input/Digital Output vis, but I don't know.
Help please?

Mark McLeod
10-02-2014, 18:48
That depends on where the switch is (on robot or on the Driver Station).

A limit switch on the robot that stops the winch would connect to a Digital Input.

Here are two examples of using Linit Switches:
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/LimitSwitch2.jpg

DarthMaulCIS
10-02-2014, 18:52
That depends on where the switch is (on robot or on the Driver Station).

A limit switch on the robot that stops the winch would connect to a Digital Input.

Here are two examples of using Linit Switches:
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/LimitSwitch2.jpg

How would the left one work?

Mark McLeod
10-02-2014, 18:58
The left one just checks to see IF the driver joystick is ordering forward motion AND the limit switch in that direction is being depressed, THEN make the power to the motor =0.

If the motor is moving away from the limit switch or the limit switch hasn't been hit, then it's safe to let the motor do what the driver ordered.

DarthMaulCIS
11-02-2014, 16:20
The switch would need to make a motor stop and then a pneumatic to extend when it is pressed. Would I just remove the joystick and axis bits from that code?

Mark McLeod
11-02-2014, 16:59
You can remove the Joystick as long as you have something telling the motor to move and how fast. It could be triggered in a sequence, for instance.

As far as triggering pneumatics when the switch gets depressed, you could set that up as a completely separate action -- If limit switch, then set solenoid.

But it all depends on how you want to reverse or reset these actions.

It sounds like you might want this to be a sequence of steps in Periodic Tasks.

DarthMaulCIS
11-02-2014, 17:04
Periodic is exactly where I was going to put it. What vi would a limit switch be?

Mark McLeod
11-02-2014, 23:49
Limit switches are Digital Inputs.

WPI Robotics Library -> IO -> DigitalInput
Get returns a true or false.