Skip to main content
DTort.1
Associate III
December 10, 2021
Question

Blocking BLDC motor at zero speed.

  • December 10, 2021
  • 3 replies
  • 4549 views

I am using board B-G431B-ESC1 and Motor Control 5.Y.3. How to implement BLDC blocking at zero speed. I have Hall sensors in the motors, but there is no encoder so I cannot control the position. I do not need position control, I just need a lock, and if the rotor is displaced, then I don’t need to go back, but just continue to lock. I see this as passing direct current (PWM) through the windings or possibly alternately turning on the motor with forward and reverse rotation. How can this be done?

Thanks in advance!

This topic has been closed for replies.

3 replies

Javier1
Principal
December 10, 2021

how long (time) and strong (power) do you need this lock to be?

hit me up in https://www.linkedin.com/in/javiermuñoz/
DTort.1
DTort.1Author
Associate III
December 10, 2021

Since this can lead to overheating of the windings, these are short periods of time, perhaps tens of seconds. That is, this is not a permanent mode of operation, but for some time after reaching zero speed, I would like to be able to block the BLDC. An approximate power of 50W will suit me, but if it can be made controllable, then it will be even better.

Javier1
Principal
December 10, 2021

Which modulation are you using? FOC, trapezoidal ...

I know that FOC supports regen braking... you can even set the max Current (power) of the braking

hit me up in https://www.linkedin.com/in/javiermuñoz/
DTort.1
DTort.1Author
Associate III
December 11, 2021

In general, I solved my problem. The idea is to turn on the PWM on one phase then the PWM will control the blocking torque.

I just did it manually via HAL functions, I hope it won't lead to problems when returning to control via the Motor Control library.

If someone knows a more beautiful and correct way to do this, please write here.

MC_StopMotor1();
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);
TIM1->CCR1 = 500;

0693W00000HoHsrQAF.png

Javier1
Principal
December 13, 2021

Shorting all three LOW or HIGH side mosfets will short the induced current in the motor to fixed potential ground/vcc.

This gives you a better braking strength when stopped or low speeds indeed. (when the EMC fields built in iside the coils doesnt need to colapse because there is no EMC built in yet)

Im not familiar with the st control api but if you find something like setFOCstep( stepNumber)

You would want to set it to setFOCstep(7)

or (1,1,1)

0693W00000HoLv6QAF.png0693W00000HoLvGQAV.pnghttps://microchipdeveloper.com/mct5001:space-vector-modulation

hit me up in https://www.linkedin.com/in/javiermuñoz/
DTort.1
DTort.1Author
Associate III
December 13, 2021

Thanks for your reply! Yes, turning on all the lower transistors is what I have already considered. It turns out to be a good idea for dynamic braking at low speed, when regenerative braking can no longer work, but no braking torque is generated at zero speed. That is, in essence, the braking torque in this method is a function of the rotational speed. The faster we are to crank, the more difficult it becomes. If turn the rotor slowly, there will be almost no resistance.

This method is essentially a special case of mine when the PWM duty cycle of the first phase is equal to 0 and we get the first small braking torque,

TIM1->CCR1 = 0;

then increasing the PWM braking torque increases.

TIM1->CCR1 = 500;

The Motor Control library contains functions for this:

/**
 * It turns on low sides switches. This function is intended to be
 * used for charging boot capacitors of driving section. It has to be
 * called each motor start-up when using high voltage drivers
 */
void R3_2_TurnOnLowSides( PWMC_Handle_t * pHdl );

MK.1
Associate III
December 14, 2021

look closely at the encoder alignment function, by analogy try to write your own:

__weak void EAC_StartAlignment( EncAlign_Handle_t * pHandle )

{

 uint32_t wAux;

 /* Set pVSS mechanical speed to zero.*/

 VSS_SetMecAcceleration( pHandle->pVSS, 0, 0u );

 /* Set pVSS mechanical angle.*/

 VSS_SetMecAngle( pHandle->pVSS, pHandle->hElAngle );

 /* Set pSTC in STC_TORQUE_MODE.*/

 STC_SetControlMode( pHandle->pSTC, STC_TORQUE_MODE );

 /* Set starting torque to Zero */

 STC_ExecRamp( pHandle->pSTC, 0, 0u );

 /* Execute the torque ramp.*/

 STC_ExecRamp( pHandle->pSTC, pHandle->hFinalTorque, ( uint32_t )( pHandle->hDurationms ) );

 /* Compute hRemainingTicks, the number of thick of alignment phase.*/

 wAux = ( uint32_t )pHandle->hDurationms * ( uint32_t )pHandle->hEACFrequencyHz;

 wAux /= 1000u;

 pHandle->hRemainingTicks = ( uint16_t )( wAux );

 pHandle->hRemainingTicks++;

}

DTort.1
DTort.1Author
Associate III
December 14, 2021

Thanks for your reply! 

I have not found anything in these functions that can help me. I have already tried to control the torque through the api and simultaneously lower the speed to 0, but this still does not work.

What I need, in fact, I did manually, through the HAL, the only thing that still worries me is maybe someone knows how to replace these HAL functions with functions from the Motor Control library in order to stay at the api level.

The only thing close to this that I found is the mode for measuring the parameters of the R-L motor, but I did not master what to give to these functions.

/**
 * @brief Sets the PWM duty cycle to apply in the RL Detection mode.
 * @param pHandle: handle on the target instance of the PWMC component
 * @param hDuty Duty cycle to apply
 *
 * @todo TODO: Describe the unit of the hDuty variable.
 *
 * @retval If the Duty Cycle could be applied on time for the next PWM period,
 * #MC_NO_ERROR is returned. Otherwise, #MC_FOC_DURATION is returned.
 */
__weak uint16_t PWMC_RLDetectionModeSetDuty( PWMC_Handle_t * pHandle, uint16_t hDuty )
{
 uint16_t hRetVal = MC_FOC_DURATION;
 if ( pHandle->pFctRLDetectionModeSetDuty )
 {
 hRetVal = pHandle->pFctRLDetectionModeSetDuty( pHandle, hDuty );
 }
 return hRetVal;
}