brian.motors.motor_types
- DeviceClass
- DeviceType
- MotorType
DeviceClass class objects
Device detected on a motor port using only ADC readings. Valid only when the port mode is not POWER_OFF.
NONE
No device is detected
ERROR
Some device was detected, but it is not clear which
EV3_ANALOG_MOTOR
NXT/EV3 motor was detected; the device type contains the ID
EV3_UART_DEVICE
Unknown EV3 UART device was detected; further active probing is needed
DeviceType class objects
More detailed type of a device detected as DeviceClass.EV3_ANALOG_MOTOR.
UNKNOWN
Motor type is not known (yet)
NXT_EV3_LARGE_MOTOR
NXT or EV3 large motor (these are not distinguishable)
EV3_MEDIUM_MOTOR
EV3 medium motor
MotorType class objects
Description of a supported motor type and its default control parameters.
name
identification
Returns:
What will Brian report as the ID when this motor is connected
default_constants
default_acceleration_limit
Returns:
Acceleration limit a new Motor of this type starts with, in degrees per second squared
Identification class objects
Results of auto-detection
device_type
device_class
Returns:
Detected device class (portMode must not be POWER_OFF)
DefaultConstants class objects
Control loop parameters that are typically not changed much
motor
controller
observer
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.