基于STM32FOC4 - 2MC Application 用户接口函数my

更新时间:2023-09-11 01:41:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

基于STM32FOC4.2MC Application 用户接口函数(调用)

MC_h

/**

****************************************************************************** * @file MC.h

* @author STMicroelectronics - System Lab - MC Team * @version 4.2.0

* @date 20-Aug-2015 18:06

* @brief Access point to the MC API.

* To use any of the MC API function in a user code follow the steps: * 1) #include \

* 2) Create the CMCI local reference: CMCI oMCI

* 3) Get reference of MCI via: oMCI = GetMCI(M1) or oMCI = GetMCI(M1) * 4) Call any MCI function:

* e.g. MCI_ExecSpeedRamp(oMCI,speed,duration); * To use any MCT function in a user code follow the steps: * 1) #include \

* 2) Create the CMCT local reference: CMCT oMCT

* 3) Get reference of MCT via: oMCT = GetMCT(M1) or oMCT = GetMCT(M1) * 4) Get reference of specific object to tune: * e.g. CPI oPI = MCT_GetSpeedLoopPID(oMCT); * 5) Call any MCT function related to that object: * e.g. PI_SetKP(oPI,newKPValue);

* It is also available the DAC related function like:

* e.g. MC_SetDAC(DAC_CH0, MC_PROTOCOL_REG_OBS_EL_ANGLE); * e.g. MC_SetUserDAC(DAC_USER1,value);

******************************************************************************/

/** @defgroup MC_exported_methods MC exported methods * @{ */

/**

* @brief This function returns the reference of the MCInterface relative to * the selected drive.

* @param bMotor Motor reference number defined * \\link Motors_reference_number here \\endlink

* @retval CMCI Reference to MCInterface relative to the selected drive. * Note: it can be MC_NULL if MCInterface of selected drive is not * allocated. */

CMCI GetMCI(uint8_t bMotor);

/**

* @brief This function returns the reference of the MCTuning relative to * the selected drive.

* @param bMotor Motor reference number defined * \\link Motors_reference_number here \\endlink

* @retval CMCI Reference to MCInterface relative to the selected drive. * Note: it can be MC_NULL if MCInterface of selected drive is not * allocated. */

CMCT GetMCT(uint8_t bMotor);

/**

* @brief This function requests a user-defined regular conversion. All user * defined conversion requests must be performed inside routines with the

* same priority level. If previous regular conversion request is pending * this function has no effect, for this reason is better to call the * MC_RegularConvState and check if the state is UDRC_STATE_IDLE before * to call MC_RequestRegularConv.

* @param bChannel ADC channel used for the regular conversion.

* @param bSamplTime Sampling time selection, ADC_SampleTime_nCycles defined in * stm32fxxx_adc.h see ADC_sampling_times. */

void MC_RequestRegularConv(uint8_t bChannel, uint8_t bSamplTime);

/**

* @brief Get the last user-defined regular conversion.

* @retval uint16_t It returns converted value or oxFFFF for conversion error. * This function returns a valid result if the state returned by * MC_RegularConvState is UDRC_STATE_EOC. */

uint16_t MC_GetRegularConv(void);

/**

* @brief Use this function to know the status of the last requested regular * conversion.

* @retval UDRC_State_t The state of the last user-defined regular conversion. * It can be one of the following values:

* UDRC_STATE_IDLE no regular conversion request pending.

* UDRC_STATE_REQUESTED regular conversion has been requested and not * completed.

* UDRC_STATE_EOC regular conversion has been completed but not readed * from the user. */

UDRC_State_t MC_RegularConvState(void);

/**

* @brief This method is used to set up the DAC outputs. The selected * variables will be provided in the related output channels. * @param bChannel the DAC channel to be programmed. It must be one of the * exported channels decribed \\link DAC_Channels here\\endlink. * E.g. DAC_CH0.

* @param bVariable the variables to be provided in out through the selected * channel. It must be one of the exported UI register described * \\link MC_Protocol_REG here\\endlink. E.g. MC_PROTOCOL_REG_I_A. * @retval none. */

void MC_SetDAC(DAC_Channel_t bChannel, MC_Protocol_REG_t bVariable);

/**

* @brief This method is used to set the value of the \ * @param bUserChNumber the \ * the channels described \\link DAC_UserChannel here\\endlink can be * used. E.g. DAC_USER1.

* @param hValue 16bit signed value to be put in output. * @retval none. */

void MC_SetUserDAC(DAC_UserChannel_t bUserChNumber, int16_t hValue);

MCInterfaceClass_h

/**

****************************************************************************** * @file MCInterfaceClass.h

* @author STMicroelectronics - System Lab - MC Team * @version 4.2.0

* @date 20-Aug-2015 18:06

* @brief This file contains interface of MCInterface class

******************************************************************************/

/**

* @brief This is a buffered command to set a motor speed ramp. This commands * don't become active as soon as it is called but it will be executed * when the oSTM state is START_RUN or RUN. User can check the status * of the command calling the MCI_IsCommandAcknowledged method. * @param this related object of class CMCI.

* @param hFinalSpeed is the value of mechanical rotor speed reference at the * end of the ramp expressed in tenths of HZ.

* @param hDurationms the duration of the ramp expressed in milliseconds. It * is possible to set 0 to perform an instantaneous change in the * value. * @retval none. */

void MCI_ExecSpeedRamp(CMCI this, int16_t hFinalSpeed, uint16_t hDurationms);

/**

* @brief This is a buffered command to set a motor torque ramp. This commands * don't become active as soon as it is called but it will be executed * when the oSTM state is START_RUN or RUN. User can check the status * of the command calling the MCI_IsCommandAcknowledged method. * @param this related object of class CMCI.

* @param hFinalTorque is the value of motor torque reference at the end of * the ramp. This value represents actually the Iq current expressed in * digit.

* To convert current expressed in Amps to current expressed in digit * is possible to use the formula:

* Current (digit) = [Current(Amp) * 65536 * Rshunt * Aop] / Vdd micro. * @param hDurationms the duration of the ramp expressed in milliseconds. It * is possible to set 0 to perform an instantaneous change in the * value. * @retval none. */

void MCI_ExecTorqueRamp(CMCI this, int16_t hFinalTorque, uint16_t hDurationms);

/**

* @brief This is a buffered command to set directly the motor current * references Iq and Id. This commands don't become active as soon as * it is called but it will be executed when the oSTM state is * START_RUN or RUN. User can check the status of the command calling * the MCI_IsCommandAcknowledged method. * @param this related object of class CMCI.

* @param Iqdref current references on qd reference frame in Curr_Components * format. * @retval none. */

void MCI_SetCurrentReferences(CMCI this, Curr_Components Iqdref);

/**

* @brief This is a user command used to begin the start-up procedure. * If the state machine is in IDLE state the command is executed * instantaneously otherwise the command is discarded. User must take * care of this possibility by checking the return value.

* Before calling MCI_StartMotor it is mandatory to execute one of * these commands:\\n * MCI_ExecSpeedRamp\\n * MCI_ExecTorqueRamp\\n * MCI_SetCurrentReferences\\n

* Otherwise the behaviour in run state will be unpredictable.\\n * Note: The MCI_StartMotor command is used just to begin the * start-up procedure moving the state machine from IDLE state to * IDLE_START. The command MCI_StartMotor is not blocking the execution * of project until the motor is really running; to do this, the user * have to check the state machine and verify that the RUN state (or * any other state) has been reached. * @param this related object of class CMCI.

* @retval bool It returns TRUE if the command is successfully executed * otherwise it return FALSE. */

bool MCI_StartMotor(CMCI this);

/**

* @brief This is a user command used to begin the stop motor procedure. * If the state machine is in RUN or START states the command is * executed instantaneously otherwise the command is discarded. User * must take care of this possibility by checking the return value.\\n * Note: The MCI_StopMotor command is used just to begin the * stop motor procedure moving the state machine to ANY_STOP. * The command MCI_StopMotor is not blocking the execution of project * until the motor is really stopped; to do this, the user have to * check the state machine and verify that the IDLE state has been * reached again.

* @param this related object of class CMCI.

* @retval bool It returns TRUE if the command is successfully executed * otherwise it return FALSE. */

bool MCI_StopMotor(CMCI this);

/**

* @brief This is a user command used to indicate that the user has seen the * error condition. If is possible, the command is executed

* instantaneously otherwise the command is discarded. User must take * care of this possibility by checking the return value. * @param this related object of class CMCI.

* @retval bool It returns TRUE if the command is successfully executed * otherwise it return FALSE. */

bool MCI_FaultAcknowledged(CMCI this);

/**

* @brief This is a user command used to begin the encoder alignment procedure. * If the state machine is in IDLE state the command is executed * instantaneously otherwise the command is discarded. User must take * care of this possibility by checking the return value.\\n

* Note: The MCI_EncoderAlign command is used just to begin the * encoder alignment procedure moving the state machine from IDLE state * to IDLE_ALIGNMENT. The command MCI_EncoderAlign is not blocking the * execution of project until the encoder is really calibrated; to do * this, the user have to check the state machine and verify that the * IDLE state has been reached again. * @param this related object of class CMCI.

* @retval bool It returns TRUE if the command is successfully executed * otherwise it return FALSE. */

bool MCI_EncoderAlign(CMCI this);

/**

* @brief It returns information about the state of the last buffered command. * @param this related object of class CMCI.

* @retval CommandState_t It can be one of the following codes: * - MCI_BUFFER_EMPTY if no buffered command has been called. * - MCI_COMMAND_NOT_ALREADY_EXECUTED if the buffered command * condition hasn't already occurred.

* - MCI_COMMAND_EXECUTED_SUCCESFULLY if the buffered command has * been executed successfully. In this case calling this function reset * the command state to BC_BUFFER_EMPTY.

* - MCI_COMMAND_EXECUTED_UNSUCCESFULLY if the buffered command has * been executed unsuccessfully. In this case calling this function * reset the command state to BC_BUFFER_EMPTY. */

CommandState_t MCI_IsCommandAcknowledged(CMCI this);

/**

* @brief It returns information about the state of the related oSTM object. * @param this related object of class CMCI.

* @retval State_t It returns the current state of the related oSTM object. */

State_t MCI_GetSTMState(CMCI this);

/**

* @brief It returns a 16 bit fields containing information about faults * historically occurred since the state machine has been moved into * FAULT_NOW state.

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink * @param this object of class CSTM.

* @retval uint16_t 16 bit fields with information about the faults * historically occurred since the state machine has been moved into * FAULT_NOW state.

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink */

uint16_t MCI_GetOccurredFaults(CMCI this);

/**

* @brief It returns a 16 bit fields containing information about faults * currently present.

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink * @param this object of class CSTM.

* @retval uint16_t 16 bit fields with information about about currently * present faults.

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink */

uint16_t MCI_GetCurrentFaults(CMCI this);

/**

* @brief It returns information about the current mechanical rotor speed * reference expressed in tenths of HZ. * @param this related object of class CMCI.

* @retval int16_t current mechanical rotor speed reference expressed in tenths * of HZ. */

int16_t MCI_GetMecSpeedRef01Hz(CMCI this);

/**

* @brief It returns information about last computed average mechanical speed, * expressed in 01Hz (tenth of Hertz).

* @param this related object of class CMCI.

* @retval int16_t rotor average mechanical speed (01Hz). */

int16_t MCI_GetAvrgMecSpeed01Hz(CMCI this);

/**

* @brief It returns information about current motor measured torque. This * value represents actually the Iq current expressed in digit. * To convert current expressed in digit to current expressed in Amps * is possible to use the formula:

* Current(Amp) = [Current(digit) * Vdd micro] / [65536 * Rshunt * Aop] * @param this related object of class CMCI.

* @retval int16_t current motor measured torque. This value represents * actually the Iq ref current expressed in digit. */

int16_t MCI_GetTorque(CMCI this);

/**

* @brief It returns the motor phase current amplitude (0-to-peak) in s16A * To convert s16A into Ampere following formula must be used: * Current(Amp) = [Current(s16A) * Vdd micro] / [65536 * Rshunt * Aop] * @param this related object of class CMCI

* @retval int16_t Motor phase current (0-to-peak) in s16A */

int16_t MCI_GetPhaseCurrentAmplitude(CMCI this);

/**

* @brief It returns the applied motor phase voltage amplitude (0-to-peak) in * s16V. To convert s16V into Volts following formula must be used: * PhaseVoltage(V) = [PhaseVoltage(s16A) * Vbus(V)] /[sqrt(3) *32767] * @param this related object of class CMCI

* @retval int16_t Motor phase voltage (0-to-peak) in s16V */

int16_t MCI_GetPhaseVoltageAmplitude(CMCI this);

/**

* @brief It returns the modality of the speed and torque controller. * @param this related object of class CMCI.

* @retval STC_Modality_t It returns the modality of STC. It can be one of * these two values: STC_TORQUE_MODE or STC_SPEED_MODE. */

STC_Modality_t MCI_GetControlMode(CMCI this);

/**

* @brief It returns the motor direction imposed by the last command * (MCI_ExecSpeedRamp, MCI_ExecTorqueRamp or MCI_SetCurrentReferences). * @param this related object of class CMCI.

* @retval int16_t It returns 1 or -1 according the sign of hFinalSpeed, * hFinalTorque or Iqdref.qI_Component1 of the last command. */

int16_t MCI_GetImposedMotorDirection(CMCI this);

/**

* @brief It returns information about the last ramp final speed sent by the * user expressed in tenths of HZ. * @param this related object of class CMCI.

* @retval int16_t last ramp final speed sent by the user expressed in tehts * of HZ. */

int16_t MCI_GetLastRampFinalSpeed(CMCI this);

/**

* @brief Check if the settled speed or torque ramp has been completed. * @param this related object of class CMCI.

* @retval bool It returns TRUE if the ramp is completed, FALSE otherwise. */

bool MCI_RampCompleted(CMCI this);

/**

* @brief It returns speed sensor reliability with reference to the sensor * actually used for reference frame transformation * @param this related object of class CMCI.

* @retval bool It returns TRUE if the speed sensor utilized for reference * frame transformation and (in speed control mode) for speed * regulation is reliable, FALSE otherwise */

bool MCI_GetSpdSensorReliability(CMCI this);

/**

* @brief It returns the last computed average mechanical speed, expressed in * 01Hz (tenth of Hertz) and related to the sensor actually used by FOC * algorithm

* @param this related object of class CMCI.

* @retval int16_t rotor average mechanical speed (01Hz) */

int16_t MCI_GetAvrgMecSpeed01Hz(CMCI this);

/**

* @brief Get the current mechanical rotor speed reference expressed in tenths * of HZ.

* @param this related object of class CMCI.

* @retval int16_t current mechanical rotor speed reference expressed in tenths * of HZ. */

int16_t MCI_GetMecSpeedRef01Hz(CMCI this);

/**

* @brief It returns stator current Iab in Curr_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Iab */

Curr_Components MCI_GetIab(CMCI this);

/**

* @brief It returns stator current Ialphabeta in Curr_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Ialphabeta */

Curr_Components MCI_GetIalphabeta(CMCI this);

/**

* @brief It returns stator current Iqd in Curr_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Iqd */

Curr_Components MCI_GetIqd(CMCI this);

/**

* @brief It returns stator current IqdHF in Curr_Components format * @param this related object of class CMCI.

* @retval Curr_Components Stator current IqdHF if HFI is selected as main * sensor. Otherwise it returns { 0, 0}. */

Curr_Components MCI_GetIqdHF(CMCI this);

/**

* @brief It returns stator current Iqdref in Curr_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Iqdref */

Curr_Components MCI_GetIqdref(CMCI this);

/**

* @brief It returns stator current Vqd in Volt_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Vqd */

Volt_Components MCI_GetVqd(CMCI this);

/**

* @brief It returns stator current Valphabeta in Volt_Components format * @param this related object of class CMCI. * @retval Curr_Components Stator current Valphabeta */

Volt_Components MCI_GetValphabeta(CMCI this);

/**

* @brief It returns the rotor electrical angle actually used for reference * frame transformation

* @param this related object of class CMCI.

* @retval int16_t Rotor electrical angle in dpp format */

int16_t MCI_GetElAngledpp(CMCI this);

/**

* @brief It returns the reference eletrical torque, fed to derived class for * Iqref and Idref computation

* @param this related object of class CMCI. * @retval int16_t Teref */

int16_t MCI_GetTeref(CMCI this);

/**

* @brief It returns the motor phase current amplitude (0-to-peak) in s16A * To convert s16A into Ampere following formula must be used: * Current(Amp) = [Current(s16A) * Vdd micro] / [65536 * Rshunt * Aop] * @param this related object of class CMCI.

* @retval int16_t Motor phase current (0-to-peak) in s16A */

int16_t MCI_GetPhaseCurrentAmplitude(CMCI this);

/**

* @brief It returns the applied motor phase voltage amplitude (0-to-peak) in * s16V. To convert s16V into Volts following formula must be used: * PhaseVoltage(V) = [PhaseVoltage(s16A) * Vbus(V)] /[sqrt(3) *32767] * @param this related object of class CMCI.

* @retval int16_t Motor phase voltage (0-to-peak) in s16V */

int16_t MCI_GetPhaseVoltageAmplitude(CMCI this);

/**

* @brief When bDriveInput is set to INTERNAL, Idref should is normally managed * by FOC_CalcCurrRef. Neverthless, this method allows forcing changing * Idref value. Method call has no effect when either flux weakening * region is entered or MTPA is enabled * @param this related object of class CMCI. * @param int16_t New target Id value * @retval none */

void MCI_SetIdref(CMCI this, int16_t hNewIdref);

/**

* @brief It re-initializes Iqdref variables with their default values. * @param this related object of class CMCI. * @retval none */

void MCI_Clear_Iqdref(CMCI this);

MCTasks_h

/**

****************************************************************************** * @file MCTasks.h

* @author STMicroelectronics - System Lab - MC Team * @version 4.2.0

* @date 20-Aug-2015 18:06

* @brief This file implementes tasks definition

******************************************************************************

/**

* @brief It initializes the whole MC core according to user defined * parameters.

* @param oMCIList pointer to the vector of MCInterface objects that will be * created and initialized. The vector must have length equal to the * number of motor drives.

* @param oMCTList pointer to the vector of MCTuning objects that will be * created and initialized. The vector must have length equal to the * number of motor drives. * @retval None */

void MCboot(CMCI oMCIList[],CMCT oMCTList[]);

/**

* @brief It executes MC tasks: safety task and medium frequency for all * drive instances. It have to be clocked with Systick frequnecy. * @param None * @retval None */

void MC_Scheduler(void);

/**

* @brief It executes safety checks (e.g. bus voltage and temperature) for all * drive instances. Faults flags are also here updated * @param None * @retval None */

void TSK_SafetyTask(void);

/**

* @brief Accordingly with the present state(s) of the state machine(s), it * executes those motor control duties requiring a high frequency rate * and a precise timing (e.g. FOC current control loop) * @param None

* @retval uint8_t It return the motor instance number of last executed FOC. */

uint8_t TSK_HighFrequencyTask(void);

/**

* @brief This function is called by TIMx_UP_IRQHandler in case of dual MC and * it allows to reserve half PWM period in advance the FOC execution on * ADC ISR

* @param oDrive pointer to a CFOC object * @retval None */

void TSK_DualDriveFIFOUpdate(void *oDrive);

/**

* @brief It is executed when a general hardware failure has been detected by * the microcontroller and is used to put the system in safety

* @brief It returns TRUE if OTT procedure has been completed, FALSE otherwise. * @param this related object of class COTT.

* @retval bool It returns TRUE if OTT procedure has been completed, FALSE otherwise. */

bool OTT_IsSpeedPITuned(COTT this);

/**

* @brief It returns the nominal speed estimated by OTT in RPM. * @param this related object of class COTT.

* @retval float It returns the nominal speed estimated by OTT in RPM. */

float OTT_fGetNominalSpeedRPM(COTT this);

void VSPD_SetMecAcceleration(CSPD this, int16_t hFinalMecSpeed01Hz, uint16_t hDurationms);

/**

* @brief Get the final speed of last setled ramp of virtual sensor expressed in 0.1Hz.

* @param this related object of class CSTC.

* @param hFinalMecSpeed01Hz mechanical speed expressed in 0.1Hz assumed by the virtual sensor at the end of the duration.

* @param hDurationms Duration expressed in ms. It can be 0 to apply instantaneous the final speed. * @retval none */

int16_t VSPD_GetLastRampFinalSpeed(CSPD this);

/** * @} */

/** @defgroup SpeednTorqCtrl_class_exported_methodsT SpeednTorqCtrl class exported methods * @{ */

/**

* @brief Get the current mechanical rotor speed reference expressed in tenths * of HZ.

* @param this related object of class CSTC.

* @retval int16_t current mechanical rotor speed reference expressed in tenths * of HZ. */

int16_t STC_GetMecSpeedRef01Hz(CSTC this);

/**

* @brief Get the current motor torque reference. This value represents * actually the Iq current reference expressed in digit.

* To convert current expressed in digit to current expressed in Amps * is possible to use the formula:

* Current(Amp) = [Current(digit) * Vdd micro] / [65536 * Rshunt * Aop] * @param this related object of class CSTC.

* @retval int16_t current motor torque reference. This value represents * actually the Iq current expressed in digit. */

int16_t STC_GetTorqueRef(CSTC this);

/**

* @brief Get the modality of the speed and torque controller. * @param this related object of class CSTC.

* @retval STC_Modality_t It returns the modality of STC. It can be one of * these two values: STC_TORQUE_MODE or STC_SPEED_MODE. */

STC_Modality_t STC_GetControlMode(CSTC this);

/**

* @brief Get the Application maximum positive value of rotor speed. It's expressed in tenth of mechanical Hertz. * @param this related object of class CSTC.

* @retval uint16_t It returns the application maximum positive value of rotor speed expressed in tenth of mechanical Hertz. */

uint16_t STC_GetMaxAppPositiveMecSpeed01Hz(CSTC this);

/**

* @brief Get the Application minimum negative value of rotor speed. It's expressed in tenth of mechanical Hertz. * @param this related object of class CSTC.

* @retval uint16_t It returns the application minimum negative value of rotor speed expressed in tenth of mechanical Hertz. */

int16_t STC_GetMinAppNegativeMecSpeed01Hz(CSTC this);

/**

* @brief It returns the default values of Iqdref. * @param this related object of class CSTC * @retval default values of Iqdref. */

Curr_Components STC_GetDefaultIqdref(CSTC this);

/** * @} */

/** @defgroup StateMachine_class_exported_methodsT StateMachine class exported methods * @{ */

/**

* @brief Returns the current state machine state * @param this object of class CSTM

* @retval State_t Current state machine state */

State_t STM_GetState(CSTM this);

/**

* @brief It returns two 16 bit fields containing information about both faults * currently present and faults historically occurred since the state * machine has been moved into state

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink * @param this object of class CSTM.

* @retval uint32_t Two 16 bit fields: in the most significant half are stored * the information about currently present faults. In the least * significant half are stored the information about the faults * historically occurred since the state machine has been moved into * FAULT_NOW state

* \\n\\link Fault_generation_error_codes Returned error codes are listed here \\endlink */

uint32_t STM_GetFaultState(CSTM this);

/** * @} */

/** @defgroup Temperature_sensor_class_exported_methodsT Temperature sensor class * exported methods * @{ */

/**

* @brief It returns latest averaged temperature measurement expressed in * Celsius degrees

* @param this related object of class CTSNS

* @retval int16_t Latest averaged temperature measurement in Celsius degrees

*/

int16_t TSNS_GetAvTemp_C(CTSNS this);

/**

* @brief It returns MC_OVER_TEMP or MC_NO_ERROR depending on

* temperature sensor output measurement and protection threshold values * @param this related object of class CTSNS * @retval uint16_t Fault code error */

uint16_t TSNS_CheckTemp(CTSNS this);

/** * @} */

/** @defgroup BusVoltageSensor_class_exported_methodsT BusVoltageSensor class exported methods * @{ */

/**

* @brief It returns latest averaged Vbus measurement expressed in Volts * @param this related object of class CVBS

* @retval uint16_t Latest averaged Vbus measurement in Volts */

uint16_t VBS_GetAvBusVoltage_V(CVBS this);

/**

* @brief It returns MC_OVER_VOLT, MC_UNDER_VOLT or MC_NO_ERROR depending on * bus voltage measurement and protection threshold values * @param this related object of class CVBS * @retval uint16_t Fault code error */

uint16_t VBS_CheckVbus(CVBS this);

/** * @} */

/** @defgroup DigitalOutput_class_exported_methodsT DigitalOutput class exported methods * @{ */

/**

* @brief It returns the state of the digital output * @param this object of class DOUT

* @retval OutputState_t Digital output state (ACTIVE or INACTIVE) */

DOutputState_t DOUT_GetOutputState(CDOUT this);

/** * @} */

/** @defgroup MotorPowerMeasurement_class_exported_methodsT MotorPowerMeasurement class exported methods * @{ */

/**

* @brief This method is used to get the last measured motor power * (instantaneous value) expressed in watt. * @param this related object of class CMPM.

* @retval int16_t The last measured motor power (instantaneous value) * expressed in watt. */

int16_t MPM_GetElMotorPowerW(CMPM this);

/**

* @brief This method is used to get the average measured motor power * expressed in watt.

* @param this related object of class CMPM.

* @retval int16_t The average measured motor power expressed in watt. */

int16_t MPM_GetAvrgElMotorPowerW(CMPM this);

/** * @} */

/** @defgroup Selfcommisioning_class_exported_methodsT Selfcommissioning class exported methods * @{ */

/**

* @brief It returns the state of Selfcommissioning procedure. * @param this related object of class CSCC.

* @retval uint8_t It returns the state of Selfcommissioning procedure. */

uint8_t SCC_GetState(CSCC this);

/**

* @brief It returns the number of states of Selfcommissioning procedure. * @param this related object of class CSCC.

* @retval uint8_t It returns the number of states of Selfcommissioning procedure. */

uint8_t SCC_GetSteps(CSCC this);

/**

* @brief It returns the measured Rs. * @param this related object of class CSCC.

* @retval uint32_t It returns the measured Rs, it is a floating point number * codified into a 32bit integer. */

uint32_t SCC_GetRs(CSCC this);

/**

* @brief It returns the measured Ls. * @param this related object of class CSCC.

* @retval uint32_t It returns the measured Ls, it is a floating point number * codified into a 32bit integer. */

uint32_t SCC_GetLs(CSCC this);

/**

* @brief It returns the measured Ke. * @param this related object of class CSCC.

* @retval uint32_t It returns the measured Ke, it is a floating point number * codified into a 32bit integer. */

uint32_t SCC_GetKe(CSCC this);

/**

* @brief It returns the measured VBus. * @param this related object of class CSCC.

* @retval uint32_t It returns the measured Vbus, it is a floating point number * codified into a 32bit integer. */

uint32_t SCC_GetVbus(CSCC this);

/**

* @brief It returns the nominal speed estimated from Ke. * @param this related object of class CSCC.

* @retval uint32_t It returns the nominal speed estimated from Ke, it is a * floating point number codified into a 32bit integer. */

uint32_t SCC_GetEstNominalSpeed(CSCC this);

/**

* @brief Call this method before start motor to force new motor profile. * @param this related object of class CSCC. * @retval none */

void SCC_ForceProfile(CSCC this);

/** * @} */

/** @defgroup OneTouchTuning_class_exported_methodsT One touch tuning class exported methods * @{ */

/**

* @brief Call this method before start motor to force new OTT procedure. * @param this related object of class COTT. * @retval none. */

void OTT_ForceTuning(COTT this);

/**

* @brief It returns the nominal speed estimated by OTT. * @param this related object of class COTT.

* @retval uint32_t It returns the nominal speed estimated by OTT, it is a * floating point number codified into a 32bit integer. */

uint32_t OTT_GetNominalSpeed(COTT this);

/**

* @brief It returns the number of states of OTT. * @param this related object of class COTT.

* @retval uint8_t It returns the number of states of Selfcommissioning procedure. */

uint8_t OTT_GetSteps(COTT this);

/**

* @brief It returns the state of OTT. * @param this related object of class COTT. * @retval uint8_t It returns the state of OTT. */

uint8_t OTT_GetState(COTT this);

/**

* @brief It returns TRUE if OTT procedure has been completed, FALSE otherwise. * @param this related object of class COTT.

* @retval bool It returns TRUE if OTT procedure has been completed, FALSE otherwise. */

bool OTT_IsSpeedPITuned(COTT this);

/**

* @brief It returns the nominal speed estimated by OTT in RPM. * @param this related object of class COTT.

* @retval float It returns the nominal speed estimated by OTT in RPM. */

float OTT_fGetNominalSpeedRPM(COTT this);

本文来源:https://www.bwwdw.com/article/ireh.html

Top