Ultra low-cost controller for brushless servo based on the B-G431B-ESC1 Discovery kit by ST
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
A new quadruped, using twelve motors, controlled by the B-G431B-ESC and firmware V3.
Testing new release with a mini gimbal motor...
One year ago, I have developped a very fist revision of a custom FOC firmware on the B-G431B-ESC Discovery Kit. The code has been improved and a new firmware revision (V2) will be released soon.
The firmware is tested with a 8108 and a 5008 bruhsless motors. The AS5048A (PWM input) and the AS5600 (I2C) are also tested.
List of improvements :
A field-weakeming algorithm has been tested, but it will not be in the next release. The ESC is able to spin the motors at their base speed (Kv*Vdc). I think there is no need to spin faster for a hobby robotic application at the moment.
Patrick.
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.
Welcome Kai ! He has joined the project as a contributor, and we are working on the third alpha firmware release, with some improvements :
We have tested the current firmware with two different hardware configurations :
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.
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).
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.
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.
The Discovery kit embeds the hardware circuit for encoder sensor. A supply voltage
line is provided with 5 V and GND lines in J8 solder pads. Solder encoder leads on +5V, GND and one PWM input capture pad (A or B).
Create an account to leave a comment. Already have an account? Log In.
Hi Pat, Amazing to see the progress of this project! What's the maximum current that the B-G431B can continuously supply without getting too hot (with the heat sink, but no fan)? Do you think 3-4 Amps are ok? I am considering this for one of my projects.
Hello ! Thank you rraetz.
This is quite a difficult question to answeer! This ESC becomes hot very fast. The firmware monitors the temperature, and I have set a maximum at about 70°C. I think this ESC can handle a higher temperature (at least 90°C for a short time).
I have a 6kg quadruped with 12 ESC and MAD 5008 motors. No thermal problem when standing or walking, with just a small heat sink. The current limit is set to 26A on each ESC. The robot is powered with a 12-15V battery. When standing, the robot overall curent is less than 10A. The peak over-all current is about 20 to 30A.
3 to 4A may be OK. I think it depends on your application. What kind of motor will you use (power/speed ratings and pole pairs) ? How much continuous/peak torque do you need (Nm) ? I have many motors. Maybe I can do a test with a similar setup.
Patrick.
Hello Patrick
Thanks a lot for your detailed answer. This is very much appreciated! I would be using it with a Faulhaber 3274 BP4 motor (48V version, 152W, 3,44A continuous, 2 poles). However, it would be for a haptic application with very low speed (300-400rpm) and therefore I use the 48V version to keep the required current low (even though I am using a 12V supply). The RMS current/torque requirement is hard to estimate at this point but I know that it might require 3-4A continuously during a few seconds sometimes. I think it seems feasible when I compare it to your application.
Raphael
Hi Pat,
First of all: congrat for your smart work !
Is the any news concerning next new release (all what I have: 02-ALPHA) ?
I plan to try it (AS5601 encoder with a small 7 pole-pair BLDC motor).
I am particularly interested in "Position control with torque limiter and velocity/acceleration profil" mode.
Thanks in advance !,
Peter
Hello Petersesztak,
Sorry for late reply. New firmware is coming.
I have deleted the mode with velocity/acceleration profil. But it is quite simple to restore it.
Firmware works fine with an I2C encoders, like AS5600. The position control loop is running at 4KHz at the moment.
Patrick.
Hi Pat, I'm trying this with a 4250 580kv motor (6 pole pairs) and AS5048A. At the moment I'm hard-coding the mode to REG_CONTROL_MODE_VELOCITY_TORQUE and trying some fixed values for goal_velocity_dps. With some values the motor will turn with a rough sound, but usually it will just screech and shudder occasionally, and in both cases the ESC gets very hot. Hopefully this just means the PID settings need to be tuned. Looks like I need to buy a CANbus to USB adapter to use the GUI configurator?
Hello iforce2d,
Sorry for late reply. There was issues with my FOC implementation, when using a AS5048A (angle estimation latency, erronous near-zero angle...). I have tried to fix them in the new release. The GUI script uses the USB interface (VCP). For faster control, you have to use CAN interface.
Patrick.
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...
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.
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!
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...
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.
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!
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.
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.
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.
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)?
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 !
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!
Become a member to follow this project and never miss any updates
By using our website and services, you expressly agree to the placement of our performance, functionality, and advertising cookies. Learn More
Hi Pat,
Are you still working on this? The code last update was 7 months ago. I just got this board and would like to make it work with AS5047P SPI encoder.