cancel
Showing results for 
Search instead for 
Did you mean: 

configuring speed and current regulation using ST tools

Christophe65
Associate II

Hello everyone,

I'm working on an application using a motor with a nominal speed of 1850 rpm and a nominal current of 4.1 A. The motor operates within a speed range of 300 to 800 rpm, and I'm looking to implement stable and efficient speed regulation.

I have already imported my project into MC Workbench and configured the following parameters:

 

Current configuration:

Speed sensing mode:

  • Speed Sensor Mode: Hall Sensor

Speed regulator:

  • Execution Rate: 1 ms
  • Target Speed: 648 rpm
  • Auto Calculate Kp & Ki: enabled
    • Kp ≈ 14.96
    • Ki ≈ 0.0105
  • Maximum speed error before fault: 3

Current regulators (Torque/Flux):

  • Execution Time: 50 µs
  • Control Mode: Speed control
  • Cut-off frequency: 6000 rad/s
  • Auto Calculate Torque/Flux Kp & Ki: enabled

Iq (Torque) Regulator:

  • Target: from speed regulator
  • Kp ≈ 7.62
  • Ki ≈ 0.326

Id (Flux) Regulator:

  • Target: 0 A
  • Kp ≈ 7.62
  • Ki ≈ 0.326

Modulation:

  • Selected modulation: None

PWM and current sensing:

  • PWM frequency: 20 kHz
  • Current sensing gain: 21
  • Measurement range: -15.71 A to +15.71 A

My questions:

  • Does this configuration seem suitable for stable regulation within my operating speed range (300–800 rpm)?
  • Is the automatic tuning of the Iq and Id current regulators sufficient, or should I manually adjust the gains to optimize performance?
  • Are there any recommendations to improve stability or accuracy at low speeds?

Thanks in advance for your feedback and suggestions!

3 REPLIES 3
STuser2
Senior II

My advice would be as a first step you should start running the motor in no load condition and reach the expected maximum speed.

For tuning of parameters, you can use the motor profiler. So, flashing the software and running the motor without any issues and check for proper sinusoidal currents will be first step. 

Christophe65
Associate II

Hello and thank you all for your help and feedback.

I’ve already profiled my motor using the Motor Profiler tool, and I’m able to run it in my application, currently without load. The motor operates within a speed range of 300 to 800 rpm.

I still need to make some adjustments to improve its responsiveness, especially during startup where I’m seeing position errors.
I plan to test the motor under load soon, but before that, I’d like to fully understand the configuration to ensure the motor reacts properly.

I’m considering increasing the maximum number of speed errors allowed before triggering a fault (currently set to 3) — could this be related to the startup issues I’m experiencing?

I’d also like to better understand the purpose of the following parameters in the Speed Regulator section of MC Workbench:

  • Execution Rate: 1 ms
  • Target Speed: 648 rpm

My questions:

  • What exactly does the Execution Rate represent? Is it the frequency at which the speed control loop is recalculated?
  • Is the Target Speed just a test value, or does it play a role in system behavior during startup or in gain calculation?

Thanks in advance for your insights!


@Christophe65 wrote:

I’m considering increasing the maximum number of speed errors allowed before triggering a fault (currently set to 3) — could this be related to the startup issues I’m experiencing?

Do not increase this, even if you increase there will not be much impact. If you are using your own custom board check for the Hall signals.

  • What exactly does the Execution Rate represent? Is it the frequency at which the speed control loop is recalculated?

 Yes this is the frequency at which speed loop is executed.

 

  • Is the Target Speed just a test value, or does it play a role in system behavior during startup or in gain calculation?

It is a default value the program considers before the actual speed value given by the speedrampmotor1

.MecSpeedRefUnitDefault     = (int16_t)(DEFAULT_TARGET_SPEED_UNIT),

__weak void MC_ProgramSpeedRampMotor1(int16_t hFinalSpeed, uint16_t hDurationms)
{
  MCI_ExecSpeedRamp(pMCI[M1], hFinalSpeed, hDurationms);
}

How to provide the Kp,Ki values is given in MCSDK documentation. The above is based on my knowledge.