Yesterday evening I posted the new v2.90 update in the first post of this thread. This version includes many fundaments changes for improving stability (less changes of cookouts), a new hall to sensorless transition method (using an observer to see if all goes OK), a better field weakening mechanism and cleaner ramping for the erpm limiter and regen.
The main changes as far as setup:
in the erpm menu there are new settings for the throttle ramping:
Code:
a) erpm limiter (forward) rampdown start, range: 49.97, 2.99 k-erpm
b) erpm limiter (reverse) rampdown start, range: 39.99, 4.97 k-erpm
c) regen rampup start, range: 799, 495 erpm
d) accept direction change below: 78 erpm
e) erpm boundary between dr2 & dr23: 1485 erpm
f) erpm boundary between dr23 & dr3: 3987 erpm
The erpm limits now have a ramp down start and range setting. In the example above, for forward direction the IC will start ramping down the throttle starting at 50 k-erpm over a range of 3 k-erpm. This means that until 50 k-erpm you have 100% throttle. Above 50k-erpm throttle will be linearly reduced to 0% at 50 + 3 (the range setting) = 53k-erpm. In the same way, for reverse throttle is 100% till 40 k-erpm and then reduces to 0% at 45 k-erpm. Final motor speed will depend on motor load but will be somewhere in the 50 and 53 k-erpm forward or 40 and 45 k-erpm reverse (with the settings above).
Regen is now also ramped, such that below regen ramp start (800 erpm in the example above) there is no regen. At 800 erpm regen ramps up from 0% to 100% regen at 800+500 = 1300 erpm.
The transitions between drive 2 and 3 are regulated using options e and f. There is no hysteresis anymore, with the settings above the controller will be in drive 2 below 1500 erpm, in the transition drive mode 23 between 1500 and 4000 erpm and in drive 3 above 4000 erpm.
In hall mode now the PWM and motor control will be shut down when the throttle is closed and erpm drops below the value of option d. PWM off is indicated by the drive 0 LED coming on (next to the already lit drive 2 LED).
Automatic field weakening now works slightly differently:
Code:
amplitude control loop
h) 1st order: 100
i) 2nd order: 5.0000
j) maximum amplitude: 100 %
k) invoke fieldweakening at amplitude: 95 %
In the control loop coefficients menu it now has a new 'invoke field weakening at amplitude' setting.
Previously the controller IC would ramp up the controller output voltage to the value of option j, and then start ramping up the field weakening current. Doing this however means the controller can no longer adjust the controller output voltage, which can lead to problems with stability.
In 2.90 the controller IC wil ramp up the output voltage till it has reached the setting of option k (95%). Then it will start ramping up the field weakening current. Once maximum field weakening current is reached, the controller IC will ramp up the output voltage further till option j has been reached (100%). WHEN USING FIELD WEAKENING, IN A PROPER SETUP THE CONTROLLER WILL NEVER REACH THE MAXIMUM AMPLITUDE (100%), HAVING RUN INTO THE ERPM LIMITER BY THEN. This to maintain the capability to adjust the output voltage and to maintain proper stability. When you don't use field weakening you will not notice option k (95%).
The transition between hall and sensorless mode (when using hall sensors) is performed in drive_23. In this drive mode the controller will smoothly transition between hall sensor info and sensorless info. An observer was added which can dial back and forth between sensored and sensorless, based on how good things are going:
Code:
b) toggle hall usage
c) magnetic field shift compensation: 0 %
d) calibrate hall mode: yes
e) erpm for hall calibration: 4.97 k-erpm
f) PLL bandwidth: 30 Hz
g) PLL damping factor: 0.71
h) speed filter dr23 50% time: 5.00 msec
i) max speed difference dr23: 5.0 %
'how good things are going' is based on the speed difference the controller observes between hall sensored speed and mixed hall/sensorless speed. When the observed speed difference is lower than the % of option i, the observer dials more towards sensorless and away from sensored. When the speed difference is higher than the % it dials back towards more sensored and less sensorless. Before comparing the two speeds the speed info is filtered with option h.
In the chip status menu there is now an option indicating how far the observer has dialed to sensorless info:
Code:
status bits:
drive LEDS: ....
time spent: 0.000 sec
throttle: 0 %
wanted_i_torque: 0.0 A
wanted_i_fieldweak: 0.0 A
filter_i_torque: 0.0 A
filter_i_fieldweak: 0.0 A
filter_i_error: 0.0 A
Vout_real: 0 %
Vout_imag: 0 %
backemf_usage: 0 %
speed_sensorless: 0.00 k-erpm
filter_speed: 0.00 k-erpm
accelleration: 0 %
'Backemf_usage' indicates how much the control loop depends on backemf, as opposed to sensored info. When no hall sensors are used the controller is of course fully dependent on backemf info...