Hi, all!
I’ve come really far in my journey in making a BLDC-powered “super blender” only to be thwarted by some Arduino code.
It seems the build flag -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
in this B-G431B-ESC1: Beginner guide + I2C guide by @ultra.robotics and this SimpleFOC 2.0 Tuning Guide - Part 1 by @Owen_Williams breaks my code. I tried just getting the LED on my wonderful B-G431B-ESC1 to blink, and I succeeded once I commented out this build flag. And I checked that the Serial Monitor works, too, which it does. Since those guides were written, the B-G431B-ESC1 has become officially supported by PlatformIO, so maybe no build flags are needed whatsoever. I don’t know how particular the compilation process for this board is. That’s one thing I’d like some clarity on. Moving on.
Once more following the brilliant SimpleFOC 2.0 Tuning Guide - Part 1, I was able to set up the Serial Monitor for read and write as per the guru’s instructions. Getting hall sensor readings worked without a hitch, too (link to section in video).
My problem was in the next section, getting the motor to spin with MotionControlType::velocity_open_loop
. Nothing. Tried with closed loop. Nothing. Tried blank code with SimpleFOCStudio. Nothing. Admittedly, my “trying” is better described as “stumbling”, so I won’t go into the specifics of what I’ve tried, so I’m just including this here link to my github repo with simplfoc platformio project(s)–platform.ini files and main.cpp files are relevant, and if there is a .gitignore
template I am missing, please do let me know.
I wondered if the key difference might be that @Owen_Williams in his guide uses hub motors with, perhaps, 10x or 100x higher phase resistance than my 0.0361Ω, 170KV, 40A, 7-40V, hall-sensored BLDC (Maytech MTO 5065-HA-C). I’ve confirmed the resistance and impedance using my VESC SIX EDU (miracle hardware) and VESC TOOL (miracle software)–which gives line resistance and line impedance, in case anyone tries to do the same.
I’ve got no choice but to keep trying, but I think it would really help me and future users to have an example of getting going with SimpleFOC on a B-G431-ESC1 and a low-inductance/low-resistance BLDC, as I think this is the ideal setup for any medium power motor application–the ESC costs $20 and you get an almost flat torque curve across the whole RPM range of your motor with no gearbox/transmission when you use three phase brushless commutation and sensors. I, myself, am making a blender/dough mixer/food processor to end all blenders/dough mixers/food processors, in case anyone was wondering
My hope is that I get my programs running and my repo can get merged them into the hardware-specific-examples folder of the Arduino-FOC library. Really don’t want anyone else to go through the same difficulty as myself this early in their development process. I’ll try to do the same for SimpleFOCStudio; it’s a GUI, there’s so much there, and the design is great, but it doesn’t give feedback as to whether one has connected to it correctly, and it seems I need motor.monitor printing stuff to my platformio terminal at the same time as the GUI, which seems quite counterintuitive to me? Actually, now that I think back to it, motor.monitor doesn’t work for me, either Definitely want clarity on this, too, and as many examples as possible. I’m rambling, now, sorry. Might continue in a new thread.
As a side note, I think a VESC is an amazing investment for anyone prototyping with BLDC’s. You can use it to profile seemingly any BLDC and generate a C header file listing every parameter the TOOL has for the motor and for the control algorithm it has generated. I’ve uploaded my own header file to this same github repo that my platformio project is in. I think in the future I’ll try to make a sort of transcriber that takes this header as input and spits out a main.cpp file for SimpleFOC. I’ll need to get quite a bit more literate in both softwares before that happens. Moving on…