Fix for boost PWM output not working correctly at 100% DC

This commit is contained in:
Josh Stewart 2022-01-04 22:58:44 +11:00
parent 5e7eebf301
commit 4e00f12415
3 changed files with 14 additions and 5 deletions

View File

@ -382,7 +382,6 @@ void boostControl()
else
{
boost_pwm_target_value = ((unsigned long)(currentStatus.boostDuty) * boost_pwm_max_count) / 10000; //Convert boost duty (Which is a % multipled by 100) to a pwm count
ENABLE_BOOST_TIMER(); //Turn on the compare unit (ie turn on the interrupt) if boost duty >0
}
}
else if (configPage4.boostType == CLOSED_LOOP_BOOST)
@ -422,10 +421,8 @@ void boostControl()
if(PIDcomputed == true)
{
boost_pwm_target_value = ((unsigned long)(currentStatus.boostDuty) * boost_pwm_max_count) / 10000; //Convert boost duty (Which is a % multipled by 100) to a pwm count
ENABLE_BOOST_TIMER(); //Turn on the compare unit (ie turn on the interrupt) if boost duty >0
}
}
}
else
{
@ -439,6 +436,18 @@ void boostControl()
boostDisable();
} //MAP above boost + hyster
} //Open / Cloosed loop
//Check for 100% duty cycle
if(currentStatus.boostDuty >= 10000)
{
DISABLE_BOOST_TIMER(); //Turn off the compare unit (ie turn off the interrupt) if boost duty is 100%
BOOST_PIN_HIGH(); //Turn on boost pin if duty is 100%
}
else if(currentStatus.boostDuty > 0)
{
ENABLE_BOOST_TIMER(); //Turn on the compare unit (ie turn on the interrupt) if boost duty is > 0
}
}
else { // Disable timer channel and zero the flex boost correction status
DISABLE_BOOST_TIMER();

View File

@ -435,7 +435,7 @@ extern struct table3d16RpmLoad ignitionTable; //16x16 ignition map
extern struct table3d16RpmLoad ignitionTable2; //16x16 ignition map
extern struct table3d16RpmLoad afrTable; //16x16 afr target map
extern struct table3d8RpmLoad stagingTable; //8x8 fuel staging table
extern struct table3d8RpmTps boostTable; //8x8 boost map
extern struct table3d8RpmLoad boostTable; //8x8 boost map
extern struct table3d8RpmLoad vvtTable; //8x8 vvt map
extern struct table3d8RpmLoad vvt2Table; //8x8 vvt map
extern struct table3d8RpmLoad wmiTable; //8x8 wmi map

View File

@ -14,7 +14,7 @@ struct table3d16RpmLoad ignitionTable; ///< 16x16 ignition map
struct table3d16RpmLoad ignitionTable2; ///< 16x16 ignition map
struct table3d16RpmLoad afrTable; ///< 16x16 afr target map
struct table3d8RpmLoad stagingTable; ///< 8x8 fuel staging table
struct table3d8RpmTps boostTable; ///< 8x8 boost map
struct table3d8RpmLoad boostTable; ///< 8x8 boost map
struct table3d8RpmLoad vvtTable; ///< 8x8 vvt map
struct table3d8RpmLoad vvt2Table; ///< 8x8 vvt2 map
struct table3d8RpmLoad wmiTable; ///< 8x8 wmi map