Attachments are accessible only for community members.

# BLDC Hall Sensor Controlling using XMC1300

Level 2
Level 2

Greetings of the day,

Am presently working on BLDC Hall sensor Controlling  using XMC1300 MCU with 120W custom motor and testing Current Control Scheme, am able to Run 120W DC Motor, But unable to control/Change Speed by using POTENTIOMETER

Observations:

1) When changing POT (approx from 2 to 5% analog input) the Motor running Slowly and Above 5% Maximum duty is applied and motor running with maximum speed and unable to reduce speed using POT

2) Motor is running When POT is at 0 position with some Feedback speed (65532), In CURRENT CONTROL SCHEME How to control Speed using POT (Analog input)?

3) Is any KP and KI factors to be adjusted to Control current ?

4) How to validate Current Controlling Scheme and what are the parameters to be observed ?

below is the current control PI technique used in XMC1300, please solve my issue ASAP

Suraj, N

1 Solution

# Re: BLDC Hall Sensor Controlling using XMC1300

Moderator
Moderator

Hello @Suraj ,

What is the control scheme that you're using ? If it is a current control mode (BLDC_SCALAR_CURRENT_CTRL), then the input to the control loop is the reference current, not the speed. If the control is either BLDC_SCALAR_SPEED_CTRL or BLDC_SCALAR_SPEEDCURRENT_CTRL then the speed control is done. In these two control methods, reference speed is the input to the overall control loop.

For BLDC_SCALAR_CURRENT_CTRL current control scheme, the reference current is set in the ref_current, if the input is analog.  The reference currents are available in the typedef struct BLDC_SCALAR_CURRENT_CONTROL.
In the current control mode, the speed is not in our control. The torque is set by the current and speed is according to the load torque and motor mechanical parameters.

In the current control scheme, Kp and Ki values are calculated as
Kp = (2* 3.14 * Ls * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * 2^scale)
* Ki = (2* 3.14 * Rs * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * MOTOR0_BLDC_SCALAR_CCU8_PERIOD_uS * 2^scale)

In order to vary the speed of the motor using potentiometer, do speed control (BLDC_SCALAR_SPEED_CTRL) or speed with current control (BLDC_SCALAR_SPEEDCURRENT_CTRL).

Best Regards,
Sai
2 Replies

# Re: BLDC Hall Sensor Controlling using XMC1300

Moderator
Moderator

Hi, @Suraj ,

I think that you have changed the control scheme in the codes, the current control scheme has default Kp/Ki values, so when you change the target current a little bit, the speed will grow very fast. I have a test on my XMC1300, when I setting 10% target current, the speed will increase to the maximum, and then, I set 1% target current, waiting the ref current stable, when the current stable, the speed will slow down. So it means that the current control is valid, the problem is the Kp/Ki values are not suitable.

Base the situation above, we can set the Kp/Ki values to 0, so we can see the obvious speed change. It can be seen from the control block diagram that the smaller the 'error' value, the better the control effect, and the closer the actual current to the reference current. The best control effect is achieved by adjusting the KP / Ki value. Hope this can help you.

Regards,

Owen_Su

# Re: BLDC Hall Sensor Controlling using XMC1300

Moderator
Moderator

Hello @Suraj ,

What is the control scheme that you're using ? If it is a current control mode (BLDC_SCALAR_CURRENT_CTRL), then the input to the control loop is the reference current, not the speed. If the control is either BLDC_SCALAR_SPEED_CTRL or BLDC_SCALAR_SPEEDCURRENT_CTRL then the speed control is done. In these two control methods, reference speed is the input to the overall control loop.

For BLDC_SCALAR_CURRENT_CTRL current control scheme, the reference current is set in the ref_current, if the input is analog.  The reference currents are available in the typedef struct BLDC_SCALAR_CURRENT_CONTROL.
In the current control mode, the speed is not in our control. The torque is set by the current and speed is according to the load torque and motor mechanical parameters.

In the current control scheme, Kp and Ki values are calculated as
Kp = (2* 3.14 * Ls * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * 2^scale)
* Ki = (2* 3.14 * Rs * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * MOTOR0_BLDC_SCALAR_CCU8_PERIOD_uS * 2^scale)

In order to vary the speed of the motor using potentiometer, do speed control (BLDC_SCALAR_SPEED_CTRL) or speed with current control (BLDC_SCALAR_SPEEDCURRENT_CTRL).

Best Regards,
Sai