![]() |
Programming a limit switch for two buttons
We have two buttons that allow the arms of our robot to move up and down a shaft. One moves up, and one moves down. How to we implement a limit switch so that the arms do not move too far down or too far up?
I've seen the examples from team 358, but they haven't been of much help. I really don't know what to put into the begin vi or the telop(if that's even where it goes). How does the limit switch know when to stop? How to I put in a limit switch for code that already deviates between -1 and 1? Do I have to use an encoder to determine the rpm? Thank you for any help you can give us :) |
Re: Programming a limit switch for two buttons
Tell us more about your setup, e.g.,
|
Re: Programming a limit switch for two buttons
And...which programming language are you using?
|
Re: Programming a limit switch for two buttons
Quote:
|
Re: Programming a limit switch for two buttons
I need to put a postit on my monitor to check that.
|
Re: Programming a limit switch for two buttons
Check the find examples page under help in labview. It will give you the code for seeing if a limit switch is true or false. After you are able to read the switch think about using a select statement and a case structure to achieve you desired outcome.
|
Re: Programming a limit switch for two buttons
Quote:
Teleop.vi gets pretty much everything else, starting with a RefNum Get (with an outgoing arrow) connected to either a Get or a Set, depending on whether you're reading a sensor or controlling an actuator. |
Re: Programming a limit switch for two buttons
2 Attachment(s)
Quote:
A limit switch is simply a switch that is engaged as a moving part reaches (or approaches) the design limit of its range of motion. There are a wide variety of designs; click the link to see a nice sample. Programming and wiring to take advantage of a limit switch is rather simple - you just have to make sure that when the limit switch is engaged, any attempts to move the actuator in that direction are nullified. You still want to allow motion away from that limit, otherwise the actuator will be unusable. The real key to making a limit switch work well is in selection, placement, and mounting, so that it consistently and reliably knows when to stop. As you will probably notice, many of the limit switch designs feature a rather long arm which is in contact with the switch button somewhere near its fulcrum. This is because you don't want the switch receive the force of the moving actuator, just report it. Often, the switch body is mounted beside the actuators path, not in the path. Alternately, the limit switch can be mounted inside/behind the mechanical stop so that only the plunger or arm reach into the path of the load. Selecting a style and mount for a limit switch is best approached creatively. I'll spend the rest of this post in a litany of examples; perhaps one of them will inspire you. There are also two examples shown in the attached images. Our robot this year has twelve limit switches, in three distinct styles:
Around the house and car:
|
Re: Programming a limit switch for two buttons
This is what our limit switch looks like: https://encrypted-tbn3.gstatic.com/i...r0xYWMp2FzsgSw
We have one at the top of our robot that becomes closed when the arms hit it. We may or may not add one to the bottom of the robot for the same effect. We are using talon via PWM. The arms are controlled to go up and down with two separate buttons on a PS3 controller. We are using labview. We haven't tested anything with the limit switch since we've not been able to complete the programming. The main problem is that we can't figure out how to combine the examples titled switch and limit switch. One appears to show both the begin and teleop stages, but the other only show teleop. We can't figure out how to allow our motor to stop when the switch is true. |
Re: Programming a limit switch for two buttons
Quote:
|
| All times are GMT -5. The time now is 10:25. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi