MicroPython EvoMotorPair#

class evo.EvoMotorPair(m1, m2)#

Native synchronized two-motor drive helper. m1 and m2 must be evo.EvoMotor instances. Constructor returns a new pair object.

Motion Profile

EvoMotorPair.setStartSpeed(speed)#

Set the starting ramp speed. Negative values are stored as their absolute value. Returns None.

EvoMotorPair.setEndSpeed(speed)#

Set the ending ramp speed. Negative values are stored as their absolute value. Returns None.

EvoMotorPair.setAcceleration(acceleration)#

Set acceleration in degrees-per-second style units used by profiled moves. Negative values are stored as their absolute value. Returns None.

EvoMotorPair.getAcceleration()#

Return the configured acceleration as an integer.

EvoMotorPair.setDeceleration(deceleration)#

Set deceleration for profiled moves. Negative values are stored as their absolute value. Returns None.

EvoMotorPair.getDeceleration()#

Return the configured deceleration as an integer.

EvoMotorPair.setAccelerationProfile(profile)#

Select evo.ACCEL_NONE, evo.ACCEL_TRAPEZOID or evo.ACCEL_SCURVE. Returns None.

EvoMotorPair.getAccelerationProfile()#

Return the current acceleration profile constant.

Synchronisation

EvoMotorPair.setStopBehaviour(behaviour)#
EvoMotorPair.setStopBehavior(behaviour)#

Set the default stop behaviour to evo.COAST, evo.BRAKE or evo.HOLD. Returns None.

EvoMotorPair.setSyncPID(kp, ki, kd)#

Set integer PID gains used to keep both motors synchronized during profiled moves. Returns None.

EvoMotorPair.getSyncPID()#

Return (kp, ki, kd) as a tuple.

Movement

EvoMotorPair.move(left_dps, right_dps)#
EvoMotorPair.moveSpeed(left_dps, right_dps)#

Start continuous speed-control movement for both motors. move() is an alias of moveSpeed(). Returns None.

EvoMotorPair.movePower(left_power, right_power)#

Drive both motors using raw PWM power. Returns None.

EvoMotorPair.moveDegrees(left_dps, right_dps, degrees, stopBehavior=None)#
EvoMotorPair.runDegrees(left_dps, right_dps, degrees, stopBehavior=None)#

Run both motors for an encoder distance and stop using stopBehavior or the pair default. Returns None.

EvoMotorPair.moveTime(left_dps, right_dps, time_ms, slowdown_ms=200, stopBehavior=None)#

Run both motors for time_ms milliseconds, optionally slowing during the final slowdown_ms milliseconds. Raises ValueError if time_ms is negative. Returns None.

State

EvoMotorPair.hold()#
EvoMotorPair.brake()#
EvoMotorPair.coast()#

Stop both motors using the named stop mode. Returns None.

EvoMotorPair.stop(stopBehavior=evo.BRAKE)#

Stop both motors immediately using the supplied behaviour. Returns None.

EvoMotorPair.resetAngle()#

Reset both motor angle references to zero. Returns None.

EvoMotorPair.isBusy()#

Return True while a blocking profiled move is active, otherwise False.

EvoMotorPair.deinit()#

Stop the pair with brake behaviour and mark it idle. Returns None.