cancel
Showing results for 
Search instead for 
Did you mean: 

B-G431-ESC1 Electronic Speed Control PWM issues

rudyard
Associate III

Hello,

I apologise in advance if my post lacks any important information, I am very new to working with these sorts of boards and have limited experience with motor control in general. 

I am using a B-G431-ESC1 to drive a 24V hoverboard motor. I have profiled the motor and uploaded the firmware to it and it runs just fine on the motor pilot with FOC speed control. I had also used the potentiometer on the ESC to change the speed without issue.

I wanted to switch to using PWM signals to control the speed of the motor, and reuploaded the firmware to the board with the potentiometer option disabled and the Electronic Speed Control option enabled for the stage configuration. 
Using an ESP32 I generate a 490Hz PWM signal and first send 1060us pulses to the ESC (verified with an oscilloscope). I then send a new PWM to the ESC where the signal is high for 1850us. 

My expectation was that the initial 1060us PWM would arm the driver, and then the 1850us PWM would command the ESC to drive the motor close to its maximum speed, but the motor does not move. The motor does stiffen a little and is harder to rotate by hand, and if i do rotate it by hand quickly it sometimes continues to move at a constant speed. I have also connected the ESC to the esp whilst the ESC was connected to a motor pilot on a laptop, and the motor switches from "IDLE" to "RUN" as the esp sends the PWM signal.

I am writing here for some advice on what I must change to allow the PWM signal to work as I expected, with a variable PWM being able to control the speed of the motor. I would be very appreciative of any help that anyone may provide me :)

Many thanks.

motor workbench: Version: 6.4.1 Build: 250722.154358
STM32 cubeIDE: Version 2.0.0
STM32 cubeMX: Version 6.16.0

13 REPLIES 13

Hello @GMA 

I am confused why we cannot use B-G431-ESC1 board for Hall sensor interface, as the schematics contains hall sensor interface. I have made custom board with reference to this schematic, something missing in B-G431-ESC1 hardware which will prevent it from interfacing with Hall sensor if you can suggest, i can update it in my custom hardware. 

Thank you.

 

rudyard
Associate III

The electronic speed controller (ESC) is not compatible with the Profiler tool or speed sensing with a sensor.

 

sorry I missed this when i first replied, but are you saying I am unable to control the speed of the B-G431B-ESC1 using PWM signals?

Hello @rudyard,

Motor profiling with HALL must be performed with ESC disabled, STO-PLL as the main speed sensor, and HALL as the auxiliary speed sensor.
For ESC control, disable the Profiler feature. According to the application note, ESC is available only in sensorless mode.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
rudyard
Associate III

Hello,

Ah I see. I have it set up now with the STO-PLL as the main sensor and hall as auxiliary.

I made some changes that have ultimately allowed me to achieve the ESC control I was aiming for:

  • I saw a post on this community that mentioned a potential mistake in the generation of the esc.c, on line 121:
    if((pHandle->Ton_value >= pESC_params->Ton_arming) && (pHandle->Ton_value > pESC_params->Ton_min))

    That post supposed that the second inequality is the wrong way around. I changed this and the motor was then able to move when i sent it signals using the esp.
  • After this first change, the motor would move but only moved at a single speed (about 1/6th of the max speed), unless the pulse was longer than the maximum value mentioned in the documentation (1860us), in which case it jumped straight to the max speed. I was using the correct frequency and tried varying the pulse width but it the speed did not change. I looked into the esc.c file again and then found that the "speed_min_valueRPM" value in the mc_parameters.c was set to 1000, whilst my maximum speed was 600. I may be missing it but i cant find any option in the motor workbench to set a minimum speed, and none of the speeds values i had set were 1000. Either way, changing this value in the mc_parameters.c file to 0 seems to have resolved my issue.

 

Thank you both @GMA and @STuser2 :)