Issue:
Once the motors have been energized by the methods in the easygopigo3 library, they never get turned off. This causes a continuous power drain and potential stress to the components involved.
Why this is an issue:
Battery power is a limited resource and allowing continuous motor current to run will cause them to be depleted more quickly.
Though I have not measured this with precision, my experience with the New Remote Camera Robot project indicates that, absent motor power, the battery's run time is in the tens or twenties of hours. After the motors have been energized and stopped, the run time is measured in units of hours.
Allowing current to continuously run thorough the motors/drivers stresses both the motors and their driving circuitry and may shorten their useful life.
Note that the servos already have a disabling method that can be used to turn off power to the servos when not in use.
Proposed solution:
Within the stop() method, follow the set_motor_dps() command that stops robot motion with a set_motor_power() command that turns the motors themselves off. This makes removal of power automatic and prevents inadvertent additional load on the power source.
Alternate solution:
Create a motor disabling method corresponding to the servo[n].disable_servo() methods that already exist for the servos.
IMHO, it is better to make the motor disable command a part of the stop() method as that conserves power automatically and is consistent with the user's expectation that the motors not receive power when they're not being used.
In the event that the programmer's use-case requires finer grained control over stopping and releasing the motors, the existing set_motor_dps() and set_motor_power() methods can be used.
Caveat:
If you remove power from the robot motors too quickly after stopping them, the robot's inertia may try to keep the motors moving if the robot is heavy or moving quicly. The solution to this is to provide a slight, (0.25 - 0.50 second), pause between the set_motor_dps() command that stops the robot and the set_motor_power() command to give the robot time to come to a complete stop.
Ref: Pull request #305
Issue: Once the motors have been energized by the methods in the easygopigo3 library, they never get turned off. This causes a continuous power drain and potential stress to the components involved.
Why this is an issue:
Proposed solution: Within the
stop()
method, follow theset_motor_dps()
command that stops robot motion with aset_motor_power()
command that turns the motors themselves off. This makes removal of power automatic and prevents inadvertent additional load on the power source.Alternate solution: Create a motor disabling method corresponding to the
servo[n].disable_servo()
methods that already exist for the servos.stop()
method as that conserves power automatically and is consistent with the user's expectation that the motors not receive power when they're not being used.set_motor_dps()
andset_motor_power()
methods can be used.Caveat: If you remove power from the robot motors too quickly after stopping them, the robot's inertia may try to keep the motors moving if the robot is heavy or moving quicly. The solution to this is to provide a slight, (0.25 - 0.50 second), pause between the
set_motor_dps()
command that stops the robot and theset_motor_power()
command to give the robot time to come to a complete stop.