What function(s)/structure(s) would I use to stop a motor?
After hitting a limit switch, I want the motor to "brake": I want it to stop, but still give resistance, and disable the control to move in that direction.
Here's what I have so far.
I want Button 4 to be disabled after hiting the limit switch, and at the same time "freeze/lock" the motor in place.
How much force is going to be on the motor? If there is a low load you could simply stop the motor once the limit switch is enabled. If there is going to be a large load on the motor and you have an encoder you can set the motor to stop once the limit switch is enabled. You could then measure the position of your motor angle and create a control loop to maintain this position until an external event occurs like a fire command.
What motor are you using? I think if you are using the CIM motors the speed controllers can be set to brake or coast when a neutral PWM is applied.