![]() |
![]() |
|
SensorlessFOCMotorControlLibrary
1.0
|
Data Structures | |
| struct | COMMAND |
| Define command structure. More... | |
| struct | ALIGN_Instance |
| Define align startup instance. More... | |
| struct | RAMPUP_Instance |
| Define rampup instance. More... | |
| struct | CONTROL |
| Define control structure. More... | |
| struct | FOC_Instance |
| Define FOC structure. More... | |
Macros | |
| #define | FLASH_PARAMS_BASE_ADDRESS HAL_MEMORY_FLASH_PARAMS_BASE_ADDRESS |
| Base address of the saved parameters in FLASH. | |
| #define | SRAM_PARAMS_BASE_ADDRESS HAL_MEMORY_SRAM_PARAMS_BASE_ADDRESS |
| Base address of the saved parameters in SRAM. | |
| #define | FOC_WRITE_FLAG_SIGNATURE (0x789ABCDE) |
| Memory Signature for write configurations flag. | |
| #define | FOC_CRC_SEED (0xFFFFFFFF) |
| Seed value for the CRC calculation. | |
| #define | FOC_WRITE_FLAG_SIZE_BYTES (4) |
| Size of the write flag in bytes. | |
| #define | FOC_CRC_SIZE_BYTES (4) |
| Size of the CRC in bytes. | |
| #define | FOC_FLASH_ACCESSKEY (0xA) |
| Access key for flash. | |
| #define | BYTES_TO_WORD_RSHIFT (2) |
| Right shift to convert bytes to words. | |
| #define | FOC_CONTROL_LOOP_FREQ_HZ (1000) |
| Frequency of the foc control loop. | |
| #define | CALIB_SAMPLES_2_POW (10) |
| Calibration samples in power of 2. | |
| #define | CALIB_AVG_SAMPLES (1 << CALIB_SAMPLES_2_POW) |
| Calibration samples to average. | |
| #define | FOC_PIIDQ_LMT_IQ _IQ(0.866) |
| Limit for the resultant voltage vector is 0.866 of vdc. | |
| #define | FOC_LOG_BUF_SIZE (1024) |
| Size of the FOC variable logging buffer. | |
| #define | FOC_USERVAR_UPDATE_MS (200) |
| Uservar update rate in milliseconds. | |
| #define | FOC_12_TO_8_BIT_OFFSET_SHIFT (4) |
| 12 bit offset to 8 bit shift factor | |
| #define | USER_DEFAULT_VOLTAGE_SF |
| Computing voltage scale factor. More... | |
| #define | USER_DEFAULT_CURRENT_SF |
| Computing current scale factor. More... | |
Functions | |
| void | FOC_init (FOC_Instance *handle) |
| Disables the PWM outputs. More... | |
| void | FOC_initFLASH (void) |
| Loads the saved variables from flash to sram if the crc is correct. | |
| void | FOC_initUserParamsFoc (USER_PARAMS *userParamsFoc, USER_PARAMS *userParams, uint32_t size) |
| Sets the values of foc vars as user vars + 1, it is used to later update the foc vars with user vars while update parameters. More... | |
| void | FOC_loadSavedParams (USER_PARAMS *dstParams, const USER_PARAMS *srcParams, uint32_t size) |
| Copies from source parameters to destination parameters. More... | |
| void | FOC_writeFLASH (USER_PARAMS *params, uint32_t size) |
| Erases and writes the variables to flash. More... | |
| void | FOC_setPara (FOC_Instance *handle, PARA_IDX paraIdx, int32_t value) |
| Sets the FOC parameter and updates the modules. More... | |
| void | FOC_setFault (FOC_Instance *handle) |
| Sets the state machine to fault state and disables PWM output. More... | |
| void | FOC_clearFault (FOC_Instance *handle) |
| Clears all the recorded faults. More... | |
| __STATIC_INLINE bool | FOC_getPwmEnableStatus (FOC_Instance *handle) |
| Gets the status of the PWM channels. More... | |
| __STATIC_INLINE void | FOC_setPwmEnableStatus (FOC_Instance *handle, bool enablePWMState) |
| Sets the status of the PWM channels. More... | |
| __STATIC_INLINE _iq | FOC_getPIIQLMT (FOC_Instance *handle) |
| Calculated the limits for the PI IQ integral outputs. More... | |
| __STATIC_INLINE void | FOC_setADCTrig (FOC_Instance *handle) |
| Set the PWM channel to trigger ADC. More... | |
| void | FOC_paramsUpdateProcess (FOC_Instance *handle, USER_VAR *userVar) |
| Does the process of updating the foc variables with the userVar. More... | |
| __STATIC_INLINE void | FOC_runMonitor (FOC_Instance *handle) |
| Checks the fault conditions. More... | |
| __STATIC_INLINE void | FOC_CONTROL_run (FOC_Instance *handle) |
| FOC motor control loop. More... | |
| __STATIC_INLINE void | FOC_run (FOC_Instance *handle) |
| Runs FOC loop. More... | |
| __STATIC_INLINE void | FOC_UpdateADCRaw (FOC_Instance *handle, uint16_t vdcAdc, uint16_t iaAdc, uint16_t ibAdc, uint16_t icAdc) |
| Updates the adc values in the FOC instance. More... | |
| __STATIC_INLINE void | FOC_loop (FOC_Instance *handle, uint16_t vdcAdc, uint16_t iaAdc, uint16_t ibAdc, uint16_t icAdc) |
| Runs the FOC tasks. More... | |
Variables | |
| IPD_Instance | ipd |
| Create a ipd instance. | |
| PWMGEN_Instance | pwmgen |
| Create a pwmgen instance. | |
| PI_Instance | piSpd |
| Create a PI speed instance. | |
| PI_Instance | piId |
| Create a PI Id instance. | |
| PI_Instance | piIq |
| Create a PI Iq instance. | |
| CLARKE_Instance | clarke |
| Create a clarke instance. | |
| PARK_Instance | park |
| Create a park instance. | |
| IPARK_Instance | ipark |
| Create a inverse park instance. | |
| SVGEN_Instance | svgen |
| Create a Space Vector PWM modulator instance. | |
| RMPCNTL_Instance | rc |
| Create a Ramp control instance for speed ramping. | |
| RAMPGEN_Instance | rg |
| Create a Ramp control instance for generating the open loop angle. | |
| PHASEVOLT_Instance | phaseVolt |
| Create a phaseVolt instance. | |
| EST_Instance | est |
| Create an estimator instance. | |
| uint32_t | offsetCalibcnt |
| Counter for offset calibration. | |
| uint32_t | calibSumA |
| Calibration sum of phase A. | |
| uint32_t | calibSumB |
| Calibration sum of phase B. | |
| uint32_t | calibSumC |
| Calibration sum of phase C. | |
| uint32_t | pAngle |
| Temp variable used for storing angle. | |
| uint8_t | userVarUpdateCounter |
| Counter for userVar update. | |
| #define USER_DEFAULT_VOLTAGE_SF |
Computing voltage scale factor.
Referenced by FOC_init().
| #define USER_DEFAULT_CURRENT_SF |
Computing current scale factor.
Referenced by FOC_init().
| void FOC_init | ( | FOC_Instance * | handle | ) |
Disables the PWM outputs.
| [in] | handle | A pointer to FOC instance |
References FOC_HAL::adcTrigHal, FOC_Instance::adcTrigVal, FOC_Instance::currentSF, FOC_clearFault(), FOC_CRC_SIZE_BYTES, FOC_initFLASH(), FOC_initUserParamsFoc(), FOC_setADCTrig(), FOC_WRITE_FLAG_SIZE_BYTES, FOC_Instance::hal, HAL_PWMDisableChannel(), HAL_supressCompEvent(), FOC_HAL::pwmAHal, FOC_HAL::pwmBHal, FOC_HAL::pwmCHal, USER_DEFAULT_CURRENT_SF, USER_DEFAULT_FOC_PWMADCSAMPLE, USER_DEFAULT_VOLTAGE_SF, USER_VAR::userParams, userParamsFoc, userVar, and FOC_Instance::voltageSF.
| void FOC_initUserParamsFoc | ( | USER_PARAMS * | userParamsFoc, |
| USER_PARAMS * | userParams, | ||
| uint32_t | size | ||
| ) |
Sets the values of foc vars as user vars + 1, it is used to later update the foc vars with user vars while update parameters.
| [in] | userParamsFoc | A pointer to user parameters used by foc |
| [in] | userParams | A pointer to user parameters set by user |
| [in] | size | Size of variables to init in bytes |
References BYTES_TO_WORD_RSHIFT.
Referenced by FOC_init(), and FOC_paramsUpdateProcess().
| void FOC_loadSavedParams | ( | USER_PARAMS * | dstParams, |
| const USER_PARAMS * | srcParams, | ||
| uint32_t | size | ||
| ) |
Copies from source parameters to destination parameters.
| [in] | dstParams | Pointer to destination parameters |
| [in] | srcParams | Pointer to source parameters |
| [in] | size | Size of variables to init in bytes |
Referenced by FOC_initFLASH(), and FOC_paramsUpdateProcess().
| void FOC_writeFLASH | ( | USER_PARAMS * | params, |
| uint32_t | size | ||
| ) |
Erases and writes the variables to flash.
| [in] | params | Pointer to the data to be written to flash |
| [in] | size | Size of variables to init in bytes |
References USER_PARAMS::crc, FLASH_PARAMS_BASE_ADDRESS, FOC_CRC_SEED, FOC_CRC_SIZE_BYTES, FOC_WRITE_FLAG_SIGNATURE, FOC_WRITE_FLAG_SIZE_BYTES, HAL_copyMemoryBlock(), HAL_eraseFLASH(), HAL_getCRC(), HAL_unprotectFLASH(), savedParams, and USER_PARAMS::writeFlag.
Referenced by FOC_initFLASH(), and FOC_paramsUpdateProcess().
| void FOC_setPara | ( | FOC_Instance * | handle, |
| PARA_IDX | paraIdx, | ||
| int32_t | value | ||
| ) |
Sets the FOC parameter and updates the modules.
| [in] | handle | A pointer to FOC instance |
| [in] | paraIdx | Index of the parameter to set. USER parameters of PARA_IDX |
| [in] | value | Value to be set |
References _IQdiv_rts, _IQmpy_rts, CONTROL::align, ALIGN_Instance::alignCurr, ALIGN_Instance::alignTime, FOC_Instance::cmd, FOC_Instance::control, FOC_Instance::csaDiv, COMMAND::directionReversal, DRV_CSA_GAIN, DRV_HANDLE, DRV_setCsaGain, est, FOC_CONTROL_LOOP_FREQ_HZ, FOC_CSA_GAIN_MAX, FOC_PWM_FREQ_MAX, FOC_Instance::hal, HAL_getPWMLoadValue(), HAL_setDeadband(), HAL_setPWMFreq(), HAL_setRepeatCounter(), ipd, COMMAND::outerLoop, FOC_Instance::overCurrentLimit, FOC_Instance::overVoltageLimit, PARA_checkEST(), PARA_checkIPD(), PARA_checkPIID(), PARA_checkPIIQ(), PARA_checkPISPD(), PARA_checkPWMGEN(), PARA_checkRC(), PARA_checkRG(), PARA_IDX_SYS_DEADBAND_CYC, PARA_IDX_SYS_PWMPERIOD, PARA_IDX_SYS_SAMPLE_FREQ, PARA_IDX_SYS_TS, PARA_IDX_USER_ALIGN_CURRENT, PARA_IDX_USER_ALIGN_TIME, PARA_IDX_USER_AMP_GAIN, PARA_IDX_USER_DEADBAND, PARA_IDX_USER_DIRECTION_REVERSE, PARA_IDX_USER_OUTER_LOOP, PARA_IDX_USER_OVER_CURRENT_LIMIT, PARA_IDX_USER_OVER_VOLTAGE_LIMIT, PARA_IDX_USER_PISPD_DIV, PARA_IDX_USER_PWMFREQ, PARA_IDX_USER_RAMPUP_CURRENT, PARA_IDX_USER_RAMPUP_RATE, PARA_IDX_USER_RAMPUP_TARGET, PARA_IDX_USER_SLOW_FIRST_CYC_FREQ, PARA_IDX_USER_STARTUP_METHOD, PARA_IDX_USER_UNDER_VOLTAGE_LIMIT, FOC_Instance::parameter, FOC_Instance::PISpdExecDivider, FOC_HAL::pwmAHal, CONTROL::rampup, RAMPUP_Instance::rampupCurr, RAMPUP_Instance::rate, CONTROL::slowFirstCycFreq, CONTROL::startupMethod, RAMPUP_Instance::target, and FOC_Instance::underVoltageLimit.
Referenced by FOC_paramsUpdateProcess().
| void FOC_setFault | ( | FOC_Instance * | handle | ) |
Sets the state machine to fault state and disables PWM output.
| [in] | handle | A pointer to FOC instance |
References FOC_Instance::cmd, CNTRL_REGS::cntrl1, USER_VAR::controlRegs, CNTRL_REG_1::enableMotor, FOC_Instance::enablePWM, FOC_setPwmEnableStatus(), FOC_Instance::hal, HAL_PWMDisableChannel(), MOTOR_FAULT, MOTOR_STATE_STOP, COMMAND::motorState, FOC_HAL::pwmAHal, FOC_HAL::pwmBHal, FOC_HAL::pwmCHal, FOC_Instance::state, and userVar.
Referenced by FOC_runMonitor().
| void FOC_clearFault | ( | FOC_Instance * | handle | ) |
Clears all the recorded faults.
| [in] | handle | A pointer to FOC instance |
References FAULT_STATUS::all, DRV_HANDLE, FAULT_INPUT_CLEAR, and FOC_Instance::faultStatus.
Referenced by FOC_init(), and FOC_paramsUpdateProcess().
| __STATIC_INLINE bool FOC_getPwmEnableStatus | ( | FOC_Instance * | handle | ) |
Gets the status of the PWM channels.
| [in] | handle | A pointer to FOC instance |
| true | The PWM channels are enabled |
| false | The PWM channels are disabled |
References FOC_Instance::enablePWMStatus.
Referenced by FOC_run().
| __STATIC_INLINE void FOC_setPwmEnableStatus | ( | FOC_Instance * | handle, |
| bool | enablePWMState | ||
| ) |
Sets the status of the PWM channels.
| [in] | handle | A pointer to FOC instance |
| [in] | enablePWMState | PWM state to be set |
References FOC_Instance::enablePWMStatus, and FOC_LOG_BUF_SIZE.
Referenced by FOC_CONTROL_run(), FOC_run(), and FOC_setFault().
| __STATIC_INLINE _iq FOC_getPIIQLMT | ( | FOC_Instance * | handle | ) |
Calculated the limits for the PI IQ integral outputs.
| [in] | handle | A pointer to FOC instance |
References FOC_PIIDQ_LMT_IQ, PI_Instance::out, and FOC_Instance::vdc.
Referenced by FOC_run().
| __STATIC_INLINE void FOC_setADCTrig | ( | FOC_Instance * | handle | ) |
Set the PWM channel to trigger ADC.
| [in] | handle | A pointer to FOC instance |
References FOC_HAL::adcTrigHal, FOC_Instance::adcTrigVal, FOC_paramsUpdateProcess(), FOC_Instance::hal, HAL_setPWMCcValue(), and userVar.
Referenced by FOC_init(), and FOC_loop().
| void FOC_paramsUpdateProcess | ( | FOC_Instance * | handle, |
| USER_VAR * | userVar | ||
| ) |
Does the process of updating the foc variables with the userVar.
| [in] | handle | A pointer to FOC instance |
| [in] | userVar | A pointer to user variables |
References FAULT_STATUS::all, CNTRL_REG_1::clearFault, FOC_Instance::cmd, CNTRL_REGS::cntrl1, USER_VAR::controlRegs, defaultParams, CNTRL_REG_1::defaultRead, COMMAND::disCL, CNTRL_REG_1::disCL, CNTRL_REG_1::enableMotor, est, STATUS_REGS::faultStatus, FOC_Instance::faultStatus, PI_Instance::fbk, CNTRL_REG_1::flashAccessKey, CNTRL_REG_1::flashRead, CNTRL_REG_1::flashWrite, FOC_clearFault(), FOC_CRC_SIZE_BYTES, FOC_FLASH_ACCESSKEY, FOC_initUserParamsFoc(), FOC_loadSavedParams(), FOC_setPara(), FOC_WRITE_FLAG_SIZE_BYTES, FOC_writeFLASH(), STATUS_REGS::idCurr, STATUS_REGS::idCurrRef, COMMAND::IdRef, CNTRL_REGS::idRef, STATUS_REGS::iqCurr, STATUS_REGS::iqCurrRef, COMMAND::IqRef, CNTRL_REGS::iqRef, MOTOR_FAULT, MOTOR_STANDBY, MOTOR_STATE_START, MOTOR_STATE_STOP, COMMAND::motorState, STATUS_REGS::motorState, PARA_IDX_USER_MAX, PARA_IDX_USER_RS, PI_Instance::ref, FOC_Instance::runUserVarUpdate, savedParams, STATUS_REGS::speedFbk, COMMAND::speedRef, CNTRL_REGS::speedRef, STATUS_REGS::speedRef, FOC_Instance::state, USER_VAR::statusRegs, USER_VAR::userParams, userParamsFoc, FOC_Instance::userVarsLoadCmplt, STATUS_REGS::vdc, and FOC_Instance::vdc.
Referenced by FOC_setADCTrig().
| __STATIC_INLINE void FOC_runMonitor | ( | FOC_Instance * | handle | ) |
Checks the fault conditions.
| [in] | handle | A pointer to FOC instance |
References FAULT_STATUS::bits, DRV_HANDLE, FAULT_STATUS_BITS::extFaultIn, FAULT_INPUT_STATUS, FOC_Instance::faultStatus, FOC_setFault(), FOC_Instance::ia, FOC_Instance::ib, FAULT_STATUS_BITS::ocp, FOC_Instance::overCurrentLimit, FOC_Instance::overVoltageLimit, FAULT_STATUS_BITS::ovlo, FOC_Instance::underVoltageLimit, FAULT_STATUS_BITS::uvlo, and FOC_Instance::vdc.
Referenced by FOC_CONTROL_run().
| __STATIC_INLINE void FOC_CONTROL_run | ( | FOC_Instance * | handle | ) |
FOC motor control loop.
| [in] | handle | A pointer to FOC instance |
References CONTROL::align, ALIGN_Instance::alignCurr, ALIGN_Instance::alignTime, FAULT_STATUS::all, RAMPGEN_Instance::Angle, ANGLE_MATH_2PIp3_PU, CLARKE_reset(), FOC_Instance::cmd, ALIGN_Instance::cnt, FOC_Instance::control, COMMAND::directionReversal, COMMAND::disCL, FOC_Instance::enablePWM, FOC_Instance::faultStatus, PI_Instance::fbk, FOC_runMonitor(), FOC_setPwmEnableStatus(), FOC_STARTUP_ALIGN, FOC_STARTUP_IPD, FOC_STARTUP_SLOW_FIRST, FOC_USERVAR_UPDATE_MS, RAMPGEN_Instance::Freq, IPARK_reset(), MOTOR_ALIGN, MOTOR_FAULT, MOTOR_IDLE, MOTOR_IPD, MOTOR_RAMPUP, MOTOR_RUN, MOTOR_SLOW_FIRST_CYC, MOTOR_STANDBY, MOTOR_STATE_START, MOTOR_STATE_STOP, MOTOR_STOP, MOTOR_TRANSIT, COMMAND::motorState, FOC_Instance::offsetCalib, PI_Instance::outI, PARK_reset(), PI_reset(), RAMPUP_Instance::rampOut, CONTROL::rampup, RAMPUP_Instance::rampupCurr, RAMPUP_Instance::rate, RC_reset(), PI_Instance::ref, RG_reset(), FOC_Instance::runUserVarUpdate, RMPCNTL_Instance::SetpointValue, CONTROL::slowFirstCycCmplt, CONTROL::slowFirstCycFreq, CONTROL::startupMethod, TRANSIT_Instance::state, FOC_Instance::state, RAMPUP_Instance::target, CONTROL::transit, TRANSIT_reset(), and TRANSIT_STATE_COMPLETE.
| __STATIC_INLINE void FOC_run | ( | FOC_Instance * | handle | ) |
Runs FOC loop.
| [in] | handle | A pointer to FOC instance |
References PARK_Instance::Alpha, IPARK_Instance::Alpha, CLARKE_Instance::Alpha, PARK_Instance::Angle, RAMPGEN_Instance::Angle, ANGLE_getSine(), ANGLE_MATH_PIp2_PU, CLARKE_Instance::As, PARK_Instance::Beta, IPARK_Instance::Beta, CLARKE_Instance::Beta, CLARKE_Instance::Bs, CLARKE_run(), FOC_Instance::cmd, FOC_Instance::control, IPARK_Instance::Cosine, PARK_Instance::Cosine, FOC_Instance::csaDiv, FOC_Instance::currentSF, PHASEVOLT_Instance::DcBusVolt, COMMAND::directionReversal, IPARK_Instance::Ds, PARK_Instance::Ds, PWMGEN_Instance::dutyA, PWMGEN_Instance::dutyB, PWMGEN_Instance::dutyC, FOC_Instance::enablePWM, PI_Instance::fbk, FOC_12_TO_8_BIT_OFFSET_SHIFT, FOC_getPIIQLMT(), FOC_getPwmEnableStatus(), FOC_OUTER_LOOP_SPEED, FOC_PIIDQ_LMT_IQ, FOC_setPwmEnableStatus(), RAMPGEN_Instance::Freq, FOC_Instance::hal, HAL_PWMDisableChannel(), HAL_PWMEnableChannel(), HAL_setPWMCcValue(), FOC_Instance::ia, FOC_Instance::ib, COMMAND::IdRef, IPARK_run(), COMMAND::IqRef, PWMGEN_Instance::MfuncC1, PWMGEN_Instance::MfuncC2, PWMGEN_Instance::MfuncC3, PHASEVOLT_Instance::MfuncV1, PHASEVOLT_Instance::MfuncV2, PHASEVOLT_Instance::MfuncV3, MOTOR_ALIGN, MOTOR_IDLE, MOTOR_IPD, MOTOR_RAMPUP, MOTOR_RUN, MOTOR_SLOW_FIRST_CYC, MOTOR_STANDBY, MOTOR_STOP, MOTOR_TRANSIT, FOC_Instance::offsetA, FOC_Instance::offsetB, FOC_Instance::offsetC, RAMPGEN_Instance::Out, PI_Instance::out, COMMAND::outerLoop, PI_Instance::outIMax, PI_Instance::outIMin, PI_Instance::outMax, PI_Instance::outMin, PARK_run(), PHASEVOLT_run(), PI_run(), FOC_Instance::PISpdExecCount, FOC_Instance::PISpdExecDivider, FOC_HAL::pwmAHal, FOC_HAL::pwmBHal, FOC_HAL::pwmCHal, PWMGEN_run(), PARK_Instance::Qs, IPARK_Instance::Qs, RAMPUP_Instance::rampOut, CONTROL::rampup, RC_run(), PI_Instance::ref, RG_run(), RMPCNTL_Instance::SetpointValue, IPARK_Instance::Sine, PARK_Instance::Sine, CONTROL::slowFirstCycCmplt, COMMAND::speedRef, FOC_Instance::state, SVGEN_run(), SVGEN_Instance::Ta, RMPCNTL_Instance::TargetValue, SVGEN_Instance::Tb, SVGEN_Instance::Tc, CONTROL::transit, TRANSIT_run(), SVGEN_Instance::Ualpha, SVGEN_Instance::Ubeta, PHASEVOLT_Instance::Valpha, PHASEVOLT_Instance::Vbeta, and FOC_Instance::vdc.
Referenced by FOC_loop().
| __STATIC_INLINE void FOC_UpdateADCRaw | ( | FOC_Instance * | handle, |
| uint16_t | vdcAdc, | ||
| uint16_t | iaAdc, | ||
| uint16_t | ibAdc, | ||
| uint16_t | icAdc | ||
| ) |
Updates the adc values in the FOC instance.
| [in] | handle | A pointer to FOC instance |
| [in] | vdcAdc | ADC reading of dc bus |
| [in] | iaAdc | ADC reading from A phase |
| [in] | ibAdc | ADC reading from B phase |
| [in] | icAdc | ADC reading from C phase |
References FOC_Instance::iaAdc, FOC_Instance::ibAdc, FOC_Instance::icAdc, and FOC_Instance::vdcAdc.
Referenced by FOC_loop().
| __STATIC_INLINE void FOC_loop | ( | FOC_Instance * | handle, |
| uint16_t | vdcAdc, | ||
| uint16_t | iaAdc, | ||
| uint16_t | ibAdc, | ||
| uint16_t | icAdc | ||
| ) |
Runs the FOC tasks.
| [in] | handle | A pointer to FOC instance |
| [in] | vdcAdc | 12 bit ADC reading of dc bus |
| [in] | iaAdc | 12 bit ADC reading from A phase |
| [in] | ibAdc | 12 bit ADC reading from B phase |
| [in] | icAdc | 12 bit ADC reading from C phase |
References CALIB_AVG_SAMPLES, CALIB_SAMPLES_2_POW, calibSumA, calibSumB, calibSumC, FOC_Instance::cmd, FOC_Instance::csaDiv, FOC_Instance::currentSF, COMMAND::directionReversal, FOC_run(), FOC_setADCTrig(), FOC_UpdateADCRaw(), FOC_Instance::hal, HAL_PWMDisableChannel(), HAL_PWMEnableChannel(), HAL_setPWMCcValue(), PWMGEN_Instance::HalfPerMax, FOC_Instance::ia, FOC_Instance::iaAdc, FOC_Instance::ib, FOC_Instance::ibAdc, FOC_Instance::icAdc, FOC_Instance::isrTicker, FOC_Instance::offsetA, FOC_Instance::offsetB, FOC_Instance::offsetC, FOC_Instance::offsetCalib, FOC_HAL::pwmAHal, FOC_HAL::pwmBHal, FOC_HAL::pwmCHal, FOC_Instance::userVarsLoadCmplt, FOC_Instance::vdc, FOC_Instance::vdcAdc, and FOC_Instance::voltageSF.