Parameters

From openinverter.org wiki
Revision as of 11:41, 7 March 2020 by Joromy (talk | contribs) (added the missing Spot values)
Jump to navigation Jump to search

The inverter can be adapted to many kinds of motors, battery packs and driver preferences by changing parameters.

Motor Parameters

The parameters to adjust the inverter to the motor are boost, fweak, fslipmin, fslipmax, polepairs, fmin, fmax and numimp.

They can be deduced from the motors nameplate or by trying which feels best. For illustration we will assume a bus voltage of 500V and a 4-pole (p=2) motor with a nominal speed of n=1450rpm@f=50Hz and 230V. With 500V DC an AC voltage of 500/1.41=355V can be generated.

boost is the digital amplitude of the sine wave at motor startup. It is needed to overcome the motors ohmic resistance. Digital amplitude is an internal quantity. 0 means no voltage is generated at all, 37813 means the full possible voltage is generated.

Example: boost=1700

At full throttle an effective voltage of 1700/37813*355=16V is generated. The best way to find a feasible value is to optimize it in the finished car. Start with the default value and increase until you get a good startup.

fweak is the frequency at which the full possible voltage is generated. It is also the point of the highest motor power. Beyond fweak torque will decrease to the square of frequency and thus power will decrease linear with frequency.

A starting point for fweak is the motors nameplate:

<figure-inline class="mw-default-size"><figure-inline><figure-inline><figure-inline><figure-inline><figure-inline><figure-inline>Fweak.png</figure-inline></figure-inline></figure-inline></figure-inline></figure-inline></figure-inline></figure-inline>

With our illustration motor fweak=355/230*50=77Hz. fweak can be configured lower than that resulting in more torque at the low end.

fslipmin/fslipmax is the slip frequency at which the motor is run at minimum/maximum throttle. fslipmin is set to the motors optimal slip frequency which can be deduced from the nameplate. fslipmin=f-p*n/60. With our illustration motor fslipmin=50-2*1450/60=1.66Hz. fslipmax can be set as high as breakdown torque which is not found on the nameplate. So its best found experimental starting with 2*fslipmin. If set too high the motor will start to rock violently on startup, possibly tripping the over current limit.

polepairs is set to p, 2 in our example.

fmin should be set just below fslipmin.

fmax is used to limit the speed of the motor. The default 200Hz would result in a maximum speed of about 6000rpm.

ampmin Is the minimum relative amplitude fed to the motor. At very low amplitudes the motor does not generate any noticable torque and throttle travel is wasted that does nothing. Find out a good value by experimenting.

Inverter Parameters

pwmfrq Sets the frequency at which the IGBTs are switched on and off. The faster the switching the higher the losses in the inverter and the lower the losses in the motor. The maximum frequency is also limited by the driver boards as explained here.

pwmpol Sets the polarity of the PWM signals, active high or active low. Do not touch this parameter if you don't know what you're doing. When configured inversely it will blow up your power stage immediatly if connected to a potent power source like batteries.

deadtime The time between switching off one IGBT and switching on the other. 28=800ns, 63=1.5µs. More values can be found in the STM32 data sheet. Make sure to test the deadtime at low power levels. Setting the deadtime too low while operating of a potent power source can blow up your power stage!

Parameter Reference

The following parameters currently exist to customize the controller software. Type

set   

to change it. Type

get 

to get the current value.

Parameters are internally stored with 5 binary fraction digits. That means there are 32 possible values after the decimal point. So when you set a value of 0.35 you might end up with 0.33.

Name Unit Min Max Default Description
Motor (FOC)
curkp 0 20000 64 Current controller proportional gain
curki 0 100000 20000 Current controller integral gain
curkifrqgain dig/Hz 0 1000 50 Current controllers integral gain frequency coefficient
fwkp -10000 0 -100 Cross comparison field weakening controller gain
dmargin dig/Hz -10000 0 -2000 Margin for residual torque producing current (so field weakening current doesn't use up the entire amplitude)
syncadv dig/Hz -100 100 10 Shifts "syncofs" downwards/upwards with frequency
Motor (sine)
boost dig 0 37813 1700 0 Hz Boost in digit. 1000 digit ~ 2.5%
fweak Hz 0 400 67 Frequency where V/Hz reaches its peak
udcnom V 0 1000 0 Nominal voltage for fweak and boost. fweak and boost are scaled to the actual dc voltage. 0=don't scale
fpconst Hz 0 400 400 Frequency where slip frequency is derated to form a constant power region. Only has an effect when < fweak
fslipmin Hz 0 100 1 Slip frequency at minimum throttle
fslipmax Hz 0 100 3 Slip frequency at maximum throttle
fmin Hz 0 400 1 Below this frequency no voltage is generated
Motor (common)
polepairs 1 16 2 Pole pairs of motor (e.g. 4-pole motor: 2 pole pairs)
respolepairs 1 16 1 Pole pairs of resolver (normally same as polepairs of motor, but sometimes 1)
encflt 0 16 4 Filter constant between pulse encoder and speed calculation. Makes up for slightly uneven pulse distribution
encmode 0 4 0 0=single channel encoder, 1=quadrature encoder,

2=quadrature /w index pulse, 3=SPI (deprecated), 4=Resolver, 5=sin/cos chip

fmax Hz 0 400 200 At this frequency rev limiting kicks in
numimp Imp/rev 8 8192 60 Pulse encoder pulses per turn
dirchrpm rpm 0 2000 100 Motor speed at which direction change is allowed
dirmode 0 1 1 0=button (momentary pulse selects forward/reverse), 1=switch (forward or reverse signal must be constantly high)
syncofs dig 0 65535 0 Phase shift of sine wave after receiving index pulse
snsm 2 3 2 Motor temperature sensor. 2=KTY83, 3=KTY84
Inverter
pwmfrq 0 3 2 PWM frequency. 0=17.6kHz, 1=8.8kHz, 2=4.4kHz, 3=2.2kHz. Needs PWM restart
pwmpol 0 1 0 PWM polarity. 0=active high, 1=active low. DO NOT PLAY WITH THIS!

Needs PWM restart

deadtime dig 0 255 28 Deadtime between highside and lowside pulse. 28=800ns, 56=1.5µs. Not always linear, consult STM32 manual. Needs PWM restart
ocurlim A -65535 65535 100 Hardware over current limit. RMS-current times sqrt(2) + some slack
minpulse dig 0 4095 1000 Narrowest or widest pulse, all other mapped to full off or full on, respectively
il1gain dig/A 0 4095 4.7 Digits per A of current sensor L1
il2gain dig/A 0 4095 4.7 Digits per A of current sensor L2
udcgain dig/V 0 4095 6.15 Digits per V of DC link
udcofs dig 0 4095 0 DC link 0V offset
udclim V 0 1000 540 High voltage at which the PWM is shut down
snshs 0 1 0 Heatsink temperature sensor. 0=JCurve, 1=Semikron
pinswap 0 7 0 Swap pins (only "FOC" software). Multiple bits can be set. 1=Swap Current Inputs, 2=Swap Resolver sin/cos, 4=Swap PWM output 1/3
Derating
bmslimhigh % 0 100 50 Positive throttle limit on BMS under voltage
bmslimlow % -100 0 -1 Regen limit on BMS over voltage
udcmin V 0 1000 450 Minimum battery voltage
udcmax V 0 1000 520 Maximum battery voltage
iacmax A 0 5000 5000 Maximum peak AC current
ifltrise dig 0 32 10 Controls how quickly slip and amplitude recover. The greater the value, the slower
ifltfall dig 0 32 3 Controls how quickly slip and amplitude are reduced on over current. The greater the value, the slower
idcmax A 0 5000 5000 Maximum DC input current
idcmin A -5000 0 -5000 Maximum DC output current (regen)
throtmax % 0 100 100 Throttle limit
Charger
chargemode 0 4 0 0=Off, 3=Boost, 4=Buck
chargecur 0 50 0 Charge current setpoint. Boost mode: charger INPUT current. Buck mode: charger output current
chargekp 0 100 80 Charge controller gain. Lower if you have oscillation, raise if current set point is not met
chargeflt 0 10 8 Charge current filtering. Raise if you have oscillations
chargemax % 0 99 90 Charge mode duty cycle limit. Especially in boost mode this makes sure you don't overvolt you IGBTs if there is no battery connected.
Throttle
potmin dig 0 4095 0 Value of "pot" when pot isn't pressed at all
potmax dig 0 4095 4095 Value of "pot" when pot is pushed all the way in
pot2min dig 0 4095 4095 Value of "pot2" when regen pot is in 0 position
pot2max dig 0 4095 4095 Value of "pot2" when regen pot is in full on position
potmode 0 2 0 0=Pot 1 is throttle and pot 2 is regen strength preset,

1=Pot 2 is proportional to pot 1 (redundance) 2=Throttle controlled via CAN

throtramp %/10ms 0 100 100 Max positive throttle slew rate
throtramprpm rpm 0 20000 20000 No throttle ramping above this speed
ampmin % 0 100 10 Minimum relative sine amplitude (only "sine" software)
slipstart % 10 100 50 % positive throttle travel at which slip is increased (only "sine" software)
throtcur A/% -10 10 1 Motor current per % of throttle travel (only "FOC" software)
Regen
brknompedal % -100 0 -50 Foot on break pedal regen torque
brkpedalramp %/10ms 1 100 100 Ramp speed when entering regen. E.g. when you set brkmax to 20% and brkpedal to -60% and brkpedalramp to 1, it will take 400ms to arrive at brake force of -60%
brknom % 0 100 30 Regen padel travel
brkmax % 0 100 30 Foot-off regen torque
brkout % -100 -1 -50 Activate brake light output at this amount of braking force
brkrampstr Hz 0 400 10 Below this frequency the regen torque is reduced linearly with the frequency
Automation
idlespeed rpm -100 1000 -100 Motor idle speed. Set to -100 to disable idle function. When idle speed controller is enabled, brake pedal must be pressed on start.
idlethrotlim % 0 100 50 Throttle limit of idle speed controller
idlemode 0 1 0 Motor idle speed mode. 0=always run idle speed controller, 1=only run it when brake pedal is released, 2=like 1 but only when cruise switch is on
speedkp Hz 0 100 1 Speed controller gain (Cruise and idle speed). Decrease if speed oscillates. Increase for faster load regulation
cruisemode 0 1 0 0=button (set when button pressed, reset with brake pedal), 1=switch (set when switched on, reset when switched off or brake pedal)
speedflt dig 0 16 1 Filter before cruise controller
Contactor Control
udcsw V 0 1000 330 Voltage at which the DC contactor is allowed to close
udcswbuck V 0 1000 540 Voltage at which the DC contactor is allowed to close in buck charge mode
tripmode 0 2 0 What to do with relays at a shutdown event. 0=All off, 1=Keep DC switch closed, 2=close precharge relay
Auxillary PWM
pwmfunc 0 2 0 Quantity that controls the PWM output. 0=tmpm, 1=tmphs, 2=speed
pwmgain dig/C 0 65535 100 Gain of PWM output
pwmofs dig -65535 65535 0 Offset of PWM output, 4096=full on
Communication
canspeed 0 3 0 Baud rate of CAN interface 0=250k, 1=500k, 2=800k, 3=1M
canperiod 0 1 0 0=send configured CAN messages every 100ms, 1=every 10ms
Testing
fslipspnt Hz -100 100 0 Slip setpoint in mode 2. Written by software in mode 1
ampnom % 0 100 0 Nominal amplitude in mode 2. Written by software in mode 1

The following values are available for diagnostic purposes. Type

get 

to get the current value. To read more then one you can provide a list like

get il1,il2,udc
Name Unit Description
version Firmware version
hwver Hardware version
opmode Operating mode. 0=Off, 1=Run, 2=Manual_run, 3=Boost, 4=Buck, 5=Sine, 6=2 Phase sine
lasterr Last error
udc V DC link voltage
uac V Calculated AC voltage
idc A Calculated DC current
il1 A AC current L1
il2 A AC current L2
il1rms A RMS current L1
il2rms A RMS current L2
ilmax A Calculated max of il1, il2, 1l3
boostcalc A DC link adjusted boost setting
fweakcalc A DC link adjusted fweak setting
fstat Hz Stator frequency
speed rpm Motor speed
cruisespeed rpm
turns
amp dig Sine amplitude, 37813=max
angle °
pot dig Pot value, 4095=max
pot2 dig Regen Pot value, 4095=max
potnom % Scaled pot value, 0 accel
dir Rotation direction. -1=REV, 0=Neutral, 1=FWD
tmphs °C Heatsink temperature
tmpm °C Motor temperature
uaux °C Auxiliary voltage (i.e. 12V system). Measured on pin 11 (mprot)
pwmio
canio
din_cruise Cruise Control. This pin activates the cruise control with the current speed. Pressing again updates the speed set point.
din_start State of digital input "start". This pin starts inverter operation
din_brake State of digital input "brake". This pin sets maximum regen torque (brknompedal). Cruise control is disabled.
din_mprot State of digital input "motor protection switch". Shuts down the inverter when =0
din_forward Direction forward
din_reverse Direction backward
din_emcystop State of digital input "emergency stop". Shuts down the inverter when =0
din_ocur Over current detected
din_bms BMS over voltage/under voltage
cpuload % CPU load for everything except communication

Tuning Guide

First you want to find a flat surface - a parking lot etc. so you can drive and stop without checking traffic. Change only one parameter at a time and save settings that work!

1. set fslipmin so that you feel car taking off smoothly and try to change it by +/-0,1Hz and check differences in starting. Save when satisfied.

2. lower boost value in 100 point until motor jitters at start. Then return it to last good value.

3. try lowering ampmin in 0,1 increments and observe throttle travel. When throttle is not just smooth but becomes sluggish return some previous increments until throttle reaction is acceptable.

4. change fweak value in +/-10Hz increments from starting point and observe torque in starting. This value is very dependent on battery voltage and is very subjective.

Now you find a hill or ramp and set car on it. You want to hold car in position on slope just using throttle pedal. If there parameters are not good motor will jump or will feel sluggish

1. add boost if motor is oscillating if it is smooth reduce it in 100 point increments until you get oscillation. Then return to last good value

2. reduce/increase ampmin in 0,25 increments untill you get oscilation in motor and return last good value

Now set the car into a hill to set fslipmax. Warning full throttle will be used. Be sure there is no other traffic!

Set fslipmax to chosen value (guess it at 2xfslipmin if you have no other way) and try to take off with full throttle.

If car feels sluggish with full throttle you have to add more slip.

If motor starts to jitter there is too much slip. Try to reduce it in 0.1Hz increments.

When you feel satisfied with settings save them and go on setting regen and braking effect.