"Stall" a motor

Is there a way to make an am-2971 motor resist motion? I know we can set the motor to spin one way, but I don’t want to risk browning out. Any ideas?

You can use a sensor (potentiometer, encoder, etc) to determine where the motor is, and use a control loop (PID, bang-bang) to keep it at that position.

Now, if there is a lot of weight on that arm / mechanism, you likely don’t want to be stalling your motor, gearbox, etc. You could easily damage the components or brown out, as you said.

From a programming perspective, the sensor+control loop works, from a design one, be cautious of an application that requires this to keep something in the air. Could be fine, but be sure you’re not headed down the wrong road.

Let me see if I understand your intention correctly first. You want to create a state in which your motor does not back-drive?

There are two methods commonly used by tricks with mechanical and software.

There are multiples of methods for mechanically preventing a motor from back-driving, gear wrenches, some worm gears (efficient), and latching systems.

In software the most commonly used method is through PID positional control in which you control the movement of the motor towards a “setpoint” and then the software then applies incremental power when needed to keep the motor at the positional set-point.