Please feel free to make suggestions, make graphs or drawings etc. to make it as easy to read as possible. I think this is also a good place to submit parameter files. Maybe this should be an "editing thread" so whenever you come back with something new add it to your existing post. A wiki would be more suitable for this, so when I have the time I can set one up.
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: 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!
Here are some example values (Thanks arber!)
- 28 (0.8us)
- 64 (1us)
- 88 (1.4us)
- 116 (1.6us)
- 135 (2us)
- 155 (2.5us)
- 185 (3.3us)
- 195 (4us)