► Added speed threshold to enable Phase Advance

- Phase Advance is enabled only when Motor Speed > n_motPhaAdvEna (400 rpm). This prevents that during a kick-down (100% duty cycle) the Phase advance kicks in even though we are running at low speed.
- This update improves the acceleration response
- no impact on code execution time
This commit is contained in:
EmanuelFeru
2019-06-11 21:24:08 +02:00
parent b828efffd5
commit bf9725159d
82 changed files with 11103 additions and 8747 deletions

View File

@@ -7,9 +7,9 @@
*
* Code generated for Simulink model 'BLDC_controller'.
*
* Model version : 1.879
* Model version : 1.883
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
* C/C++ source code generated on : Thu Jun 6 22:50:24 2019
* C/C++ source code generated on : Tue Jun 11 21:14:57 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -146,6 +146,9 @@ struct P_ {
int32_T n_commDeacvHi; /* Variable: n_commDeacvHi
* Referenced by: '<S14>/n_commDeacv'
*/
int32_T n_motPhaAdvEna; /* Variable: n_motPhaAdvEna
* Referenced by: '<S8>/n_motPhaAdvEna'
*/
int32_T r_commDCDeacv; /* Variable: r_commDCDeacv
* Referenced by: '<S14>/r_commDCDeacv'
*/
@@ -161,6 +164,14 @@ struct P_ {
int16_T dz_counterLo; /* Variable: dz_counterLo
* Referenced by: '<S14>/dz_counter'
*/
int16_T z_maxCntRst; /* Variable: z_maxCntRst
* Referenced by:
* '<S15>/z_counter'
* '<S15>/z_counter2'
* '<S16>/z_maxCntRst'
* '<S17>/Constant1'
* '<S17>/UnitDelay1'
*/
uint8_T z_ctrlTypSel; /* Variable: z_ctrlTypSel
* Referenced by: '<S7>/z_ctrlTypSel1'
*/