Close
0%
0%

B-G431B-ESC Brushless Servo Controller

Ultra low-cost controller for brushless servo based on the B-G431B-ESC1 Discovery kit by ST

Similar projects worth following
The B-G431B-ESC1 Discovery Kit is a programmable ESC 6S Lipo (40A peak) available for only 18USD. See : https://www.st.com/en/evaluation-tools/b-g431b-esc1.html. This compact ESC (20x40mm) has USB, CAN and PWM user interfaces. The STM32G431 may be reprogrammed with a custom firmware, in order to drives a home made brushless servo (MAD 5008 240Kv). A position-velocity-torque regulation, with velocity and acceleration profil, has been tested. With a 1:10 planetary gear box (3d printed), the torque may exceeds 50kg.cm (5Nm) at 24V @ 5A, and the velocity is quite good (about 0.1s/60°).
  • 1 × B-G431b-ESC1 evaluation board https://www.st.com/en/evaluation-tools/b-g431b-esc1.html
  • 1 × MAD5008 240Kv or any 6S brushless motor
  • 1 × AS5048A or any encoder with ABZ or PWM interface
  • 1 × 3D prined gear box for a quasi direct drive actionner ABS printed gears recommended

  • Bandwidth of position and torque PID controller

    pat92fr04/08/2021 at 01:39 0 comments

    The latest firmware update improves the bandwidth of the position and torque PID controller.

    This test was performed with my robot powered by Lipo 4S battery. The robot is under development. It is a 8-dof quadruped using MAD 5008 240kV motors, B-G431B-ESC board, 3D printed planetary gearbox (ratio: 1:4.5) and a M5Stack Fire.

    Patrick.

  • Encoders

    pat92fr03/29/2021 at 16:21 0 comments

    Welcome Kai ! He has joined the project as a contributor, and we are working on the third alpha  firmware release, with some improvements :

    • support of encoders I2C et PWM
    • self calibration of motor / encoder
    • faster FOC update (up to 16KHz)
    • faster Position / Velocity / Torque PID loop
    • 1Mbps CAN-FD user interface for control and feedback (position, torque, temperature, voltage, error)
    • Fail-safe (brake when encoder error, over-heating, or under/over-voltage)
    • new operating mode "Position control with torque limit and velocity & acceleration profile".

    We have tested the current firmware with two different hardware configurations :

    • A 40xx brushless motor and an absolute position sensor AS5600 with a I2C interface (1Mbps)
    • A 50xx brushless motor and an absolute position sensor AS5048a with a PWM interface (1Khz)


    Here is the pinout of the ESC, with both I2C and PWM interface for encoders :

    There are so many things to add and to improve. 

    Bye,

    Patrick.


  • 5-bar leg (2x B-G431B-ESC)

    pat92fr02/10/2021 at 00:03 0 comments

    This is a very fist test of an home-made 5-bar leg.

    Power supply : 24V @ 2A limitation
    Motors : 2x MAD 5008 240KV
    Encoder : 2x AS5048A (14bit absolute position, PWM output)
    ESC : B-G431B-ESC1 discovery kit by ST
    https://www.st.com/en/evaluation-tool...

    3d printed planetary gear box (1:4.25). Gear Module 1 (ABS and PLA)
    3d printed legs (PETG)
    28 ball bearings
    Femur 100mm
    Tibia 160mm

    Home-made FOC algorithm with position / velocity / torque control running at 10KHz (36us processing time, using STM32G4 CORDIC)

    Velocity limited to 20000dps
    Motor current limited to 500mA (max Iq).


  • Thermal dissipation

    pat92fr02/09/2021 at 18:08 0 comments

    This compact ESC was designed by ST for drones, with a strong forced convection. 

    At zero-altitude, zero-speed, without propellers, thermal dissipation remains an issue. 

    Problem solved ! (Joke) ^_^

    I have absolutely no experience in implementing FOC algorithm. This is my very first project, about brushless motor controller. I will do my best to release and share something basic but usable soon. 

    Patrick.

  • 4-bar leg dual motor servo

    pat92fr02/08/2021 at 22:45 0 comments

    New hardware configuration !

    Each motor are driven by one G431 ESC running sensored FOC with position control mode.

    This is an example of application of such an ESC in robotics.

View all 5 project logs

View all 3 instructions

Enjoy this project?

Share

Discussions

dan_perrett wrote 05/17/2021 at 22:18 point

Hi Patrick - I see from your GitHub that you have a pinout for wiring in an AS5600 encoder via I2C - is this being implemented in the code or can I help with this? I'm hoping to use your firmware for position control of hoverboard motors...

  Are you sure? yes | no

pat92fr wrote 05/17/2021 at 22:36 point

Hello ! AS5600 with I2 port is supported. A new release of the firmware is coming (a matter of days). I would appreciate if you could test it with your hover board motor and give me feedbacks. PM me if you want access to the private Git with the last updates on progress.

  Are you sure? yes | no

hannibal80 wrote 05/01/2021 at 13:34 point

Great stuff here! Please, bear with me if I'm asking a silly question, I'm very new to this world, but per my understanding, the esc is supposed to be able to read motor angle and speed without any sensor. Why are you using an encoder? Thank you! 

  Are you sure? yes | no

Adrian wrote 05/01/2021 at 17:30 point

By driving the motor sensorless (this way - there are multiple other ways e.g. frequency induction..) you are using the Back EMF (induced voltage by the coils). The BEMF is proportional to the rotation speed, thus it can be measured to estimate it - in addition to some other tricks :) With a small rotation speed the measurement of this BEMF gets less precise and thus the speed approximation. By using an encoder with a reasonable high resolution to determine the rotation speed, you do not run into this problem at low rpm => you can control the motor speed more precise...

  Are you sure? yes | no

pat92fr wrote 05/02/2021 at 08:13 point

At the moment, sensored. 

I am using this ESC in robot joint actuator. The velocity may be zero at the same time, torque must be maximum. 

So, there is an absolute sensor on the motor rear shaft, and the position and velocity is estimated by the ESC using this absolute position sensor. I have no plan about implementing sensorless for my application, but any contribution is welcome !

Patrick.

  Are you sure? yes | no

luethich80 wrote 04/23/2021 at 06:10 point

Hi all, so happy to see this board is even existing, looks so perfect for my custom modelling project. I have a question tough, hope you can help: Your custom firmware runs directly on the STM32G4, not on the daughterboard, correct? How can you program the G4, through the daughterboard? What IDE and base library did you use for your code? Are you open to share the code so I could add my custom application based on your speed and torque control? Thank you so much for your support!

  Are you sure? yes | no

pat92fr wrote 05/02/2021 at 08:08 point

Hello Luethich, 

The firmware runs on the G4. I am using the daughter board for programming the G4 through USB port. The USB port is also used to send setpoints and recevive feedback (virtual serial comm port). There is Python GUI to control the motor from computer. The CAN port is also used for setpoint and feedback communication.

I have used CubeIDE and HAL. There is no library.  This my own FOC software implementation (not perfect). Of coure, the source code is open. The public repository is not up to date, at the moment. If you want to access the last code, I can invite you as contributor, and you will gain access to private Git. Let me know. 

I am currently redesigning the position/velocity/torque PID control. In fact this ESC is a side project. The main project is my 8-DOF quadruped using 8 ESC.

Patrick.

  Are you sure? yes | no

hassan-asif wrote 04/09/2021 at 06:33 point

Hi Pat92fr: The user manual for B-G431B-ESC1 on ST website is revision 4. DO you have revision 1 or revision 2 available with you? I want to look into schematics of B-G431B-ESC1. In revision 4, ST has deleted the schematics of B-G431B-ESC1.

Looking forward to hear from you. Thank you.

  Are you sure? yes | no

pat92fr wrote 05/02/2021 at 08:01 point

Hello Hassan, I have uploaded the schematic of the ESC in the Repository in Hardware / BoardSchematic. Sorry for the delay. YHere is the link : : https://github.com/pat92fr/BrushlessServoController/tree/main/02-Hardware/02-BoardSchematic

Patrick.

  Are you sure? yes | no

rraetz wrote 02/08/2021 at 16:30 point

I was not aware of this kit. Seems like a dream come true! Do you plan to use it with closed-loop FOC (with angular position sensor)? 

  Are you sure? yes | no

pat92fr wrote 02/08/2021 at 17:45 point

Hello QuestforMotion. Yes, of course, and that works quite well. I have just implemented a FOC algorithm using an absolute encoder (14bit) for angular position. My firmware offers several operating modes : position control, velocity control, and torque control. I will make it open source hardware (printed parts) and software. The main drawback of this evaluation kit is the thermal dissipation. Board is getting very hot at maximum torque. I think a forced convection is mandatory. Bye !

  Are you sure? yes | no

rraetz wrote 02/09/2021 at 00:46 point

Thanks for your quick answer, I appreciate it. That's great! I have some experience programming FOC firmware using the TI Launchpad and motor control evaluation boards, but they are way more expensive (30USD board + 80USD motor driver). So it's amazing to see that there seems to be a viable alternative. Thermal dissipation should be solvable, I guess... Anyway, I am looking forward to checking your implementation of the motor control!  

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates