Small fix so that vvt2PID get updated in a correct frequency. (#1060)
This commit is contained in:
parent
46a7c6fda5
commit
fcb78b2e9f
|
@ -793,7 +793,7 @@ void vvtControl(void)
|
|||
if(configPage6.vvtLoadSource == VVT_LOAD_TPS) { currentStatus.vvt2TargetAngle = get3DTableValue(&vvt2Table, (currentStatus.TPS * 2), currentStatus.RPM); }
|
||||
else { currentStatus.vvt2TargetAngle = get3DTableValue(&vvt2Table, currentStatus.MAP, currentStatus.RPM); }
|
||||
|
||||
if( vvtCounter == 30) { vvt2PID.SetTunings(configPage10.vvtCLKP, configPage10.vvtCLKI, configPage10.vvtCLKD); //This only needs to be run very infrequently, once every 32 calls to vvtControl(). This is approx. once per second
|
||||
if( (vvtCounter & 31) == 1) { vvt2PID.SetTunings(configPage10.vvtCLKP, configPage10.vvtCLKI, configPage10.vvtCLKD); //This only needs to be run very infrequently, once every 32 calls to vvtControl(). This is approx. once per second
|
||||
vvt2PID.SetControllerDirection(configPage4.vvt2PWMdir); }
|
||||
|
||||
// safety check that the cam angles are ok. The engine will be totally undriveable if the cam sensor is faulty and giving wrong cam angles, so if that happens, default to 0 duty.
|
||||
|
|
Loading…
Reference in New Issue