EEPROM Configurationπ
The EEPROM allows for persistent configuration of the motor controller.
Fieldsπ
All values (including f32 and u32 values) are little-endian. Divide values by their scaling in order to retrieve the true value.
Field ID |
Field Name |
Field Description |
Datatype |
Scaling |
Bounds |
Units |
|---|---|---|---|---|---|---|
0 |
NumberOfBoots |
Number of boots of the device total. (pending implementation) |
f32 |
1 |
||
1 |
ResolverOffsetDegrees |
Offset from measured resolver angle to electrical angle in degrees. |
f32 |
1 |
[-360.0, 360.0] |
\(E\degree\) |
2 |
LoopIqPGain |
P (proportional) gain in the Iq PID loop |
f32 |
1 |
\(\mathrm{A} / \mathrm {V} \) |
|
3 |
LoopIqIGain |
I (integral) gain in the Iq PID loop |
f32 |
1 |
\(\mathrm{A} \cdot \mathrm{s} / \mathrm {V} \) |
|
4 |
LoopIqDGain |
D (derivative) gain in the Iq PID loop |
f32 |
1 |
\(\mathrm{A} / \left(\mathrm {V} \cdot \mathrm{s} \right)\) |
|
5 |
LoopIqTGain |
Gain for integral anti windup in the Iq PID loop |
f32 |
1 |
||
6 |
LoopIdPGain |
P (proportional) gain in the Id PID loop |
f32 |
1 |
\(\mathrm{A} / \mathrm {V} \) |
|
7 |
LoopIdIGain |
I (integral) gain in the Id PID loop |
f32 |
1 |
\(\mathrm{A} \cdot \mathrm{s} / \mathrm {V} \) |
|
8 |
LoopIdDGain |
D (derivative) gain in the Id PID loop |
f32 |
1 |
\(\mathrm{A} / \left(\mathrm {V} \cdot \mathrm{s} \right)\) |
|
9 |
LoopIdTGain |
Gain for integral anti windup in the Id PID loop |
f32 |
1 |
||
10 |
TorqueConstant |
Torque constant for the motor. Units Newton-Metres per Ampere. This torque constant is relative to Q-Axis current. The physical interpretation is roughly Nm/A where current is the amplitude of the torque generating phase current. |
f32 |
1 |
\(\mathrm{Nm/A}\) |
|
11-22 |
Current Scaling and Offsets |
The user should not touch these, calibrated at factory. |
f32 |
1 |
||
23 |
LoopVelPGain |
P (proportional) gain in the velocity control loop. |
f32 |
1 |
\(\mathrm{Nm \cdot s / E\degree}\) |
|
24 |
LoopVelIGain |
I (integral) gain in the velocity control loop. |
f32 |
1 |
\(\mathrm{Nm / E\degree}\) |
|
25 |
LoopVelDGain |
D (derivative) gain in the velocity control loop. |
f32 |
1 |
\(\mathrm{Nm \cdot s^2 / E\degree}\) |
|
26 |
LoopVelTGain |
Gain for integral anti windup in the velocity control loop. |
f32 |
1 |
||
27 |
MaxTorqueSlewRate |
Maximum torque slew rate in Newton-Metres per s. |
f32 |
1 |
>= 0.0 |
\(\mathrm{Nm/s}\) |
28 |
OvercurrentThresholdAmps |
Maximum allowable phase current magnitude (in Apk) |
f32 |
1 |
[0.0, 1500.0] |
\(\mathrm{A_{pk}}\) |
29 |
OvertempThresholdCelsius |
Maximum allowable temperature in the inverter |
f32 |
1 |
[0.0, 200.0] |
\( \degree\mathrm{C}\) |
30 |
ResolverPolesPerMotorPole |
Number of resolver poles per motor pole. Sign indicates resolver inversion. |
f32 |
1 |
||
31 |
MaxNPCapacitorVoltage |
Maximum allowable voltage across either neutral-point capacitor |
f32 |
1 |
<= 700.0 |
\(\mathrm{V}\) |
32 |
EnableHVILAlarm |
Set to 1 to prevent operation if any HV connectors are unseated. Set to 0 to disable this check. |
u32 |
1 |
[0, 1] |
|
33 |
ExtTempSensorType |
This value controls what is reported in the 0x31C (External RTD interface). Options:
|
u32 |
N/A |
[0, 2] |
|
34 |
DeviceIdentifier |
Lower 7 bytes of the 20-byte device identifier (little endian). The device identifier as printed on the unit is shown in base 36. |
7 bytes |
N/A |
||
35 |
DeviceIdentifier2 |
Middle 7 bytes of the 20-byte device identifier (little endian) |
7 bytes |
N/A |
||
36 |
DeviceIdentifier3 |
Upper 6 bytes of the 20-byte device identifier (little endian) |
6 bytes |
N/A |
||
37 |
HardwareRevision |
Internal revision number for sensing and control circuitry. |
u32 |
N/A |
||
38 |
DisconnectedPhaseVoltageThresholdVolts |
If the applied phase-to-neutral voltage exceeds this threshold⦠|
f32 |
N/A |
\(\mathrm{V}\) |
|
39 |
DisconnectedPhaseCurrentThresholdAmps |
β¦ and if the measured current magnitude is below this threshold, a disconnected phase fault will be triggered |
f32 |
N/A |
\(\mathrm{A}\) |
|
40 |
UndervoltageThresholdVolts |
If the DC bus voltage drops below this value while the motor controller is enabled, an undervoltage fault will be triggered. |
f32 |
N/A |
\(\mathrm{V}\) |
Reading/Writing to EEPROMπ
There are 2 ways to configure the EEPROM. You can manually send CAN messages using whatever tool you prefer, or you can use Steinmetzβs tool which will autoformat and set that for you. The mechanism of configuration is the same for both manually sending CAN messages or the tool, the benefit of the tool is it will perform checks and formatting for you.
Using Provided Toolπ
Steinmetz provides a command-line tool to configure Avalanche EEPROM as well as manage firmware updates.
At this time, Steinmetz only provides a tool that works on Linux systems.
By default, the tool communicates over the can0 socketcan interface, although this can be changed with the --can flag.
Readingπ
The config tool can be used to read individual config values, or to dump all config values. Individual config values can be read like so:
$ ./steinmetz_tool config read ResolverOffsetDegrees
ResolverOffsetDegrees: 20
The list of all config values can be show with the --help flag:
$ ./steinmetz_tool config read --help
Read the value of a single configuration parameter
Usage: steinmetz_tool config read [OPTIONS] <KEY>
Arguments:
<KEY>
Possible values:
- NumberOfBoots
- ResolverOffsetDegrees: Resolver offset (in degrees)
- LoopIqPGain: kP for the q-axis current controller
- LoopIqIGain: kI for the q-axis current controller
- LoopIqDGain: kD for the q-axis current controller
- LoopIqTGain
- LoopIdPGain: kP for the d-axis current controller
- LoopIdIGain: kI for the d-axis current controller
- LoopIdDGain: kD for the d-axis current controller
- LoopIdTGain
- TorqueConst: Torque constant (in Nm/Amps)
- PhaseACoarseHallOffsetVolts
- PhaseBCoarseHallOffsetVolts
- PhaseCCoarseOffsetVolts
- PhaseACoarseVoltsPerAmp
- PhaseAFineHallOffsetVolts
- PhaseBFineHallOffsetVolts
- PhaseCFineOffsetVolts
- PhaseAFineVoltsPerAmp
- PhaseBCoarseVoltsPerAmp
- PhaseCCoarseVoltsPerAmp
- PhaseBFineVoltsPerAmp
- PhaseCFineVoltsPerAmp
- LoopVelPGain: kP for closed-loop velocity controller
- LoopVelIGain: kI for closed-loop velocity controller
- LoopVelDGain: kD for closed-loop velocity controller
- LoopVelTGain
- MaxTorqueSlewRate: Maximum allowable slew rate for torque controller (in Nm/s)
- OvercurrentThresholdAmps: Maximum allowable phase current magnitude (in Apk)
- OvertempThresholdCelsius: Maximum allowable temperature in the inverter
- ResolverPolesPerMotorPole: Number of resolver poles per motor pole. Sign indicates resolver inversion
- MaxNpCapacitorVoltage: Maximum allowable voltage across either neutral-point capacitor
- EnableHvilAlarm: Enable HVIL alarm
- ExtTempSensorType: Type of temperature sensor connected to external temp port
- DeviceIdentifier: The device identifier uniquely identifies a device and ties it back to pre-delivery acceptance testing data
- HardwareRevision
Options:
--can <CAN>
[default: can0]
-h, --help
Print help (see a summary with '-h')
Writingπ
The tool can similarly be used to write values to EEPROM:
$ ./steinmetz_tool config read ResolverOffsetDegrees
ResolverOffsetDegrees: 10
$ ./steinmetz_tool config write ResolverOffsetDegrees 20.0
Successfully Written ResolverOffsetDegrees: 20
$ ./steinmetz_tool config read ResolverOffsetDegrees
ResolverOffsetDegrees: 20
Dumpingπ
For efficiently reading the entire configuration (e.g in preparation to provision backup units), one may also dump the entire config:
$ ./steinmetz_tool config dump
NumberOfBoots: 0
ResolverOffsetDegrees: 178.5
LoopIqPGain: 0.03
LoopIqIGain: 6.0225
LoopIqDGain: 0
LoopIqTGain: 0
LoopIdPGain: 0.03
LoopIdIGain: 6.0225
LoopIdDGain: 0
LoopIdTGain: 0
TorqueConst: 1
PhaseACoarseHallOffsetVolts: 0
PhaseBCoarseHallOffsetVolts: 0
PhaseCCoarseOffsetVolts: 0
PhaseACoarseVoltsPerAmp: 0.0011241754
PhaseAFineHallOffsetVolts: 0
PhaseBFineHallOffsetVolts: 0
PhaseCFineOffsetVolts: 0
PhaseAFineVoltsPerAmp: 0.0051443847
PhaseBCoarseVoltsPerAmp: 0.0013006144
PhaseCCoarseVoltsPerAmp: 0.0011569085
PhaseBFineVoltsPerAmp: 0.0056292634
PhaseCFineVoltsPerAmp: 0.005971548
LoopVelPGain: 0.006
LoopVelIGain: 0.001
LoopVelDGain: 0
LoopVelTGain: 0
MaxTorqueSlewRate: 65
OvercurrentThresholdAmps: 680
OvertempThresholdCelsius: 88
ResolverPolesPerMotorPole: 2
MaxNpCapacitorVoltage: 450
EnableHvilAlarm: 1
ExtTempSensorType: 2
DeviceIdentifier: 2amxr83kn2hgw9srf12754mdca
HardwareRevision: 1
DisconnectedPhaseVoltageThresholdVolts: 30
DisconnectedPhaseCurrentThresholdAmps: 5
UndervoltageThresholdVolts: 40
Over CANπ
Writingπ
We will go through the example of writing the ResolverOffsetDegrees to be 10 degrees.
Step 1. Prepare CAN Packetπ
Begin by crafting the Write EEPROM CAN Packet as per the format described in 0x01a (EEPROM Set Parameter). ResolverOffsetDegrees is Field ID: 1. We want to write 10 degrees. If convert 10 to little-endian f32 we get [0x00, 0x00, 0x20, 0x41]. So we want to transmit a Standard CAN packet with ID 0x1a and data field as shown below:
Step 2. Transmit CAN Packetπ
Ensure the motor controller is powered on and in the ReadyToSwitch state, see State Machine. Transmit the CAN packet.
Step 3. Validate ACK Packetπ
When you recieve the ACK packet as described in 0x01c (EEPROM Set Response), you should check it to validate the write was performed correctly. The data we should recieve back per this example is shown below.
Reading.π
We will go through the example of reading back the LoopIqPGain, for our case we will assume LoopIqPGain is 0.5.
Step 1. Prepare CAN Packetπ
Begin by crafting the Read EEPROM CAN Packet as per the format described in 0x01b (EEPROM Get Parameter). LoopIqPGain is field: 2. So we prepare the CAN packet data as shown below.
Step 2. Transmit CAN Packetπ
Ensure the motor controller is powered on and in the ReadyToSwitch state, see State Machine. Transmit the CAN packet.
Step 3. Validate Response Packetπ
When you recieve the response packet as described in 0x01d (EEPROM Get Response), you should check it to validate the write was performed correctly. The data we should recieve back per this example is shown below.