diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/MAX5715.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/MAX5715.c index 4fea1fd..d69b041 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/MAX5715.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/MAX5715.c @@ -218,6 +218,10 @@ ErrorStatus MAX5715Channel_setValue(const struct MAX5715_DAC* self, uint16_t val static ErrorStatus channelWrite(const struct DACDevice* self, uint32_t voltage) { + if (voltage > ((1 << MAX5715_RESOLUTION_IN_BITS) - 1)) + { + voltage = ((1 << MAX5715_RESOLUTION_IN_BITS) - 1); + } // MASK the uint32_t DAC value (voltage) with the resolution of the MAX5715 DAC return MAX5715Channel_setValue((struct MAX5715_DAC*)self, (((1 << MAX5715_RESOLUTION_IN_BITS) - 1) & voltage)); } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile index b77adbd..14a2027 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Makefile @@ -1,7 +1,7 @@ # Define release version for firmware here RELEASE_PRODUCT = \""S0\"" RELEASE_MAJOR = 0 -RELEASE_MINOR = 1 +RELEASE_MINOR = 2 RELEASE_BRANCH = 0 RELEASE_PATCH = 0 diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c index a003f3c..2532a3a 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c @@ -137,6 +137,17 @@ ErrorStatus Keypad_construct(struct Keypad* self, size_t numberOfRows, size_t nu // rxQueueItem.keyEvent = RELEASED; // // Put event in queue // xQueueSend(self->rxQueue, &rxQueueItem, 0); +//// +// rxQueueItem.rowCoordinate = 0; +// rxQueueItem.columnCoordinate = 0; +// rxQueueItem.keyEvent = PRESSED; +// // Put event in queue +// xQueueSend(self->rxQueue, &rxQueueItem, 0); +// rxQueueItem.rowCoordinate = 0; +// rxQueueItem.columnCoordinate = 0; +// rxQueueItem.keyEvent = RELEASED; +// // Put event in queue +// xQueueSend(self->rxQueue, &rxQueueItem, 0); // // rxQueueItem.rowCoordinate = 0; // rxQueueItem.columnCoordinate = 0; @@ -149,6 +160,17 @@ ErrorStatus Keypad_construct(struct Keypad* self, size_t numberOfRows, size_t nu // // Put event in queue // xQueueSend(self->rxQueue, &rxQueueItem, 0); // +// rxQueueItem.rowCoordinate = 1; +// rxQueueItem.columnCoordinate = 2; +// rxQueueItem.keyEvent = PRESSED; +// // Put event in queue +// xQueueSend(self->rxQueue, &rxQueueItem, 0); +// rxQueueItem.rowCoordinate = 1; +// rxQueueItem.columnCoordinate = 2; +// rxQueueItem.keyEvent = RELEASED; +// // Put event in queue +// xQueueSend(self->rxQueue, &rxQueueItem, 0); +// // rxQueueItem.rowCoordinate = 0; // rxQueueItem.columnCoordinate = 1; // rxQueueItem.keyEvent = PRESSED; diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h index e7055c9..6094094 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h @@ -48,7 +48,7 @@ #define HSB_MAINREPR_TASK_PRIORITY (2) #define HSB_MAINREPR_TASK_STACKSIZE (1024) #define HSB_MAINREPR_OOL_DURATION (20) -#define HSB_MAINREPR_OOL_VALUE (200) +#define HSB_MAINREPR_OOL_VALUE (300) #define HSB_ADC_ANODE_MIN_VOLTAGE (0) #define HSB_ADC_ANODE_MAX_VOLTAGE (10042) diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/ADConverter.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/ADConverter.c index deaa85f..b25c1b6 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/ADConverter.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/ADConverter.c @@ -27,6 +27,8 @@ #include "ADConverter.h" +#include "Logger.h" + // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- @@ -100,20 +102,21 @@ static int calculateVoltage(const struct ADConverter* self, uint32_t adcValue) int returnValue = 0; if (self->initialized) { - uint32_t maxAdcValue = ((1 << self->adcDevice->resolutionInBits) - 1); + int maxAdcValue = ((1 << self->adcDevice->resolutionInBits) - 1); - returnValue = adcValue * (self->maxVoltage - self->minVoltage); + returnValue = (int)adcValue * (self->maxVoltage - self->minVoltage); returnValue = returnValue / maxAdcValue; returnValue = returnValue + self->minVoltage; - if (returnValue < self->minVoltage) - { - returnValue = self->minVoltage; - } - else if (returnValue > self->maxVoltage) - { - returnValue = self->maxVoltage; - } + LOGGER_DEBUG(mainLog, "%X, %d, %d, %d", adcValue, self->maxVoltage, self->minVoltage, returnValue); +// if (returnValue < self->minVoltage) +// { +// returnValue = self->minVoltage; +// } +// else if (returnValue > self->maxVoltage) +// { +// returnValue = self->maxVoltage; +// } } else { diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/DAConverter.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/DAConverter.c index 516dd8a..f1e66a7 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/DAConverter.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/DAConverter.c @@ -27,6 +27,8 @@ #include "DAConverter.h" +#include "Logger.h" + // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- @@ -89,6 +91,7 @@ extern ErrorStatus DAConverter_setOutputVoltage(const struct DAConverter* self, uint32_t dacValue; dacValue = calculateDACValue(self, voltage); DACDevice_write(self->dacDevice, dacValue); + LOGGER_DEBUG(mainLog, "Voltage %d --- value %X", voltage, dacValue); } } else @@ -105,8 +108,8 @@ static uint32_t calculateDACValue(const struct DAConverter* self, int voltage) if (self->initialized) { uint32_t maxDacValue = ((1 << self->dacDevice->resolutionInBits) - 1); - dacValue = (voltage - self->minVoltage) * maxDacValue; - dacValue/= (self->maxVoltage - self->minVoltage); + dacValue = (abs(voltage) - abs(self->minVoltage)) * maxDacValue; + dacValue/= (abs(self->maxVoltage) - abs(self->minVoltage)); if (dacValue > maxDacValue) { dacValue = maxDacValue; diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/SignalProfileGenerator.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/SignalProfileGenerator.c index 8638123..13dac6e 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/SignalProfileGenerator.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/SignalProfileGenerator.c @@ -138,7 +138,7 @@ void SignalProfileGenerator_calculate(struct SignalProfileGenerator* self) { self->isProcessRunning = true; - self->signal = ((self->repairPreset->preset[self->currentPresetIndex].voltage * SPG_FIXPOINT_FACTOR - self->startVoltage * SPG_FIXPOINT_FACTOR) / self->repairPreset->preset[self->currentPresetIndex].softstartDuration) * (self->secondsCounter - self->startTime) + self->startVoltage * SPG_FIXPOINT_FACTOR; + self->signal = ((self->repairPreset->preset[self->currentPresetIndex].voltage * SPG_FIXPOINT_FACTOR - (self->startVoltage * SPG_FIXPOINT_FACTOR)) / self->repairPreset->preset[self->currentPresetIndex].softstartDuration) * (self->secondsCounter - self->startTime) + (self->startVoltage * SPG_FIXPOINT_FACTOR); self->signal = self->signal / SPG_FIXPOINT_FACTOR; incrementSecondsCounter(self); diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c index 19f106e..b203b86 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c @@ -240,6 +240,16 @@ static void initTask(void* parameters) // Construct the repair menu repairMenus_construct(); +// DAConverter_setOutputVoltage(dacRow1, -500); +// DAConverter_setOutputVoltage(dacRow2, -400); +// DAConverter_setOutputVoltage(dacRow3, -300); +// +// while (1) +// { +// LOGGER_DEBUG(mainLog, "%i %i %i", ADConverter_getInputVoltage(adcRow1), ADConverter_getInputVoltage(adcRow2), ADConverter_getInputVoltage(adcRow3)); +// vTaskDelay(1000); +// } + // xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle); diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c index 42fcadc..1cd7ab3 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c @@ -71,16 +71,36 @@ static const char cursorValue[2] = {0x7E, '\0'}; // TEMPORARY PRESET STORAGE -static const struct RepairPreset preset1 = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 60, .preset[0].voltage = 1000}; -static const struct RepairPreset preset2 = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 400, .preset[0].voltage = 3000}; -static const struct RepairPreset preset3 = {.numberOfStages = 1, .preset[0].softstartDuration = 300, .preset[0].duration = 600, .preset[0].voltage = 300}; -static const struct RepairPreset preset4 = {.numberOfStages = 1, .preset[0].softstartDuration = 400, .preset[0].duration = 800, .preset[0].voltage = 400}; -static const struct RepairPreset preset5 = {.numberOfStages = 1, .preset[0].softstartDuration = 500, .preset[0].duration = 1000, .preset[0].voltage = 500}; -static const struct RepairPreset preset6 = {.numberOfStages = 1, .preset[0].softstartDuration = 600, .preset[0].duration = 1200, .preset[0].voltage = 600}; -static const struct RepairPreset preset7 = {.numberOfStages = 1, .preset[0].softstartDuration = 700, .preset[0].duration = 1400, .preset[0].voltage = 700}; -static const struct RepairPreset preset8 = {.numberOfStages = 1, .preset[0].softstartDuration = 800, .preset[0].duration = 1600, .preset[0].voltage = 800}; -static const struct RepairPreset preset9 = {.numberOfStages = 2, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = 6000, .preset[1].softstartDuration = 100, .preset[1].duration = 1800, .preset[1].voltage = 8000}; -static const struct RepairPreset* presetArray[9] = {&preset1, &preset2, &preset3, &preset4, &preset5, &preset6, &preset7, &preset8, &preset9}; +static const struct RepairPreset preset1t = {.numberOfStages = 1, .preset[0].softstartDuration = 100, .preset[0].duration = 200, .preset[0].voltage = 1000}; +static const struct RepairPreset preset2t = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 400, .preset[0].voltage = 3000}; +static const struct RepairPreset preset3t = {.numberOfStages = 1, .preset[0].softstartDuration = 300, .preset[0].duration = 600, .preset[0].voltage = 300}; +static const struct RepairPreset preset4t = {.numberOfStages = 1, .preset[0].softstartDuration = 400, .preset[0].duration = 800, .preset[0].voltage = 400}; +static const struct RepairPreset preset5t = {.numberOfStages = 1, .preset[0].softstartDuration = 500, .preset[0].duration = 1000, .preset[0].voltage = 500}; +static const struct RepairPreset preset6t = {.numberOfStages = 1, .preset[0].softstartDuration = 120, .preset[0].duration = 240, .preset[0].voltage = 800}; +static const struct RepairPreset preset7t = {.numberOfStages = 1, .preset[0].softstartDuration = 700, .preset[0].duration = 1400, .preset[0].voltage = 700}; +static const struct RepairPreset preset8t = {.numberOfStages = 1, .preset[0].softstartDuration = 120, .preset[0].duration = 300, .preset[0].voltage = 4000}; +static const struct RepairPreset preset9t = {.numberOfStages = 2, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = 4000, .preset[1].softstartDuration = 100, .preset[1].duration = 1800, .preset[1].voltage = 5000}; + +static const struct RepairPreset preset1a = {.numberOfStages = 1, .preset[0].softstartDuration = 000, .preset[0].duration = 200, .preset[0].voltage = 1000}; +static const struct RepairPreset preset2a = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 400, .preset[0].voltage = 3000}; +static const struct RepairPreset preset3a = {.numberOfStages = 1, .preset[0].softstartDuration = 300, .preset[0].duration = 600, .preset[0].voltage = 300}; +static const struct RepairPreset preset4a = {.numberOfStages = 1, .preset[0].softstartDuration = 400, .preset[0].duration = 800, .preset[0].voltage = 400}; +static const struct RepairPreset preset5a = {.numberOfStages = 1, .preset[0].softstartDuration = 500, .preset[0].duration = 1000, .preset[0].voltage = 500}; +static const struct RepairPreset preset6a = {.numberOfStages = 1, .preset[0].softstartDuration = 600, .preset[0].duration = 1200, .preset[0].voltage = 800}; +static const struct RepairPreset preset7a = {.numberOfStages = 1, .preset[0].softstartDuration = 700, .preset[0].duration = 1400, .preset[0].voltage = 700}; +static const struct RepairPreset preset8a = {.numberOfStages = 1, .preset[0].softstartDuration = 120, .preset[0].duration = 300, .preset[0].voltage = 6000}; +static const struct RepairPreset preset9a = {.numberOfStages = 2, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = 6000, .preset[1].softstartDuration = 100, .preset[1].duration = 1800, .preset[1].voltage = 8000}; + +static const struct RepairPreset preset1n = {.numberOfStages = 1, .preset[0].softstartDuration = 100, .preset[0].duration = 200, .preset[0].voltage = -1000}; +static const struct RepairPreset preset2n = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 400, .preset[0].voltage = -1800}; +static const struct RepairPreset preset3n = {.numberOfStages = 1, .preset[0].softstartDuration = 300, .preset[0].duration = 600, .preset[0].voltage = -300}; +static const struct RepairPreset preset4n = {.numberOfStages = 1, .preset[0].softstartDuration = 400, .preset[0].duration = 800, .preset[0].voltage = -400}; +static const struct RepairPreset preset5n = {.numberOfStages = 1, .preset[0].softstartDuration = 500, .preset[0].duration = 1000, .preset[0].voltage = -500}; +static const struct RepairPreset preset6n = {.numberOfStages = 1, .preset[0].softstartDuration = 600, .preset[0].duration = 1200, .preset[0].voltage = -600}; +static const struct RepairPreset preset7n = {.numberOfStages = 1, .preset[0].softstartDuration = 700, .preset[0].duration = 1400, .preset[0].voltage = -700}; +static const struct RepairPreset preset8n = {.numberOfStages = 1, .preset[0].softstartDuration = 120, .preset[0].duration = 300, .preset[0].voltage = -1800}; +static const struct RepairPreset preset9n = {.numberOfStages = 2, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = -1200, .preset[1].softstartDuration = 100, .preset[1].duration = 1800, .preset[1].voltage = -1600}; +static const struct RepairPreset* presetArray[9]; // ----------------------------------------------------------------------------- // Function declarations @@ -161,6 +181,43 @@ ErrorStatus repairMenu_construct(struct RepairMenu* self, struct Display* displa if (returnValue == SUCCESS) { + if (PCBA_getInstance()->pcba == PCBA_CathodeMCP) + { + presetArray[0] = &preset1n; + presetArray[1] = &preset2n; + presetArray[2] = &preset3n; + presetArray[3] = &preset4n; + presetArray[4] = &preset5n; + presetArray[5] = &preset6n; + presetArray[6] = &preset7n; + presetArray[7] = &preset8n; + presetArray[8] = &preset9n; + } + else if (PCBA_getInstance()->pcba == PCBA_Anode) + { + presetArray[0] = &preset1a; + presetArray[1] = &preset2a; + presetArray[2] = &preset3a; + presetArray[3] = &preset4a; + presetArray[4] = &preset5a; + presetArray[5] = &preset6a; + presetArray[6] = &preset7a; + presetArray[7] = &preset8a; + presetArray[8] = &preset9a; + } + else if (PCBA_getInstance()->pcba == PCBA_Tesla) + { + presetArray[0] = &preset1t; + presetArray[1] = &preset2t; + presetArray[2] = &preset3t; + presetArray[3] = &preset4t; + presetArray[4] = &preset5t; + presetArray[5] = &preset6t; + presetArray[6] = &preset7t; + presetArray[7] = &preset8t; + presetArray[8] = &preset9t; + } + // Construct the menu based on PCBA information returnValue = repairMenu_createMenu(self); diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c index be68362..5848a34 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c @@ -232,7 +232,7 @@ static void repairProcess_task(void* parameters) LOGGER_DEBUG(mainLog, "Signal: %d, TimeToRemain %d", self->signalProfileGenerator.signal, SignalProfileGenerator_getRemainingTime(&self->signalProfileGenerator)); // Check for correct signal - if (self->signalProfileGenerator.signal >= 0) +// if (self->signalProfileGenerator.signal >= 0) { // Regulation is unique for each row // For TESLA repair only row 1 (out of 0,1,2) is used @@ -246,22 +246,8 @@ static void repairProcess_task(void* parameters) // Calculate the error self->row[loopCounter].pidError = self->signalProfileGenerator.signal - (int)self->row[loopCounter].lastADCValue; // Calculate the PID - int pidCalculate = PID_calculate(&self->row[loopCounter].pid, self->row[loopCounter].pidError); + self->row[loopCounter].lastDACValue = PID_calculate(&self->row[loopCounter].pid, self->row[loopCounter].pidError); - ///TODO MUST BE MOVED TO DACDevice - // Verify that pid value does not overflow the DAC - if (pidCalculate > 0xFFF) - { - self->row[loopCounter].lastDACValue = 0xFFF; - } - else if (pidCalculate < 0) - { - self->row[loopCounter].lastDACValue = 0; - } - else - { - self->row[loopCounter].lastDACValue = pidCalculate; - } // Check if the error condition exceeds the tolerated duration if (self->row[loopCounter].errorData.outOfLimitsCounter >= self->row[loopCounter].errorData.outOfLimitsDuration) diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcessRow.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcessRow.c index fefd73d..055ca86 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcessRow.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcessRow.c @@ -27,6 +27,8 @@ #include "repairProcessRow.h" +#include "PCBA.h" + // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- @@ -58,6 +60,9 @@ ErrorStatus repairProcessRow_construct(struct RepairProcessRow* self, const stru { ErrorStatus returnValue = SUCCESS; + int iMin = 0; + int iMax = 0; + if (!self->initialized) { if (returnValue == SUCCESS) @@ -75,7 +80,22 @@ ErrorStatus repairProcessRow_construct(struct RepairProcessRow* self, const stru if (returnValue == SUCCESS) { - returnValue = PID_construct(&self->pid, 3000, 2000, 0, 0, 100000000); + if (PCBA_getInstance()->pcba == PCBA_Anode) + { + iMin = 0; + iMax = 100000000; + } + else if (PCBA_getInstance()->pcba == PCBA_CathodeMCP) + { + iMin = -100000000; + iMax = 0; + } + else if (PCBA_getInstance()->pcba == PCBA_Tesla) + { + iMin = 0; + iMax = 100000000; + } + returnValue = PID_construct(&self->pid, 3000, 2000, 0, iMin, iMax); } if (returnValue == SUCCESS) {