Hi! Is there any plan to support the raspberry pico as a microcontroller in SimpleFoc? Are there any advantages/disanvantages with using this platform?
We are definitely in to support it!
So far it was not really supported by the Arduino IDE but that seems to have changed so I hope to be able to support it soon.
It might even work out of the box with the library (without high frequency pwm) already.
Regarding the advantages and disadvantages I am not maybe the best person to aswer but from what I see it pretty small, has s powerful cpu, the price is reasonable and it has a potential to have a great community.
But it seems to be less powerful than most of the esp32 and stm32 boards commonly used with simplefoc.
I have actually started supporting it. If there is interest, I will accelerate work on that
The Pico is a clear win, IMHO, since it is supported by Arduino IDE, very low cost, and quite powerful. It is also spreading like wildfire.
I think the RP2040, the SoC on the Pico, is a very nice chip for several reasons:
- all the pins support PWM
- the PIOs can presumably be used to do additional fancy PWM
- it has 2 cores, for running multiple motors or doing communications/control on the side
- The SoC design needs minimal external component count - looks like it will be easy designing your own boards with this chip
I’ve been waiting for this pico explorer base to come in stock. It’s got a two half bridges on it. I expect they aren’t that powerful but might be able to do FOC on a small stepper.
Hi Sir Richard,
Am too excited also about this tiny mighty MCU , I got 4 of this stuff.
But am figuring out of using SimpleFOC and ROS1 (my robots program are yet to configure to ROS2). So perhaps other had still port this in rosserial.
By the way its running already using Arduino IDE.
Any idea. about rosserial & simpleFOC?
I saw that board, and it was sold out! But ordering from Pimoroni has gotten more expensive and slow since the Brexit for me here in Austria.
I’m not aware of a ROS driver for SimpleFOC so far. I guess rosserial is on the transport level, and you’d have to figure out the kind of message and object type you would use to address and talk to SimpleFOC from ROS.
It would certainly be exciting to hear about it if you manage to make a connection between the two!
I have found this on the web:
Hey, just to let you know I have this working locally. I still need to finish support for 6-PWM, but it should be done soon. 3-PWM is working, and the frequency can be set between about 20kHz and 66kHz. PWM is configured to be phase-correct, and updates to the duty cycle are always glitch-free on the Pico.
I still need to finish 6-PWM, the normal PWMs on the RP2040 do not support automatic hardware dead-time-insertion. I assume it will be possible using the cool PIO modules of the Pico, but using them would be a lot more complicated (certainly a fun challenge for someone who is interested) and it would still be a kind of software-DTI in the end. So I think I will just go with software-based dead time insertion using the standard PWMs and keep things simple.
Current sensing also still needs to be done.
Supporting the Pico was actually very easy thanks to its Mbed C APIs. The difficulties arise on the library side, because there are few incompatibilities between SimpleFOC and the Pico Arduino headers. In particular, SPI is quite different, and therefore the MagneticSensorSPI class doesn’t work at all at the moment.
I will push my work to a branch soon so people can take a look, but I fear due to the compatibility issues I mentioned it might still be a little while before it can be merged to a SimpleFOC release version.
Support for Raspberry Pi Pico (and the RP2040 MCU in general) was added in release 2.1.1