English
Language : 

AN1947 Datasheet, PDF (29/36 Pages) STMicroelectronics – ST7MC PMAC SINE WAVE MOTOR CONTROL SOFTWARE LIBRARY
ST7MC PMAC SINE WAVE MOTOR CONTROL SOFTWARE LIBRARY
Note: StartMotor is a function that is compiled differently depending on whether closed loop or
open loop is defined.
ACM_SoftStart(): this is used to perform the closed loop startup strategy. The function per-
forms the following tasks:
– Soft start by increasing the voltage from zero to a predefined value.
– Initialization of the Hall sensor acquisition for closed loop mode.
– Monitoring of the Hall sensor feedback to limit the starting voltage (and therefore limit the
starting torque).
– At the end of the Soft start initialize the regulation procedure.
This function is called from the main loop by the function StartMotor (the version compiled
with closed loop define).
ACM_SoftStart returns a value of type StartStatus_t that can be:
– START_ONGOING if the startup phase is ongoing,
– START_OK if the startup phase is successfully finished,
– START_FAIL if time out is reached and the rotor frequency if below the minimum value.
The startMotor (Closed Loop) returns a value of type SystStatus_t that can be:
– START if the startup phase is ongoing,
– RUN if the startup phase is successfully finished,
– FAULT if the startup phase fails.
The value returned is used in the main loop to change the actual status.
5.3 DIRECTION PROCEDURES
The direction procedures are defined in the MTC.c module:
– MTC_Toggle_Direction()
– MTC_Set_ClockWise_Direction()
– MTC_Set_CounterClockWise_Direction()
– MTC_GetRotationDirection()
These functions are used to set, modify or get an indication of the actual rotating direction. Ro-
tation direction change is achieved by modifying the sign of the variable holding the phase
shift between the three phases (either 120° or -120°).
Note: The clockwise direction is defined randomly. The real direction will only depend on the
physical connection of the motor.
29/36