cancel
Showing results for 
Search instead for 
Did you mean: 

Implement error handling using Motor profiler API

GJamo.1
Associate II

Is there a Motor profiler API or any other tool that I can use to retrieve the error status from the ST Motor pilot programmatically? I'm interested in obtaining informations about the following errors:

GJamo1_0-1687685234853.png

If it's not available, I would appreciate any alternative recommendations or approaches to achieve this functionality within a code-based context.

1 ACCEPTED SOLUTION

Accepted Solutions
GJamo.1
Associate II

I had a thourough look on motor control sdk and I found 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
  *  pHandle Pointer on the component instance to work on.
  * @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
  */
__weak uint16_t MCI_GetCurrentFaults(MCI_Handle_t *pHandle)
{
  return ((uint16_t)pHandle->CurrentFaults);
}

 

With the following error codes:

/** 
 * @anchor fault_codes 
 * @name Fault codes
 * The symbols below define the codes associated to the faults that the 
 * Motor Control subsystem can raise.
 * @{ */
#define  MC_NO_ERROR     ((uint16_t)0x0000) /**< @brief No error.*/
#define  MC_NO_FAULTS    ((uint16_t)0x0000) /**< @brief No error.*/
#define  MC_DURATION     ((uint16_t)0x0001) /**< @brief Error: FOC rate to high.*/
#define  MC_OVER_VOLT    ((uint16_t)0x0002) /**< @brief Error: Software over voltage.*/
#define  MC_UNDER_VOLT   ((uint16_t)0x0004) /**< @brief Error: Software under voltage.*/
#define  MC_OVER_TEMP    ((uint16_t)0x0008) /**< @brief Error: Software over temperature.*/
#define  MC_START_UP     ((uint16_t)0x0010) /**< @brief Error: Startup failed.*/
#define  MC_SPEED_FDBK   ((uint16_t)0x0020) /**< @brief Error: Speed feedback.*/
#define  MC_BREAK_IN     ((uint16_t)0x0040) /**< @brief Error: Emergency input (Over current).*/
#define  MC_SW_ERROR     ((uint16_t)0x0080) /**< @brief Software Error.*/
/** @}*/

View solution in original post

1 REPLY 1
GJamo.1
Associate II

I had a thourough look on motor control sdk and I found 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
  *  pHandle Pointer on the component instance to work on.
  * @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
  */
__weak uint16_t MCI_GetCurrentFaults(MCI_Handle_t *pHandle)
{
  return ((uint16_t)pHandle->CurrentFaults);
}

 

With the following error codes:

/** 
 * @anchor fault_codes 
 * @name Fault codes
 * The symbols below define the codes associated to the faults that the 
 * Motor Control subsystem can raise.
 * @{ */
#define  MC_NO_ERROR     ((uint16_t)0x0000) /**< @brief No error.*/
#define  MC_NO_FAULTS    ((uint16_t)0x0000) /**< @brief No error.*/
#define  MC_DURATION     ((uint16_t)0x0001) /**< @brief Error: FOC rate to high.*/
#define  MC_OVER_VOLT    ((uint16_t)0x0002) /**< @brief Error: Software over voltage.*/
#define  MC_UNDER_VOLT   ((uint16_t)0x0004) /**< @brief Error: Software under voltage.*/
#define  MC_OVER_TEMP    ((uint16_t)0x0008) /**< @brief Error: Software over temperature.*/
#define  MC_START_UP     ((uint16_t)0x0010) /**< @brief Error: Startup failed.*/
#define  MC_SPEED_FDBK   ((uint16_t)0x0020) /**< @brief Error: Speed feedback.*/
#define  MC_BREAK_IN     ((uint16_t)0x0040) /**< @brief Error: Emergency input (Over current).*/
#define  MC_SW_ERROR     ((uint16_t)0x0080) /**< @brief Software Error.*/
/** @}*/