Is it possible to switch off motor’s built-in PID regulator? In any software…
Let me rephrase it. Are you asking whether “Is there a way to let the motor move freely without actively trying to return to the last programmed position?”
The short answer is yes, use “setMotorBrakeMode(motor, motorCoast)”.
Full answer: The motor could be in one of three different brake modes.
The default one you know is motorHold, where it tries to stay in last position.
Next is motorBrake - the motor would brake, but won’t counter-act the external force. No power is delivered to the motor, but it’s terminals are shorted, working as an electric brake.
The last is motorCoast, which basically disconnects the motor so you only fight the gears and the friction.
This is not quite I meant. I want that two motor states:
- motor is off, without any break or hold.
- motor is running on minimum power (lets say 1 %)
…behave more similarly. However, in reality, in the first mode I can turn the motor shaft freely by hand, but in the second - I can’t; the motor resist manual (inertial) turning.
- stopMotor() + setMotorBrakeMode(motorCoast) should do that
- if you want the motor to move on its own (such as setMotor(m, 5)) but being rather weak, perhaps setMotorCurrentLimit(m, 50) would be the thing…
I can certainly fight a motor running at 100mA current limit, though I suspect it would still try to return to the expected position. But perhaps if you were using it with setMotor (as opposed to moveMotor or setMotorTarget), it would have no “expected position”. I haven’t tried that though…
I can certainly fight a motor running at 100mA current limit
I can too, of course. But, even if I set the motor current limit to 1, calling setMotorCurrentLimit(m, 1), I’ll still feel a big difference with stopped motor.
I can’t find any way to do what you are asking. With VEX Cortex, you can turn PID for a given motor on and off but it is a very different thing. I get the feeling that what you need is something that is part of the motor firmware that currently can’t be disabled.
Yes, I can’t find it too. The problem is that claimed feature “limiting motor current” does not work correctly.
I don’t think it actually limits the current as much as triggers the flag when your (theoretical) current limit has been reached. This won’t affect the PID though, other than triggering the flag.
Probably, you are right.
My students are typically using reduced current limit (100 = 100mA) when doing calibration at the start of their program run (both autonomous and teleop).
Reduce the current limit, start the motor against a hard stop (not hard enough to sustain full power), wait till it no longer moves, reset encoder, stop motor, replace the current limit to 3000.
One one design, they went as far as to reduce the current limit for arm motors while crossing the bridge (A Start Trek fan in me rejoiced: “All power to forward shileds, ehm, drivebase!”), it really made
a difference, especially with weaker battery.
Please note that even though the maximum current limit is >3000, the actual maximum current a VexIQ motor would draw is about 900mA and 300mA (perceived 10% of power) is still plenty strong.
I also suspect that the current limit only applies to active current draw (from battery), while the smarts in the motor could still brake with higher “passive” current (shorting it, back-emf current comes from the motor, not from the battery). So while a motor with very low current limit won’t try to return to the programmed (or new) position as strongly, it could still cause significant drag against external force.
I understand this, but still, setMotorCurrentLimit(m, 1) does not work as expected; moreover, we speak about “motorCoast” mode in which no active break is applied.