Using motor current sensing

Has anyone used this function with a view to using that as a signal eg. when claw has closed far enough?
Interested in any attempts at this especially if successful!

Hi Raj,

I have e-mailed you a program which shows a way of doing this.


It would be nice if you could share the relevant part of the program here on the forum :wink:


The Smart Motor already contains the ability to monitor its current draw and automatically act on it. It is called the maximum power mode, and uses the encoder velocity and the electrical current draw to calculate the current motor power and adjust automatically. When unloaded, the motor will still spin at 100% free speed in this mode.

In Modkit for VEX, this mode is a dark blue block and is called Set Max Power to %, and in RobotC this is called setMotorStrength(). By setting these to a low value, like 20%, the maximum power output (and thus torque) from the motor will be cut proportionally. A good way to visualize this is with a robot claw picking up an egg. So instead of a robot claw crushing an egg with 100% of the motor stall torque, the motor will detect the stall automatically and limit how much torque the motor outputs, thus keeping the egg intact.

Attached is a sample Modkit program that limits a motor to half power, but will then stop that motor if it detects a continuous stall for more than a quarter second.

Jetro de Chateau, apologies! I keep getting server timeout messages when I try to upload images so gave up.
Jetro de Chateau, apologies! I keep getting server timeout messages/logged out when I try to upload images so gave up. User error I am sure!

It’s working for me now.

Much appreciated! (1.72 KB) (1.92 KB)

How odd, one of the lines from my “timed out” post appeared on the successful one as well. Must be me!

The forum engine remembers if you write something that doesn’t get posted, but sometimes it takes a while to see it. Probably what happened in your case.