B-G431B-ESC1 Discovery kit question

First, great work with the Simple FOC library and the community.

I am considering working with B-G431B-ESC1, and have a question.

My intention is to use B-G431B-ESC1 without the daughterboard (cut it out), in direct PWM mode.

Does the board support forward/reverse PWM control, or I need the STM32 daughterboard?

I need to drive an R/C back and forth. Reading through the documentation it seems it’s impossible?

Thanks!

Why do you want to snap of daughterboard? I could understand this for a drone where weight might be important. But i find it convenient for programming and serial debug.

If you snap off the daughterboard then you’ll have to use some small solder pads (swd) and an external stlink to program (instead of the usb and stlink on daughterboard). As well as swd there are 3 other groups of pads.

  1. Gnd, 5v, rx/tx, pwm (5 pads). Pwm can be used with/without daughterboard. Rx/tx for serial debug without daughterboard. Note rx pad only works if daughterboard is removed.
  2. Can pads
  3. Encoder/hall pins +gnd and 5v (but others have used this for i2c)

I suspect you can use this in the way you want. It is smaller than i expected, hard to solder and has heat issues (when not being cooled by drone rotor blades) but is quite versatile.

Thank you. However my question was, does it work in PWM mode forward/reverse without DB?

DB is designed only for programming. Program, snap the cracker and done. Need more, just buy another cracker with a DB.

Yes, it’s small, that’s why you need a heat sink. Liquid cooled would be best. I need to pump 40A out.

So, does it work in PWM mode forward/reverse without DB?

Thanks!

Hey, it depends on the software you put on it.

If you plan to use SimpleFOC on it, you will have to write some code attaching the PWM input to set the target speed. If you write that code to support forward/reverse, then it will work as you want.

There is some example code for PWM input controlling stepper motors. I think it can be easily adapted to your needs.

The presence of the daughter-card has no connection to this question, I think. But I would definately leave it on until your design is finalised and tested, it will be hard to program and debug the board otherwise.

Others will perhaps disagree, but 40A out of these boards seems unlikely to me (i know the datasheet says it’s possible but mosfets were getting super hot at 50W with no cooling). You’d have to really do something special with cooling. I’d suggest the vesc 4.12 or similar (e.g flipsky clone) which have a big heatsink. They are 3x the price though :slightly_frowning_face:.

Thank you. Please let me know I got it right. To summarize:

  1. Simple FOC is guaranteed to work on the B-G431B-ESC1.
  2. Simple FOC does not currently support PWM forward/reverse feature on the board PWM pin.
  3. Need to write code to interpret PWM input (talking RC servo mode not digital PWM) and use the Simple FOC calls on top to drive the BLDC as there is no call to directly bind the rot-speed/torque/angle to PWM.

As far as cooling that’s tangential, as I will connect liquid cooler/peristaltic.

The end idea is to drive the BLDC as an off-shelf digital servo.

Did I get this correct?

Thank you.

Hi, yes, excellent summary, although I’d say #3 isn’t as hard as it may sound, since I know other people have done it and there is example code kicking around the forum/github somewhere.

RC-Servos signals really are just PWM, traditionally with a 20ms period and the position encoded in the duty cycle, which is typically varied in the range around 1ms-2ms. How you interpret that is up to you, e.g. quads use the full scale for one direction, while RC-car ESCs have a “0 position” somewhere in the middle, and use the lower duty cycles for reverse and the higher ones for forward.

If attaching standard RC components I would pay careful attention to the signal out of the receiver to be sure it is ok for the PWM pin of the B-G431B-ESC1; although it does say it is 5V tolerant…

Runger,

Thank you.

I already ordered a few boards in case they fry while work, and will post code if I get it to work.

I’ll be using Arduino, if I post my code can someone take it and incorporate it into the core Simple FOC library? I’m terrible at git. Also, since I use only this board, will this be generic enough for the other boards?

Just curios.

Thanks.

These kind of ratings for drivers usually mean peak current and not continuous current. Most likely this board can handle 40A peaks without much issue and big continuous currents that will depend on the heat-sinking and cooling of the user.

According to the documentation:

3-phase driver board for BLDC/PMSM motors with discrete N-channel 60 V, 120 A STripFET F7 power MOSFETs

It should handle 120A peak (yes, 120) so I assume with reasonably fast fluorinert liquid cooling and 12V/40A out of a high current converter would be just fine.

At worst it will blow up, heh.

@Valentine - do you have experience with stm32 chips? Do you know what a ‘board variant’ is and how stm32duino fits into the arduino ecosystem? The reason I ask is that this board has still not been merged into stm32duino which means that the board variant files need to be manually copied into the correct locations for arduino to find it. I think about 6 people on this forum have managed this process and there are descriptions of how this is done on other threads. @Wittecactus wrote up an excellent intro to this here:

You’ll of course need an stlink and an ftdi usb/serial converter after you snap that daughterboard off.

What do you intend to add to the SimpleFOC library? Have you taken a look at the examples to get an idea of the code you’ll need to write in order to use the library.

I’ll be happy to! Whether or not it can be added does kind of depend how generic it is - but we have a new SimpleFOC-drivers library where we can add such things, even if they are STM32 specific.