cancel
Showing results for 
Search instead for 
Did you mean: 

ADC2 warning when generating project for B-G431B-ESC1

TAinl.1
Associate

I'm trying to generate project for B-G431B-ESC1 and I keep getting warning

  • These IPs still have some not configured or wrong parameter values: [ADC2]

Project compiles after commenting out HAL_PWREx_DisableUCPDDeadBattery(); (from stm32g4xx_hal_msp.c line:81), but motors won't run with any setting. Currents are insanely high. Ramp-up tries to execute, but fails.

Seems like the feedback is not working at all. ESC cannot detect motor speed properly.

0693W000004HBUHQA4.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

The first point I would advise is to be sure that you clicked on Update button at generation stage ( instead of generate button). If you open the IOC generated by the workbench with cubeMX, you must see the M1_PWM_INPUT at PA15.

In order to make the motor spin, the ESC state machine must be in ESC_ARMED state.

To reach ESC_ARMED state, the ESC must stay in ESC_ARMING state for ARMING_TIME. (ARMING_TIME is set to 200, it is a number of iteration inside the ESC_ARMING state)

ESC_ARMING state is reached when Ton is between 900 us and 1060 us.

This is a safety measure, to not be injured by the propeller in case of a full scale PWM target is applied from no signal.

So, if from no signal you apply directly 1060 us or more, you will not reach the ESC_ARMED state.

If you have a live debugger, I advise you to look at the ESC_M1 variable, and to look at the sm_state member.

If you have never seen your motor spinning before, you can also try without the PWM control, just with the monitor tool, but in order to do so, you have to comment in the main.c file the following two lines :

 esc_boot(&ESC_M1);

  esc_pwm_control(&ESC_M1);

Let me know if it helps.

Regards

Cedric

View solution in original post

9 REPLIES 9
nik8540
Associate II

I am also facing same issue. I got motor profiler working and project generated as per the latest instructions from https://community.st.com/s/question/0D53W00000HwV8RSAV

However the above issue are happening and not able to run the motor.

Any help is really appreciated.

@Laurent Ca...​  @DB.7ERGANTIN​ 

Laurent Ca...
Lead II

Dear @TAinl.1​ , dear @nik8540​ 

Do you used SDK 5.4.4 with the fix published here: https://community.st.com/s/question/0D53W00000HwV8RSAV

Best regards

Laurent Ca...

Dear @Laurent Ca...​ ,

Yes. Fix from this post was use along with MCSDK5.4.4, CubeMX6.0.1, CubeIDE1.4.0

Regards,

Nikhil

DBE
ST Employee

Hello,

CubeMX MX 6.0.1 introduced a regression that prevent the Motocontrol configuration tool to configure the connection between the internal OPAMP output to the ADC input. This issue should be fixed in CubeMX MX 6.1.0, meanwhile you can download CubeMX MX 5.6.0 and use it to generate a working project.

Best regards

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Thank you @DB.7ERGANTIN​ .

The error disappeared with CubeMX 5.6.0

I am able to build the example code to work with PWM input control provided with MCSDK.

However, it is not working. I am providing PWM from RC receiver at the PWM pin as mentioned in User manual. The motor beeps once when power is connected and nothing happens after that. I followed exact instructions for PWM generation (1060us) for ESC arming. but it is not working. I also checked the Ton value using debug and ESC is accepting external PWM value as desired. but the motor does not move. ESC is getting little worm.

Can you please help?

Regards,

Nikhil

JA.1
Associate III

@DB.7ERGANTIN​  Do you know when CubeMX MX 6.1.0 will be out?

Laurent Ca...
Lead II

Dear @Community member​ 

There is regular updates of CubeMX MX but I don't think there is a public planning about.

Best regards

Laurent Ca...

Hello,

The first point I would advise is to be sure that you clicked on Update button at generation stage ( instead of generate button). If you open the IOC generated by the workbench with cubeMX, you must see the M1_PWM_INPUT at PA15.

In order to make the motor spin, the ESC state machine must be in ESC_ARMED state.

To reach ESC_ARMED state, the ESC must stay in ESC_ARMING state for ARMING_TIME. (ARMING_TIME is set to 200, it is a number of iteration inside the ESC_ARMING state)

ESC_ARMING state is reached when Ton is between 900 us and 1060 us.

This is a safety measure, to not be injured by the propeller in case of a full scale PWM target is applied from no signal.

So, if from no signal you apply directly 1060 us or more, you will not reach the ESC_ARMED state.

If you have a live debugger, I advise you to look at the ESC_M1 variable, and to look at the sm_state member.

If you have never seen your motor spinning before, you can also try without the PWM control, just with the monitor tool, but in order to do so, you have to comment in the main.c file the following two lines :

 esc_boot(&ESC_M1);

  esc_pwm_control(&ESC_M1);

Let me know if it helps.

Regards

Cedric

Hey, I tried doing this fix to run the motor profiler but it burned the ESC, specifically the 3 L6387 drivers, at the same time. Did you just follow the instructions or added something yourself?

Best regards