|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Limit Switches
Once you get past the opening and getting of the value of the switch, there's a bit of boolean mess to get it so it will work. Just using a single select won't quite do (unless you use an AND statement to check if the motor is actually trying to go past the limit and not away from it), as it will shut down the motor permanently unless something physically knocks the motor from pressing the switch.
|
|
#2
|
||||
|
||||
|
Re: Limit Switches
I used a case select on an "In Range and Coerce" block where the upper and lower limits are set by case statements controlled by a digital input and the input is the motor speed, assuming the motor is run by a speed controller.
For example, the upper limit would be 1. When the switch is tripped, the upper limit becomes 0, thus preventing the motor from driving in that direction. The lower limit would be -1 until the switch is tripped and the lower limit is set to 0. Last edited by ebmonon36 : 03-03-2009 at 18:05. |
|
#3
|
|||||
|
|||||
|
Re: Limit Switches
I like it.
I would use boolean selectors instead of case blocks. I also suggest turning the whole chunk of limit switch logic into a subVI. It would act just like a regular motor control VI, but with a pair of limit switch inputs added. |
|
#4
|
|||
|
|||
|
Re: Limit Switches
We ran into a little stumbling block. Well, it's pretty much what gwytheyrn described. We tried programming a case structure so that it rotated away from the switch when it recieved a value, but that did absolutely nothing, so we're stuck.
|
|
#5
|
||||
|
||||
|
Re: Limit Switches
Read post # 8 in this thread. I uploaded a vi. that works just fine. You will need to modify the inputs to point to your switches. Also, verify that the ccw and cw limits are correct for your wiring, if not swap the two values.
|
|
#6
|
||||
|
||||
|
Re: Limit Switches
Did you try looking at the values on the relevant wires in debug mode so you could see whether the problem was how you had built your case or the values heading into it?
You can either click the lightbulb to highlight execution all the way through (which will really bog down the CRIO's response time), or you can click on a specific wire or wires with the code running to get a popup with the current value (runs a lot closer to normal speed). |
|
#7
|
|||
|
|||
|
Re: Limit Switches
I strongly suggest trying the method in post number 4, as it is quite an elegant way to program for this, imho. Dunno about billbo's post; I don't have labview on this computer, but I guess it works in a similar fashion
|
|
#8
|
||||
|
||||
|
Re: Limit Switches
From a cursory reading of ebmonon36's post, it sounds exactly like what I posted in the vi. It is simple and quite effective. We used this exact method, except the limit switches were replaced with comparators coming off a pot, to limit the travel of our turret this year.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limit Switches | popnbrown | NI LabVIEW | 1 | 10-02-2009 22:39 |
| Limit switches(in C++) | beefy1 | Programming | 3 | 24-12-2008 15:27 |
| Limit Switches | ChrisR_522 | Programming | 2 | 25-01-2008 08:04 |
| limit switches | stephenthe1 | Programming | 28 | 11-05-2005 16:37 |
| Limit switches | Team168 | Programming | 8 | 10-02-2003 16:22 |