Allow separate bars calibration

This commit is contained in:
Josh Stewart 2017-11-28 10:09:54 +11:00
parent 6ba1e4f946
commit 1e432514f9
4 changed files with 26 additions and 3 deletions

View File

@ -245,7 +245,9 @@ page = 2
iacCLmaxDuty = scalar, U08, 62, "%", 1.0, 0.0, 0.0, 100.0, 0
boostMinDuty = scalar, U08, 63, "%", 1.0, 0.0, 0.0, 100.0, 0 ; Minimum and maximum duty cycles for boost control
unused2-64 = array, U08, 64, [63], "%", 1.0, 0.0, 0.0, 255, 0
baroMin = scalar, S08, 64, "kpa", 1.0, 0.0, -100, 127.0, 0
baroMax = scalar, U16, 65, "kpa", 1.0, 0.0, 0.0, 25500, 0
unused2-67 = array, U08, 67, [60], "%", 1.0, 0.0, 0.0, 255, 0
;--------------------------------------------------
@ -763,6 +765,8 @@ page = 10
defaultValue = dutyLim, 100
defaultValue = mapMin, 10
defaultValue = mapMax, 260
defaultValue = baroMin, 10
defaultValue = baroMax, 260
defaultValue = fpPrime, 3
defaultValue = TrigFilter, 0
defaultValue = ignCranklock,0
@ -1420,6 +1424,21 @@ menuDialog = main
field = "Use external Baro sensor", useExtBaro
field = "Analog pin to use for ext. Baro sensor", baroPin, { useExtBaro }
settingSelector = "Common Pressure Sensors", { useExtBaro }
settingOption = "MPX4115", baroMin=10, baroMax=118 ; https://www.nxp.com/docs/en/data-sheet/MPX4115.pdf
settingOption = "MPX4250", baroMin=10, baroMax=260 ; https://www.nxp.com/docs/en/data-sheet/MPX4250A.pdf Vout = VCC x (P x 0.004 0.04)
settingOption = "GM 1-BAR", baroMin=10, baroMax=105 ; https://speeduino.com/wiki/index.php/File:GM_Table.gif
settingOption = "GM 2-BAR", baroMin=9, baroMax=208 ; https://speeduino.com/wiki/index.php/File:GM_Table.gif
settingOption = "GM 3-BAR", baroMin=1, baroMax=315 ; VOUT = VS*(.00318*P-.00353)
settingOption = "MPXH6300", baroMin=1, baroMax=315 ; https://www.nxp.com/docs/en/data-sheet/MPXH6300A.pdf VOUT = VS*(.00318*P-.00353)
settingOption = "MPX5700", baroMin=-31, baroMax=746 ; https://www.nxp.com/docs/en/data-sheet/MPX5700.pdf Vout = VS*(0.0012858*P+0.04)
settingOption = "MPX6400", baroMin=3, baroMax=416 ; https://www.nxp.com/docs/en/data-sheet/MPXH6400A.pdf VOUT = VS x (0.002421xP0.00842)
settingOption = "Denso 079800", baroMin=0, baroMax=173 ; http://speeduino.com/forum/viewtopic.php?f=18&t=510&p=7023#p7021
settingOption = "VW/Audi/Porsche 250kPa", baroMin=26, baroMax=250 ; http://speeduino.com/forum/viewtopic.php?p=17502#p17502
field = "kPa At 0.0 Volts", baroMin, { useExtBaro }
field = "kPa At 5.0 Volts", baroMax, { useExtBaro }
dialog = boostSettings, "Boost Control"
topicHelp = "http://speeduino.com/wiki/index.php/Boost_Control"
field = "Boost Control Enabled", boostEnabled

View File

@ -395,7 +395,10 @@ struct config1 {
byte iacCLmaxDuty;
byte boostMinDuty;
byte unused1_64[64];
int8_t baroMin; //Must be signed
uint16_t baroMax;
byte unused1_64[61];
#if defined(CORE_AVR)
};

View File

@ -393,6 +393,7 @@ static inline void disableIdle()
}
else if ( (configPage3.iacAlgorithm == IAC_ALGORITHM_STEP_CL) || (configPage3.iacAlgorithm == IAC_ALGORITHM_STEP_OL) )
{
//Only disable the stepper motor if homing is completed
if( isStepperHomed() == true )
{
digitalWrite(pinStepperEnable, HIGH); //Disable the DRV8825

View File

@ -227,7 +227,7 @@ void readBaro()
currentStatus.baroADC = ADC_FILTER(tempReading, ADCFILTER_BARO, currentStatus.baroADC); //Very weak filter
currentStatus.baro = fastMap10Bit(currentStatus.baroADC, configPage1.mapMin, configPage1.mapMax); //Get the current MAP value
currentStatus.baro = fastMap10Bit(currentStatus.baroADC, configPage1.baroMin, configPage1.baroMax); //Get the current MAP value
}
}