|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Limit Switch help
So we programmed the limit switch and wired it correctly. It works, but we were wondering if you can override the limit switch after it's been pressed? For an example, motor spins and limit switch is pressed then motor stops, we press the shoot button again and the motor moves past the limit switch and makes another complete rotation until resting on the limit switch again.
Thanks team 2883 ![]() |
|
#2
|
|||
|
|||
|
Re: Limit Switch help
I don't see any physics-breaking issues with this.
The "overriding" of the limit switch would just be a coding exercise of temporarily ignoring the limit switch value. Whether the limit switch would be able to deal with the actuator moving past it without breaking the switch is another question. If you are dead set on doing this, I would highly encourage you to make sure the actuator can clear the switch without damaging the switch and to make sure the switch would still work correctly after doing so. I do think there is probably a better method of controlling your actuator that this, though. Moving anything past a limit switch is just asking for trouble. |
|
#3
|
||||
|
||||
|
Re: Limit Switch help
In your specific request, I would suggest that you look into implementing a State-Machine. You would create an enum that would have all the states your shooter would be in. For grins, the states I would use would be: Begin, Ready (Unloaded), Firing and Ready (Loaded). You would then feed the enum into a case structure so the robot will do something different in the states and the states could move the code to the next state.
To see this concept in action, here is a link to video on how to create a simple state machine for lifting a ball on FRCMastery: http://www.frcmastery.com/labview-fo...tate-machines/ The idea would be you would set your Ready-Loaded state to perhaps ignore the status of the limit switch so you can press the fire button and it will go. Hope this points you in the right direction! |
|
#4
|
|||||
|
|||||
|
Re: Limit Switch help
Boss,
If you are using a limit switch on a Jaguar input, then the answer is no. (Although if you are using CAN, you may be able to fudge something to ignore the limit.) If you are using an external limit switch sensed by the DIO then you can choose to override in software. If you are using CAN please let us know so that someone more familiar with the CAN implementation can answer. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|