Current loop setup
Current loop setup
PI di corrente sugli assi Q (coppia) e D (flusso), eseguito ad ogni interrupt PWM (Ts = 1/pwmFrqHz, 50 µs a 20 kHz).
| Variabile | Dir | Range | U.M. | Descrizione |
|---|---|---|---|---|
| KP_curr | In | 0 ÷ 2147483647 | Guadagno proporzionale del PID di corrente (comune a Q e D). | |
| KI_curr | In | 0 ÷ 2147483647 | Guadagno integrale del PID di corrente (comune a Q e D), per secondo: internamente KI·Ts. Anti-windup a clamp. |
|
| cur.StandStillParEn | In | 0 ÷ 1 | Default 0. 1 = ad asse fermo usa KP_curr_StandStill / KI_curr_StandStill. |
|
| KP_curr_StandStill | In | Default 0. Proporzionale ad asse fermo. |
||
| KI_curr_StandStill | In | Default 0. Integrale ad asse fermo. |
||
| Q_err | Out | A | Errore asse Q: iqRef − iq. |
|
| Q_feedfwd | Out | V | Feedforward Q: ωe·(Lambda_m + Inductor·id). 0 se Inductor[H] = 0. |
|
| Q_outPID | Out | V | Uscita PI Q (vq), saturata a ±0.95·V_pwr. |
|
| D_err | Out | A | Errore asse D: −idRef − id. |
|
| D_feedfwd | Out | V | Feedforward D: −ωe·Inductor·iq. 0 se Inductor[H] = 0. |
|
| D_outPID | Out | V | Uscita PI D (vd), saturata a ±0.95·V_pwr. |
|
| ana0 | Out | count | Lettura ADC corrente fase 0 (4 campioni, centrata, segno ANA0_SIGN). |
|
| ana1 | Out | count | Lettura ADC corrente fase 1 (segno ANA1_SIGN). |
|
| OffsetAna0 | Out | count | Offset ADC fase 0, stimato solo a motore spento e sottratto alla misura. | |
| OffsetAna1 | Out | count | Offset ADC fase 1, come OffsetAna0. |
|
| D_iSqOutClamp | Out | -1 ÷ 1 | Saturazione uscita PI D: ±1 = satura, 0 = lineare. |
|
| Q_iSqOutClamp | Out | -1 ÷ 1 | Saturazione uscita PI Q. Se resta a ±1 la tensione bus non basta per il riferimento richiesto. |
|
| cur_kf | In | Hz | Default 3000. Filtro passa-basso del 1° ordine sulle correnti misurate. 0 = disabilitato. |
Note
ωe= velocità elettrica (rad/s) calcolata dall'anello di velocità.Inductor[H]eLambda_m[Wb]si impostano in Motor setup;Resistor[ohm]non è usato in questa build.- Selezione set: InMotion con profilo attivo, con
|err_pos| > istpos(seistpos ≠ 0) o durante il test di corrente; altrimenti StandStill se abilitato. Il cambio non azzera l'integrale.
Variabili non presenti nel firmware MSM 01.44.21.08
Q_D_kf: sostituita dacur_kf.