Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Useful stuff for Raspberry Pi Pico using PIO code

    Scheduled Pinned Locked Moved
    Third-party add-ons
    4
    6
    1.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • o_lampeundefined
      o_lampe
      last edited by o_lampe

      I was looking for useful samples of PIO code for the RPi Pico state machines and stumbled across this:
      Hardware-QED for RPi Pico

      This tool might be useful as_is, but maybe we can make it work as a closed loop stepper driver, too?

      o_lampeundefined 1 Reply Last reply Reply Quote 0
      • o_lampeundefined
        o_lampe @o_lampe
        last edited by o_lampe

        @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 wishlist

        My 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.

        1 Reply Last reply Reply Quote 1
        • rjenkinsgbundefined
          rjenkinsgb
          last edited by rjenkinsgb

          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.

          Robert J.

          Printers: Overlord pro, Kossel XL+ with Duet 6HC and "Frankentron", TronXY X5SA Pro converted to E3D toolchange with Duet 6HC and 1LC toolboards.

          1 Reply Last reply Reply Quote 1
          • Nightowlundefined
            Nightowl
            last edited by Nightowl

            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.

            Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
            I'm still on my learning curve, so take everything I say with caution!

            RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

            dc42undefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @Nightowl
              last edited by

              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.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 2
              • o_lampeundefined
                o_lampe
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA