brian.motors.motor_types
MotorType class objects
name
identification
Returns:
What will Brian report as the ID when this motor is connected
default_constants
Identification class objects
Results of auto-detection
device_type
Returns:
Detected device class (portMode must not be POWER_OFF)
device_class
DefaultConstants class objects
Control loop parameters that are typically not changed much
Motor class objects
Linear dynamic model of the connected motor. This model can be used for estimating various internal states of the motor.
Kt_NmPerA
Kb_VPerRadPerSec
B_NmPerRadPerSec
Udeadzone_Volts
R_Ohm
L_Henry
Cp_Farad
Returns:
Capacity of a EMI-eliminating capacitor across motor terminals, in farads
ticksPerRevolution
Controller class objects
Constants of the position/speed controller Brian implements these two controllers: - a parallel-form 2-degrees-of-freedom PI controller for motor speed 1, and - a cascaded P controller for motor position.
speedKp
speedKi
speedBeta
Returns:
Setpoint weight in the proportional branch of the PI controller (see 1)
positionKp
Returns:
Proportional constant of the cascaded position P controller (its output is target speed in ticks/s)
positionToleranceTicks
Returns:
Tolerate up to this deviation with zero output (needed for EV3 medium motor)
Observer class objects
Additional configuration of state observer.
current
speed
Current class objects
Current observer parameters. Brian has to estimate motor winding current from H-bridge current measurements. These are not equal (PWM=0 makes the winding current impossible to directly measure). The way it does so is by simulating the current response using the provided model and then correcting the predicted value using real measurements (when they're available).
measurementWeight_pct
Returns:
Correction step: How much weight to give to measurements vs. model prediction
minimumPwmOnTime_pct
Returns:
Only trust measurements if the PWM has at least this duty cycle
Speed class objects
Speed tracking loop parameters Brian estimates motor speed using a tracking loop/observer inspired by figure 3 and equations (6) in 2. These constants specify the parameters of the loop.