B-G431B-ESC1 + Maxon Motor (include hall sensor)

I’m trying to use the SimpleFoc library to control the position of a Maxon motor (458375) with a B-G431B- board and its hall sensors. I’m not sure if is feasible at all. Right now I only have the pin layout.

Layout:


Motor:
Maxon motor

If you could give me some guidance on this topic I really appreciate

Wow, the Maxons are like the Ferraris of BLDC motors - I wish I had them, but can’t afford it :smiley:

I think it should work. I’ve never tried the Hall sensors myself in SimpleFOC but it is implemented.

Have you had a look at the example code?

Hi runger,
thanks for your answer. I will try that and let you know.
Regarding the motor neither do I. I’m writing my semester thesis so the uni gave me the motor. However, I’m struggling a little bit with the whole system.

I would advise to try to get it running first with just open-loop control, for that you don’t need the hall sensors.
Once this is working, move to closed loop with the hall sensors.

Be careful to set the current limit - the resistance is less than 1Ω, and you don’t want to burn anything while experimenting (although both motor and driver board can handle quite a bit).

1 Like

I’ve got something similar working with that drone kit. I was using hoverboard motors with halls. I’ve done a few YouTube videos with that setup. The early ones don’t use simplefoc as at the time 6pwm wansnt supported on stm32.

Are you aware of my board variant pull request to stm32duino. It makes using this board a lot easier. It still hasn’t been merged yet :confused:


This sets up the timers and pin maps and defined the purpose of all the pins.

I’ve found the drone kit a bit too delicate for my fat fingers so have moved on to using VESC which is more sturdy and far more powerful

One final thing, i found the pull-ups on the halls to be inadequate. I added some external 1k pull-ups , without it i was getting ghost interrupts when motor was driven.

Hi @Owen_Williams thanks for your reply. I will definitely check your variant. Right now I’m trying to gather more information about this kit and how to use it with the Maxon motor.

I would like to check your video on YouTube. Do you have some links to this topic?

Best regards

This one is probably the most accessible. There is a link to code in the comments

3 Likes

Hi @Owen_Williams I could use the board with platformio and I using the video Simplefoc_tutorialto do the configuration. Till now I can move the motor with my hand and I can read the values from the hall sensors and the velocities. However if I try to use current then my power supply goes crazy. The main difference between the motor in the video are pole pair number (my is 1 ->Datasheet and that I need 24V with max current 3.45 A) and my motor has a gearbox (Gearbox). Do you have any idea why the voltage is droping like from 24 V to something below 10V and the current just pop up to the max value (3 A regulated) ?

Best regards.

PS: Sorry for my english it is not my mother tongue.

Good job you were using your psu, hopefully your board isn’t damaged. I’d drop your psu current limit to 500mA until you’ve built up more confidence with your hardware/software.

So I’d look at the openloop velocity example for your next step (i.e ignore your hall sensors for a bit). It’s in the git repo. Make sure you set

motor.voltage_limit=1
driver.voltage_limit=1
motor.voltage_sensor_align=1;//not needed until closed loop

With those settings you are doing software limiting so your psu should not fade.

At 500mA, i expect you’ll be able to do at least 5 rad/s.

If the above works, then move next to voltage control example. In this mode the x in motor.move(x) is the voltage so don’t set it to above 1 until you get confident about heat/amps.

@Owen_Williams thanks for your help. Besides that I’m not using the whole power of the motor It is working (open loop angle and velocity). The voltage control was also ok. The close loop is a little bit tricky with the PID values. The only thing that I noticed and it is a little bit weard. Using the velocity control I set my target speed as 5 but the shaft is moving negative (0; -1; -10 and so on). Is this behavior for you familiar?

That is familiar. I think there is an ‘angle’ bug with hall sensors. I don’t do much with angle so haven’t fixed it.

The workaround is to switch 2 of your motor wires around.

It’s a weird little bug because it doesn’t affect velocity control and the sensor direction detection is working.

I think anyone with halls working in angle mode has a 50% chance of hitting this big depending on how their 3 motor wires are connected

Hi ,
I am using the same board from ST and loading the pmsm motor through a dyno,when doing so at higher rpm>1500 rpm ,I am getting some speed oscillations .
At speed<1500 it is able to track the load profile

In the snapshot the torque is in oz-in on y axis