I found a weird motor bug using pros. If your program tells the motor to run a certain voltage everything works fine until you unplug the motor and plug it back in. When you do that it move a very tiny bit but then doesn’t turn. This isn’t very effecting though because if you tell the motor to run at a different voltage it runs fine.
Also for some reason, another way of making it run after you plugged the motor in is to quickly unplug the motor and then plug it back in before the motor unplugged message shows up.
This doesn’t sound like a bug. Iirc, the motors have motor controllers built into them that runs a small firmware. This firmware is what is probably in charge of controlling how much power the motors draw. So, if you unplug it, the motor forgets how much its supposed to be drawing.
And may I ask why you are unplugging motors with your robot on?
I am setting the motor speed every program loop cycle. You do have a point though, and it could be that PROS recognizes that a certain speed has already been set and doesn’t resend the message to VEXos(which runs on another processer). Then when the motor is unplugged VEXos resets it’s value to 0, but pros doesn’t.
This wouldn’t explain why the motor runs a very tiny bit or why unplugging motor and then plugging it in very quickly (after it’s not running) fixes the issue.
This is definitely a bug, but you would probably need to know how VEXos/PROS function. @jpearman or PROS devolpers might be able to figure it out.
I am working on a v5 equipment tester, since my club needs to check 300+ v5 motors and all ports on 30+ v5 brains. (I will post the source code when I am done.)
I can guarantee this is nothing to do with PROS. PROS simply forwards the move command to VEXos.
https://github.com/purduesigbots/pros/blob/develop/src/devices/vdml_motors.c ultimately leads to vexDeviceMotorVoltageSet
which is a VEXos function.
It is entirely possible that the optimization is done by VEXos though, by filtering out redundant movement commands.
You could test (or avoid) this by adding a slight ±1 jitter to the move command.
Er, so don’t unplug the motor.
Seriously though, I will check, but general approach is safety comes first. Some things like current limit will be sent to the motor if you unplug and replug it in. However, we don’t want a motor to suddenly start turning when you plug it in as it may cause unexpected damage.
The motor that case may only have a current reading, but no speed control, so it just brakes.