After compiling the code and updating the board, I can’t even get a simple blik of the led to work: It compiles and uploads without any problem but nothing happens on the board.
I would like to know if anyone has tried to run SimpleFOC + Arduino on STM32F405RGT6 and if it occurs to them that I may be doing it wrong.
I really appreciate that if you could copy and paste such timer/pll scalers.
Is SystemClock_Config ? I have CubeIDE installed and I use it to do another project with this board but I don’t know what function I have to copy and where I have to put it to make it work.
Regards
PD: I just copied the SystemClock_Config () function that I have in CubeIDE and call it from setup () but it seems to have no effect whatsoever.
If you have a 8Mhz or 25Mhz HSE (or no HSE at all) then my SystemClock_Config() won’t work for you and you’ll need to do your own work in that Clock config tool:
I publish here your smart and effective recipe applied to my case with 8 Mhz HSE and configuration and MCU running at 100 MHz in case someone else could have this issue.
I am starting the design of a board with the same MCU. I’m still not sure which controller to use. I am at a fairly early stage. I’ll take a look, I’m sure I can learn something
What is your target motor/power? I’m also playing with seeing if I can get SimpleFOC running on a vesc 4.12 which uses the same chip. Perhaps that is suitable?
I would like to build a BLDC motor controller to develop an robotic actuator that can be integrated into ROS and with it carry out different projects
I think that having 2 Nm of holding torque will be enough for my DIY projects. I’m still not clear about what BLDC motors are necessary to get that torque… a lot to investigate and learn yet.
Check out this youtube video I found for a torque test using a hoverboard motor:
In the video, Hans managed ~2.5kg at 50cm which I believe works out about 12Nm. Those hoverboard can handle 250W. The vesc 4.12 can power 1-2KW I think. I assume that no gears are involved.
So hoverboards are overkill. Take a look at this page which links to torques of various motors:
Hey @Owen_Williams glad to see your board. My pcbs are on the way, offcourse with btn8982. I reviewed your schematic but Tja1051t/3 CAN transceiver works with 3.3v uCs but it should supply to 5v. I looked at many of them for my board but there are a few CAN ics working with 3.3v power supply like SN65HVD23x.
Feng - the realtime current feedback is coming. The problem is that the solution is very board dependent. Antun (the main developer) has it working on his newer SimpleFOC boards but it doesn’t work on other boards yet. I’d like to get current sensing working with a drv8302.
My microcontroller is ESP32. By reading the IS terminal voltage of BTS7960, the current obtained according to the official gain ratio is shown in the figure. Why is this so? How do you verify his correctness?
// The BTS7960 Half Bridge Drivers have a current sense ratio of kILIS = IL / Iis = 8500.
// The external resistor Ris determines the voltage per output current. On the IBT2 there
// should be a 1kohm resistor for Ris. On my boards though, there are 10kohm resistors!
// Iis = Vis / Ris.
// Vis has to be measured on an analog port.
// Ie. Vis=0,5V with Ris=10Kohm: Iis = 0,5V/10Kohm = 50uA; IL = 8500Iis = 850050uA = 0,425A.
// Ie. Vis=0,05V with Ris=1Kohm: Iis = 0,05V/1Kohm = 50uA; IL = 8500Iis = 850050uA = 0,425A. //Serial.println(avgAnalogRead(IA));
// Serial.println((avgAnalogRead(IA)-142)/0.913);//mv
Serial.println((avgAnalogRead(IA) - 142) / 0.913 / 1000 / 1000 * 8500);
I imagine the code could be ported to cube fairly easily but that is not an aim of this project at the moment. We want to provide a library that works on a wide variety of Arduino board that support the Arduino wiring-based framework.
The SimpleFOC licence is permissive, so you are free to port, and I’d be interested to hear how you get on!
We don’t actually use much of the wiring api e.g the stm32 support already uses HAL for pwm.
Which project are you taking about? There are a couple mentioned in this thread. I’m not working on the driva at the moment, instead I’m using a dual vesc board which is stm32f405 based.