Skip to main content
Associate
Apr 27, 2026 3:25 PM UTC
Solved

Control in Open Loop Voltage mode for B-G431-ESC1 via UART2

Hi,

I'm trying to control a BLDC motor connected to B-G431-ESC1 driver in Open Loop Voltage mode. With Motor Pilot control there's no problems. I'm not able to find the correct HAL commands to use for:

A) Set Open Loop Voltage mode ( 

B) Set the reference voltage

C) Set the speed in RPM

Start, Stop, Ack Fault commands are ok. AI gave me a lot of indications but nothing seems work ok. 

Many thanks who will help me.

Bye 

 

Rossano

 

GMA
GMABest answer
ST Technical Moderator
Apr 27, 2026 3:45 PM UTC

Hello @rossbossbran,

Refer to the Firmware usage via APIs section in the Open loop description and usage chapter, available through Workbench tool > About > Documentations > Documentation > User manual.

If you agree with the answer, please accept it by clicking on 'Best answer'.Best regards.GMA

2 replies

GMA
GMABest answer
ST Technical Moderator
Apr 27, 2026 3:45 PM UTC

Hello @rossbossbran,

Refer to the Firmware usage via APIs section in the Open loop description and usage chapter, available through Workbench tool > About > Documentations > Documentation > User manual.

If you agree with the answer, please accept it by clicking on 'Best answer'.Best regards.GMA
Associate
Apr 28, 2026 9:41 AM UTC

GMA, many thanks

At now all seems run.

HAL commands are:

To set Open Loop Voltage -> MCI_SetOpenLoopVoltageMode(&Mci[M1]);

To set the voltage -> OL_UpdateVoltage(&OpenLoop_ParamsM1,((target_voltage * 32767) / 100)); target_value is my variable.

To set the speed ->  MC_ProgramSpeedRampMotor1(ccr_val, 0); ccr_val is my variable.

To start -> MC_StartMotor1();

To stop -> MC_StopMotor1();

Bye

Rossano