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

    Custom CNC Pendant Application

    Scheduled Pinned Locked Moved
    General Discussion
    5
    12
    614
    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.
    • MadewithMayoundefined
      MadewithMayo
      last edited by

      I am embarking on building a 5-axis microscope stand to position insects precisely for photography. What does that mean, imagine a standard 5-axis CNC machine but instead of cutting metal, you are taking pictures of bugs at high magnification. I have several printers that I have converted to Duet Maestro and Duet2 wifi boards so using a versatile duet board feels fairly natural and a safer starting point then diving into Arduino madness.

      So, here are some questions that I would love some guidance on.

      After some research, I realized that using the CNC pendant function would be the best way to control this but I need to add and subtract some things to make it a perfect fit.

      What do I need technically?

      In total, I am going to need 2/3 rotary encoders (to control 5 Stepper motors), 1 or 2 selector switches (to control step size and which steppers to control). And that's it! but it departs from the standard pendant design as listed/ in the firmware/setup guide. The function of the selector switches is also different from a traditional pendant.

      The two encoders will be used like an Etchasketch; each encoder will have a knob attached to it and control 1 stepper motor at a time, either X/Y or A/B motion. A selector switch will determine which stepper motors are being controlled.

      The second selector switch will switch the control of step size like a standard pendant already does (1x/10x/100x)

      How do I use Z axis? Third encoder? Not sure, but probably will use another encoder.

      Screen could be nice to show current settings so the paneldue pass through function will need to be utilized, and macro programs will eventually be added.

      So, in short...use the CNC pendant firmware to control a 5 axis machine with non-standard pendant inputs.

      1. Can you add more controls to the current Pendant firmware? (I unfortunately haven't had much time to dig and see what is in the current firmware)

      2. Is the main limiting factor for change the Arduino micro pro that is being used to create the Canbus signal? (17 io ports for use or something)

      3. Would a fictional picture help to understand what I am trying to do?

      Any help and further discussion would be great! All thoughts welcome!

      dc42undefined markzundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @MadewithMayo
        last edited by

        @MadewithMayo

        1. Yes you can, subject to having enough spare pins to connect the encoders.
        2. The pendant communicates with the Duet through a serial port. It does not use CAN bus.

        You might wish to consider using a Raspberry Pi Pico instead of the Arduino Pro Micro because it has more pins for connecting encoders etc. The main advantage of the Pro Micro is that it can be connected directly to optical encoders that provide 5V signals, while at the same time accepting 3.3V level input signals to pass on the signal form a PanelDue.

        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

        MadewithMayoundefined 1 Reply Last reply Reply Quote 0
        • markzundefined
          markz @MadewithMayo
          last edited by markz

          @MadewithMayo I've got a pendant I've been working on; to contrast the design... the pendant uses a Raspberry Pi Pico W with WiFi, a 3.5" touchscreen LCD, and the RRF Rest interface to communicate. I've got a board being made (2 weeks) that adds Lipo battery support to the Pico so the pendant can be wireless handheld.

          I'm planning to put two rotary switches (axis and speed) on the unit as well as one indicator dial for movement - much like a conventional pendant - see here -> https://www.amazon.com/RATTM-MOTOR-Handwheel-Emergency-MITSUBISHI/dp/B07CZ7F3Y3

          I'm writing it in MicroPython - but their Pico W port is not quite stable yet.

          I've written plenty in Arduino and in my personal opinion it's not a production OS.

          Why do it this way?

          a) I have three Duet3d systems that I'd like to control and having a wifi pendant lets me walk it around.

          b) I hate cables. They get caught on things and have finite lengths and physical failures.

          c) Writing a small amount of easily maintained Micropython seems easier than negotiating changes to a PanelDue set of code that's really not designed for my applications (such as a CNC router).

          My 2c.

          Mark

          Nightowlundefined 1 Reply Last reply Reply Quote 2
          • Nightowlundefined
            Nightowl @markz
            last edited by

            @markz
            I like the sound of that. I was looking at the Duet3 guidance with the conventional pendant, as per your link, but are you saying Arduino isn't the way to go?

            Happy New Year

            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

            markzundefined 1 Reply Last reply Reply Quote 0
            • markzundefined
              markz @Nightowl
              last edited by markz

              @Nightowl It's just my personal opinion but I'm not a fan of Arduino software.

              Arduino hardware is fine but it's very last generation and imho it's designed for hackers who want a quick sensor or monitor. The usual kit is an Atmega 328p - an 8 bit one-core processor with 1K ram and 32K flash at 20MHz.

              The Pico W, by comparison, is - a 32 bit dual core (M0+) processor with 256K ram and 2MB of flash at 133MHz with WiFi.

              achrnundefined Nightowlundefined 2 Replies Last reply Reply Quote 0
              • achrnundefined
                achrn @markz
                last edited by achrn

                @markz said in Custom CNC Pendant Application:

                The usual kit is an Atmega 328p - an 8 bit one-core processor with 1K ram and 32K flash at 20MHz.

                Off topic, but you could look at Teensy 4 - Cortex-M7 at 912MHz with 32 & 64bit hardware fpu, nearly 8MB flash, 1 MB RAM, more timers / hardware peripherals than you can shake a stick at (e.g. 49 different timers, on-chip RTC, quadrature decoders, 8 uarts with FIFOs, CAN Bus, multiple SPI and I2C), but all running withing the Arduino IDE and without the arduino-silly-pin-offset. Not 5V tolerant though. I don't know how well it's supported in/by micropython (but there is some support, google suggests).

                Arduino brought into this decade. Very nice.

                Downside is the hardware design is literally one-man-band (Paul Stoffregen) but with quite a lot of community support on software. If you want to do something tricky it's a very 'use-the-source' sort of community (though generally helpful - on the forums there's more a sense of 'not sure why you're asking that when you could just read the source / Cortex processor documentation' rather than one of 'RTFSource you cretin')

                https://www.pjrc.com/teensy/techspecs.html

                I haven't quite got over the learning curve on Pico W yet, and it wasn't helped when the first thing I tried to get my head round the state machines (something teensy doesn't have) with was some neopixel strips, and that turned out to have some flakiness in the supplied libraries.

                1 Reply Last reply Reply Quote 0
                • Nightowlundefined
                  Nightowl @markz
                  last edited by

                  @markz
                  Hmm, I appreciate the sentiment but I was thinking more Ford Prefect than Rolls Royce Corniche - and there seems to be a lot of support out there (if not too much!)

                  As long as it can do the job, and a couple of other little jobs I want it to do, I'll probably (simple) Arduino 😀 😀

                  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

                    @Nightowl if you are used to programming Arduino, RPi Pico is still a good choice. It costs less than most Arduinos and there is an Arduino port for it.

                    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

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

                      Sadly, I'm not used to programming anything, @dc42. This would be my first foray into the dark art, except the central heating!

                      Thank you, though. I'll take a look at it. I'm sure a Google search will bring something up...

                      EDIT: Just goes to show what I know - I didn't realise RPi Pico is a Raspberry Pi product. Now I understand, but boy do I feel slow!

                      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

                      1 Reply Last reply Reply Quote 0
                      • MadewithMayoundefined
                        MadewithMayo @dc42
                        last edited by

                        @dc42 would it be possible to change the selector switch on a pendant with a momentary switch? Several rotary encoders have a momentary switch built in and it could be nice to use it to change between settings that way instead.

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

                          @MadewithMayo that would certainly be possible but I think you would also need LEDs or some other way to indicate which mode was currently selected.

                          BTW the rotary encoder on the pendant that I built my design around is far better than the cheap rotary encoders that have built in push buttons.

                          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

                          MadewithMayoundefined 1 Reply Last reply Reply Quote 0
                          • MadewithMayoundefined
                            MadewithMayo @dc42
                            last edited by MadewithMayo

                            @dc42 I am breaking the mold a little since this will all end up in a microscope so any LEDs wont be visible anyway and I was hoping to find better encoders but the cnc pendant knobs are a little big. Outside of the cheap ones, it seems that just getting a rotary encoder that had over 400ppr was the next jump but thats a bit excessive for my needs. Maybe i'll regret it, we'll see how long it takes to get this experiment up and running. I really appreciate you filling in the gaps!

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