Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
dd69bd05aThis file is pinned to the selected release. Download the original to open it in your design tool.
.. _api-reference:
API REFERENCE
=============
The :ref:`api-reference` section below lists all endpoints.
protocol_hash
-------------------------------------------------------------------
ID: 0
Type: uint32
The Avlos protocol hash.
uid
-------------------------------------------------------------------
ID: 1
Type: uint32
The unique device ID, unique to each PAC55xx chip produced.
fw_version
-------------------------------------------------------------------
ID: 2
Type: str
The firmware version.
hw_revision
-------------------------------------------------------------------
ID: 3
Type: uint32
The hardware revision.
Vbus
-------------------------------------------------------------------
ID: 4
Type: float
Units: volt
The measured bus voltage.
Ibus
-------------------------------------------------------------------
ID: 5
Type: float
Units: ampere
The estimated bus current. Only estimates current drawn by motor.
power
-------------------------------------------------------------------
ID: 6
Type: float
Units: watt
The estimated power. Only estimates power drawn by motor.
temp
-------------------------------------------------------------------
ID: 7
Type: float
Units: degree_Celsius
The internal temperature of the PAC55xx MCU.
calibrated
-------------------------------------------------------------------
ID: 8
Type: bool
Whether the system has been calibrated.
errors
-------------------------------------------------------------------
ID: 9
Type: uint8
Any system errors, as a bitmask
Flags:
- UNDERVOLTAGE
warnings
-------------------------------------------------------------------
ID: 10
Type: uint8
Any system warnings, as a bitmask
Flags:
- DRIVER_FAULT
- CHARGE_PUMP_FAULT_STAT
- CHARGE_PUMP_FAULT
- DRV10_DISABLE
- DRV32_DISABLE
- DRV54_DISABLE
save_config() -> void
--------------------------------------------------------------------------------------------
ID: 11
Return Type: void
Save configuration to non-volatile memory.
erase_config() -> void
--------------------------------------------------------------------------------------------
ID: 12
Return Type: void
Erase the config stored in non-volatile memory and reset the device.
nvm.num_slots
-------------------------------------------------------------------
ID: 13
Type: uint8
Number of wear leveling slots (calculated from config size).
nvm.current_slot
-------------------------------------------------------------------
ID: 14
Type: uint8
Current active slot (0 to num_slots-1).
nvm.write_count
-------------------------------------------------------------------
ID: 15
Type: uint32
Total writes since first use (sequence number).
reset() -> void
--------------------------------------------------------------------------------------------
ID: 16
Return Type: void
Reset the device.
enter_dfu() -> void
--------------------------------------------------------------------------------------------
ID: 17
Return Type: void
Enter DFU mode.
config_size
-------------------------------------------------------------------
ID: 18
Type: uint32
Size (in bytes) of the configuration object.
scheduler.load
-------------------------------------------------------------------
ID: 19
Type: uint32
Processor load in ticks per PWM cycle.
scheduler.warnings
-------------------------------------------------------------------
ID: 20
Type: uint8
Any scheduler warnings, as a bitmask
Flags:
- CONTROL_BLOCK_REENTERED
controller.state
-------------------------------------------------------------------
ID: 21
Type: uint8
The state of the controller.
Options:
- IDLE
- CALIBRATE
- CL_CONTROL
controller.mode
-------------------------------------------------------------------
ID: 22
Type: uint8
The control mode of the controller.
Options:
- CURRENT
- VELOCITY
- POSITION
- TRAJECTORY
- HOMING
controller.warnings
-------------------------------------------------------------------
ID: 23
Type: uint8
Any controller warnings, as a bitmask
Flags:
- VELOCITY_LIMITED
- CURRENT_LIMITED
- MODULATION_LIMITED
controller.errors
-------------------------------------------------------------------
ID: 24
Type: uint8
Any controller errors, as a bitmask
Flags:
- CURRENT_LIMIT_EXCEEDED
- PRE_CL_I_SD_EXCEEDED
controller.position.setpoint
-------------------------------------------------------------------
ID: 25
Type: float
Units: tick
The position setpoint in the user reference frame.
controller.position.p_gain
-------------------------------------------------------------------
ID: 26
Type: float
The proportional gain of the position controller.
controller.velocity.setpoint
-------------------------------------------------------------------
ID: 27
Type: float
Units: tick / second
The velocity setpoint in the user reference frame.
controller.velocity.limit
-------------------------------------------------------------------
ID: 28
Type: float
Units: tick / second
The velocity limit.
controller.velocity.p_gain
-------------------------------------------------------------------
ID: 29
Type: float
The proportional gain of the velocity controller.
controller.velocity.i_gain
-------------------------------------------------------------------
ID: 30
Type: float
The integral gain of the velocity controller.
.. _integrator-deadband:
controller.velocity.deadband
-------------------------------------------------------------------
ID: 31
Type: float
Units: tick
The deadband of the velocity integrator. A region around the position setpoint where the velocity integrator is not updated.
controller.velocity.increment
-------------------------------------------------------------------
ID: 32
Type: float
Max velocity setpoint increment (ramping) rate. Set to 0 to disable.
controller.current.Iq_setpoint
-------------------------------------------------------------------
ID: 33
Type: float
Units: ampere
The Iq setpoint in the user reference frame.
controller.current.Id_setpoint
-------------------------------------------------------------------
ID: 34
Type: float
Units: ampere
The Id setpoint in the user reference frame.
controller.current.Iq_limit
-------------------------------------------------------------------
ID: 35
Type: float
Units: ampere
The Iq limit.
controller.current.Iq_estimate
-------------------------------------------------------------------
ID: 36
Type: float
Units: ampere
The Iq estimate in the user reference frame.
controller.current.bandwidth
-------------------------------------------------------------------
ID: 37
Type: float
Units: hertz
The current controller bandwidth.
controller.current.Iq_p_gain
-------------------------------------------------------------------
ID: 38
Type: float
The current controller proportional gain.
controller.current.max_Ibus_regen
-------------------------------------------------------------------
ID: 39
Type: float
Units: ampere
The max current allowed to be fed back to the power source before flux braking activates.
controller.current.max_Ibrake
-------------------------------------------------------------------
ID: 40
Type: float
Units: ampere
The max current allowed to be dumped to the motor windings during flux braking. Set to zero to deactivate flux braking.
controller.voltage.Vq_setpoint
-------------------------------------------------------------------
ID: 41
Type: float
Units: volt
The Vq setpoint.
calibrate() -> void
--------------------------------------------------------------------------------------------
ID: 42
Return Type: void
Calibrate the device.
idle() -> void
--------------------------------------------------------------------------------------------
ID: 43
Return Type: void
Set idle mode, disabling the driver.
position_mode() -> void
--------------------------------------------------------------------------------------------
ID: 44
Return Type: void
Set position control mode.
velocity_mode() -> void
--------------------------------------------------------------------------------------------
ID: 45
Return Type: void
Set velocity control mode.
current_mode() -> void
--------------------------------------------------------------------------------------------
ID: 46
Return Type: void
Set current control mode.
set_pos_vel_setpoints(float pos_setpoint, float vel_setpoint) -> float
--------------------------------------------------------------------------------------------
ID: 47
Return Type: float
Set the position and velocity setpoints in the user reference frame in one go, and retrieve the position estimate
.. _api-can-rate:
comms.can.rate
-------------------------------------------------------------------
ID: 48
Type: uint32
The baud rate of the CAN interface.
comms.can.id
-------------------------------------------------------------------
ID: 49
Type: uint32
The ID of the CAN interface.
comms.can.heartbeat
-------------------------------------------------------------------
ID: 50
Type: bool
Toggle sending of heartbeat messages.
motor.R
-------------------------------------------------------------------
ID: 51
Type: float
Units: ohm
The motor Resistance value.
motor.L
-------------------------------------------------------------------
ID: 52
Type: float
Units: henry
The motor Inductance value.
motor.pole_pairs
-------------------------------------------------------------------
ID: 53
Type: uint8
The motor pole pair count.
motor.type
-------------------------------------------------------------------
ID: 54
Type: uint8
The type of the motor. Either high current or gimbal.
Options:
- HIGH_CURRENT
- GIMBAL
motor.calibrated
-------------------------------------------------------------------
ID: 55
Type: bool
Whether the motor has been calibrated.
motor.I_cal
-------------------------------------------------------------------
ID: 56
Type: float
Units: ampere
The calibration current.
motor.errors
-------------------------------------------------------------------
ID: 57
Type: uint8
Any motor/calibration errors, as a bitmask
Flags:
- PHASE_RESISTANCE_OUT_OF_RANGE
- PHASE_INDUCTANCE_OUT_OF_RANGE
- POLE_PAIRS_CALCULATION_DID_NOT_CONVERGE
- POLE_PAIRS_OUT_OF_RANGE
- ABNORMAL_CALIBRATION_VOLTAGE
sensors.user_frame.position_estimate
-------------------------------------------------------------------
ID: 58
Type: float
Units: tick
The filtered position estimate in the user reference frame.
sensors.user_frame.velocity_estimate
-------------------------------------------------------------------
ID: 59
Type: float
Units: tick / second
The filtered velocity estimate in the user reference frame.
sensors.user_frame.offset
-------------------------------------------------------------------
ID: 60
Type: float
Units: tick
The user defined offset.
sensors.user_frame.multiplier
-------------------------------------------------------------------
ID: 61
Type: float
The user defined multipler.
sensors.setup.onboard.calibrated
-------------------------------------------------------------------
ID: 62
Type: bool
Whether the sensor has been calibrated.
sensors.setup.onboard.errors
-------------------------------------------------------------------
ID: 63
Type: uint8
Any sensor errors, as a bitmask
Flags:
- CALIBRATION_FAILED
- READING_UNSTABLE
sensors.setup.external_spi.type
-------------------------------------------------------------------
ID: 64
Type: uint8
The type of the external sensor.
Options:
- MA7XX
- AS5047
- AMT22
sensors.setup.external_spi.rate
-------------------------------------------------------------------
ID: 65
Type: uint8
The rate of the external sensor.
Options:
- 1_5Mbps
- 3Mbps
- 6Mbps
- 8Mbps
- 12Mbps
sensors.setup.external_spi.calibrated
-------------------------------------------------------------------
ID: 66
Type: bool
Whether the sensor has been calibrated.
sensors.setup.external_spi.errors
-------------------------------------------------------------------
ID: 67
Type: uint8
Any sensor errors, as a bitmask
Flags:
- CALIBRATION_FAILED
- READING_UNSTABLE
sensors.setup.hall.calibrated
-------------------------------------------------------------------
ID: 68
Type: bool
Whether the sensor has been calibrated.
sensors.setup.hall.errors
-------------------------------------------------------------------
ID: 69
Type: uint8
Any sensor errors, as a bitmask
Flags:
- CALIBRATION_FAILED
- READING_UNSTABLE
sensors.select.position_sensor.connection
-------------------------------------------------------------------
ID: 70
Type: uint8
The position sensor connection. Either ONBOARD, EXTERNAL_SPI or HALL.
Options:
- ONBOARD
- EXTERNAL_SPI
- HALL
sensors.select.position_sensor.bandwidth
-------------------------------------------------------------------
ID: 71
Type: float
Units: hertz
The position sensor observer bandwidth.
sensors.select.position_sensor.raw_angle
-------------------------------------------------------------------
ID: 72
Type: int32
The raw position sensor angle.
sensors.select.position_sensor.position_estimate
-------------------------------------------------------------------
ID: 73
Type: float
Units: tick
The filtered position estimate in the position sensor reference frame.
sensors.select.position_sensor.velocity_estimate
-------------------------------------------------------------------
ID: 74
Type: float
Units: tick / second
The filtered velocity estimate in the position sensor reference frame.
sensors.select.commutation_sensor.connection
-------------------------------------------------------------------
ID: 75
Type: uint8
The commutation sensor connection. Either ONBOARD, EXTERNAL_SPI or HALL.
Options:
- ONBOARD
- EXTERNAL_SPI
- HALL
sensors.select.commutation_sensor.bandwidth
-------------------------------------------------------------------
ID: 76
Type: float
Units: hertz
The commutation sensor observer bandwidth.
sensors.select.commutation_sensor.raw_angle
-------------------------------------------------------------------
ID: 77
Type: int32
The raw commutation sensor angle.
sensors.select.commutation_sensor.position_estimate
-------------------------------------------------------------------
ID: 78
Type: float
Units: tick
The filtered position estimate in the commutation sensor reference frame.
sensors.select.commutation_sensor.velocity_estimate
-------------------------------------------------------------------
ID: 79
Type: float
Units: tick / second
The filtered velocity estimate in the commutation sensor reference frame.
traj_planner.max_accel
-------------------------------------------------------------------
ID: 80
Type: float
Units: tick / second
The max allowed acceleration of the generated trajectory.
traj_planner.max_decel
-------------------------------------------------------------------
ID: 81
Type: float
Units: tick / second ** 2
The max allowed deceleration of the generated trajectory.
traj_planner.max_vel
-------------------------------------------------------------------
ID: 82
Type: float
Units: tick / second
The max allowed cruise velocity of the generated trajectory.
traj_planner.t_accel
-------------------------------------------------------------------
ID: 83
Type: float
Units: second
In time mode, the acceleration time of the generated trajectory.
traj_planner.t_decel
-------------------------------------------------------------------
ID: 84
Type: float
Units: second
In time mode, the deceleration time of the generated trajectory.
traj_planner.t_total
-------------------------------------------------------------------
ID: 85
Type: float
Units: second
In time mode, the total time of the generated trajectory.
move_to(float pos_setpoint) -> void
--------------------------------------------------------------------------------------------
ID: 86
Return Type: void
Move to target position in the user reference frame respecting velocity and acceleration limits.
move_to_tlimit(float pos_setpoint) -> void
--------------------------------------------------------------------------------------------
ID: 87
Return Type: void
Move to target position in the user reference frame respecting time limits for each sector.
traj_planner.errors
-------------------------------------------------------------------
ID: 88
Type: uint8
Any errors in the trajectory planner, as a bitmask
Flags:
- INVALID_INPUT
- VCRUISE_OVER_LIMIT
homing.velocity
-------------------------------------------------------------------
ID: 89
Type: float
Units: tick / second
The velocity at which the motor performs homing.
homing.max_homing_t
-------------------------------------------------------------------
ID: 90
Type: float
Units: second
The maximum time the motor is allowed to travel before homing times out and aborts.
homing.retract_dist
-------------------------------------------------------------------
ID: 91
Type: float
Units: tick
The retraction distance the motor travels after the endstop has been found.
homing.warnings
-------------------------------------------------------------------
ID: 92
Type: uint8
Any homing warnings, as a bitmask
Flags:
- HOMING_TIMEOUT
homing.stall_detect.velocity
-------------------------------------------------------------------
ID: 93
Type: float
Units: tick / second
The velocity below which (and together with `stall_detect.delta_pos`) stall detection mode is triggered.
homing.stall_detect.delta_pos
-------------------------------------------------------------------
ID: 94
Type: float
Units: tick
The velocity below which (and together with `stall_detect.delta_pos`) stall detection mode is triggered.
homing.stall_detect.t
-------------------------------------------------------------------
ID: 95
Type: float
Units: second
The time to remain in stall detection mode before the motor is considered stalled.
home() -> void
--------------------------------------------------------------------------------------------
ID: 96
Return Type: void
Perform the homing operation.
watchdog.enabled
-------------------------------------------------------------------
ID: 97
Type: bool
Whether the watchdog is enabled or not.
watchdog.triggered
-------------------------------------------------------------------
ID: 98
Type: bool
Whether the watchdog has been triggered or not.
watchdog.timeout
-------------------------------------------------------------------
ID: 99
Type: float
Units: second
The watchdog timeout period.