Useful stuff for Raspberry Pi Pico using PIO code
-
I was looking for useful samples of PIO code for the RPi Pico state machines and stumbled across this:
Hardware-QED for RPi PicoThis tool might be useful as_is, but maybe we can make it work as a closed loop stepper driver, too?
-
@all
If you find other interesting stuff related to RPi Pico ( PIO or normal code) feel free to post it here.
We could also collect other ideas here, that would be useful for 3D world in general.
Sort of: 3rd-party firmware wishlistMy ideas so far:
CNC pendant with @zapta's famous TFT-screen adaption
CAN-FD sniffer/analyzer
Trigger switches for macros with the same touchpad/TFT combo as above.
CoPro for Duet2 to share workload and/or SRAM for upcoming FW-features. -
For serious, accurate closed-loop encoder feedback the encoder system either needs to be interrupt driven from the encoder signals directly with no software involvement prior to that (which means a very fast CPU), sampled, preferably in a timer interrupt, at a rate faster than any possible input change rate, or you need to use a device that has hardware encoder inputs.
Hardware encoder units are available in various MCUs, eg. dsPICFJxxxMC devices have two hardware quadrature channels & various other dsPICs have one or two, plus many other hardware interfaces.
The dsPIC33CK256MP508 has two encoder channels and built-in CAN-FD; likewise dsPIC33CH512MP508 but with two CPUs as well.
Those look particularly good for direct Duet CAN compatibility?
Also the Arduino Due has two encoder channels.
The Pi Nano is an interesting device, but by no means ideal for CNC drive type use; there are far more suitable and still low cost devices.
-
Sorry to resurrect this post, but I started to look at the Pi Pico to provide "support services" for my CNC machine, with a view to taking some of the overheads away from the Duet3 MB6HC board.
Currently, my ideas are an IR digital tachometer, thermal sensor to control the enclosure fans for the Duet, and an XY laser zeroing system.
All I've got to do, is learn microPython - or any one of the other supported programming options.
-
We've been working with the RP2040 to see how we can use it in a Duet 3 system. We have a subset of CAN-FD working on a PIO and communicating with Duet 3 main boards. We haven't yet run this under heavy load to test whether it is reliably enough; but we plan to do this. If it proves reliable then it opens up the way for us to produce some low cost expansion boards.
The PIO in the RP2040 can indeed be used as a quadrature decoder. The PIO is fast enough that it can accumulate the count of transitions until such time as the CPU can read the count - much as hardware quadrature decoders built into some MCUs do. However, for closed loop our preference is to use magnetic encoders because they provide much greater resolution than typical quadrature encoders, at reasonable cost.
Our work on RP2040 can be found in the 3.5-dev branches of projects Duet3Expansion and CoreN2G on Github.
The dsPic chips with CAN-FD are interesting but unfortunately only 16-bit and with limited RAM.
-
I almost forgot I've started the thread. I remember I found the firebeetle M0 from dfrobots which is similar to the RP2040, but has "12MB* U-disk flash drive.
Could've been good for accelerometer data recording or more complex NeoPixel LED stuff.
But now that there is a semi-official CAN-FD implementation based on RPi's state machines, I think it's the route to look further.