The DC motor cannot be locked after being powered on

Issue #416 resolved
YongYu created an issue

Hello, John! I found that using the ESP32 (ESP32-Wroom-32E) to control the DC machine could not be locked. I wonder if this can be optimized in the firmware to lock the motor after it is powered on.

Comments (5)

  1. John Maloney repo owner

    I am not sure what you mean by "locking". To turn a motor off, you can set the power to "0". Does that help?

    Some motor controllers have "braking" mode that stops the motor more quickly. To implement that function, you'd need the technical documentation for the specific motor controller (often called the "data sheet") on the Longan board.

  2. YongYu reporter

    By "lock" I mean that when the motor is connected to the Longan Core, the motor can be controlled by the Longan Core without being affected by the opposite torque. The current performance of the motor is that when the motor is rotating, if you hold the output end of the motor by hand, the motor can be easily stopped. When the Longan Core control motor is stopped, the car cannot be stopped quickly and will slide for a short distance. Of course, this is also related to the weight and inertia of the car.
    Finally, I also feel that this has something to do with batteries, and we are trying to try it with 3C magnification batteries.

  3. John Maloney repo owner

    Thank you for explaining what you meant by "lock".

    The current performance of the motor is that when the motor is rotating, if you hold the output end of the motor by hand, the motor can be easily stopped.

    This behavior may depend on both the available battery power and the power level that you set in your code. At low power levels (< 15%), most DC motors can stall if you hold the output shaft and won't restart until you increase the power level. At full power, it should be difficult to make the motor stall unless your batteries are weak.

    When the Longan Core control motor is stopped, the car cannot be stopped quickly and will slide for a short distance.

    When the power to the motor is stopped, it can still continue to turn. Even though the motor has some internal resistance to turning, the momentum of the car transfers torque to the motor through the wheels, so the car roll a short distance. You can code a "braking stop" by turning on the motor power in the reverse direction for a short time. The exact amount of time needed depends on the weight of the car, it's initial speed, and the power available from the batteries. You will need to experiment to find the correct amount of time. If it is too long, the car will jump backwards. If it is not long enough, the car won't come to a complete stop.

  4. Log in to comment