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

    CNC style Pendant

    Scheduled Pinned Locked Moved
    Hardware wishlist
    28
    155
    17.8k
    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.
    • Fdemundefined
      Fdem
      last edited by

      Why paneldue must be fix ?

      When i use pendant, i'd like see tool coordinate.

      In fact, pendant and encoder wheel can be the same device and when not used is the cnc screen

      Danalundefined 1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by

        Very VERY preliminary ideas for implementation:

        Buy one of these for about USD $10 (shipped) on Amazon: https://www.amazon.com/gp/product/B079PVCF2G/
        Programmable with Arduino IDE, and TONS of input pins.

        Follow these directions to set up your Arduino IDE for this board. When the physical board arrives:

        • Hook it up (USB mini cable)
        • Use the "Tools" menu, "Board", in the IDE to select ""ESP32 Dev Board".
        • Select a port just like you do for an Arduino.
        • There will be a bunch of new settings in "Tools", between "Board" and "Port"... leave them all at default.

        From that point, it programs just like an Arduino. Most libraries will work. Any sketch or library that DIRECTLY manipulates hardware registers will not work.

        Physical Wiring: Something like this:
        0_1566060266676_920e0b1f-d05c-4c15-9cd2-4ba14f43e258-image.png

        It is possible that Diodes will be needed on TX2/RX2, if this is "Parallel" with a PanelDUE.

        Arduino Sketch: Below is the beginning of an idea that can be expanded. Note, this compiles and outputs correct diagnostics when I ground one of the axis or feedrate switch pins, but I have no way to truly test it, and absolutely no way to test the encoder wheel; so wheel code is just not there (yet).

        Also note the "style" or "architecture" of this sketch is VERY "brute force", there would be much more elegant ways to code this. I'm intentionally keeping it simple so beginners can understand, and change, it.

        // Duet2_CNC_Pendant
        // Intended to run on an ESP32 and interface hardware pendant to Duet3d/RepRap
        // controller via TTL serial at 3.3V. Intended to run "in parallel" or "in place"
        // of a PanelDue. 
        // Example pendants can be found on E-bay; must have individual wires (not usb).
        
        /*
        Copyright (c) 2019 Danal Estes, all rights reserved. 
        Permission is hereby granted, free of charge, to any person obtaining
        a copy of this software and associated documentation files (the "Software"),
        to deal in the Software without restriction, including without limitation
        the rights to use, copy, modify, merge, publish, distribute, sublicense,
        and/or sell copies of the Software, and to permit persons to whom the Software
        is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
        IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
        DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
        ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        */
        
        
        //Encoder Wheel 
        #define WheelA1    39
        #define WheelB1    36
        #define WheelA2    35
        #define WheelB2    34
        
        // Axis Switch
        #define SwitchX    33
        #define SwitchY    32
        #define SwitchZ    27
        #define Switch4    26
        #define Switch5    25
        #define Switch6    23
        
        // Speed Switch
        #define SwitchX1   22
        #define SwitchX10  21
        #define SwitchX100 14
        
        // Second Serial Port (for parallel with, or in place of, PanelDue)
        #define RXD2 16
        #define TXD2 17
        
        
        int  feedRate = 1800;
        char axis     = 'X';
        
        void setup() {
          Serial.begin(115200);
          Serial.print("");        // Clear any garbage from boot. 
          Serial.println("Duet2_CNC_Pendant initalizing.");
          Serial2.begin(57600, SERIAL_8N1, RXD2, TXD2);  // Baud must match PanelDue (if one is present)
        
        //Encoder Wheel 
        pinMode(WheelA1,INPUT_PULLUP);
        pinMode(WheelB1,INPUT_PULLUP);
        pinMode(WheelA2,INPUT_PULLUP);
        pinMode(WheelB2,INPUT_PULLUP);
        
        // Axis Switch
        pinMode(SwitchX,INPUT_PULLUP);
        pinMode(SwitchY,INPUT_PULLUP);
        pinMode(SwitchZ,INPUT_PULLUP);
        pinMode(Switch4,INPUT_PULLUP);
        pinMode(Switch5,INPUT_PULLUP);
        pinMode(Switch6,INPUT_PULLUP);
        
        // Speed Switch
        pinMode(SwitchX1,INPUT_PULLUP);
        pinMode(SwitchX10,INPUT_PULLUP);
        pinMode(SwitchX100,INPUT_PULLUP);
        }
        
        void loop() {
          if (digitalRead(SwitchX1  ) == LOW) {feedRate = 1800;}
          if (digitalRead(SwitchX10 ) == LOW) {feedRate = 18000;}
          if (digitalRead(SwitchX100) == LOW) {feedRate = 180000;}
          // Maybe put in logic to only include feedrate if it changed. 
        
          if (digitalRead(SwitchX) == LOW) {axis = 'X';}
          if (digitalRead(SwitchY) == LOW) {axis = 'Y';}
          if (digitalRead(SwitchZ) == LOW) {axis = 'Z';}
          if (digitalRead(Switch4) == LOW) {axis = '4';}
          if (digitalRead(Switch5) == LOW) {axis = '5';}
          if (digitalRead(Switch6) == LOW) {axis = '6';}
        
        // *******************************************
        // Need something to read wheel encoder here. 
        // *******************************************
        
          if (1) {    // Need "if the wheel moved" logic here. 
            // How far to move?? Numerically?
            int m = 10; 
            Serial.printf("G0 %c%d F%d\n",axis,m,feedRate);   // For Debugging
            // Possible need to listen before transmitting to avoid collisions.
            Serial2.printf("G0 %c%d F%d\n",axis,m,feedRate);   
          }
         // Required somewhere in main loop on ESP chipset to allow background tasks.
         yield(); 
         // If any part of sketch does not yield() or delay() for about 3 seconds, chip will reboot. 
        } // End main loop
        

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 1
        • Danalundefined
          Danal @Fdem
          last edited by Danal

          @fdem said in CNC style Pendant:

          Why paneldue must be fix ?

          This is not a "fix" for panelDUE, it will not affect existing panelDue at all.
          It is an addition, for people who prefer a "hard click" wheel to a touch screen. By all means, anyone who likes the screen should stick with it.

          When i use pendant, i'd like see tool coordinate.

          In fact, pendant and encoder wheel can be the same device and when not used is the cnc screen

          Then you are in great shape. Use the screen you have.

          There are some other folks that specifically want a pendant with a click wheel, not a touch screen.

          Delta / Kossel printer fanatic

          1 Reply Last reply Reply Quote 0
          • Fdemundefined
            Fdem
            last edited by

            I already done my own pendant
            I use a a chinese pendant and a stm32f407 board from waveshare

            It work pefectly

            Why can't do a really simple pendant with only the most important thing for me :

            • the rotary encoder
            Danalundefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators
              last edited by dc42

              If we ever manufacture a pendant interface, we will use a attiny44a processor, because it can be obtained in a small package (smaller than the attiny25 or attiny45), is cheaper than the attiny45, and we already use them in two types of filament monitor and the Smart Effector. It's only work pending for Duet 3 that is stopping us making a prototype now.

              I appreciate that for someone building a one-off, using an Arduino Pro Micro or ESP8266 board or Teensy or similar is easier.

              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

              Skysurferundefined 1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal @Fdem
                last edited by

                @fdem said in CNC style Pendant:

                I already done my own pendant
                I use a a chinese pendant and a stm32f407 board from waveshare

                It work pefectly

                That is fantastic. Are you willing to share the exact pendant, the wiring, and the STM code?

                Why can't do a really simple pendant with only the most important thing for me :

                • the rotary encoder

                I'm confused... you just said you already have one that works perfectly? Are you asking for something else to be developed?

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 1
                • Fdemundefined
                  Fdem
                  last edited by

                  @danal said in CNC style Pendant:

                  I'm confused... you just said you already have one that works perfectly? Are you asking for something else to be developed?

                  i have just reply to this post 🙂
                  for me it's possible to have a usefull simple pendant with only 3 inputs

                  @dc42 said in CNC style Pendant:

                  BTW, PanelDue has a connector with 3 spare inputs on it. I intended this to be used to support a rotary encoder with push button. This connector might be useful to connect a pendant, however I expect a pendant would need more than 3 inputs.

                  Danalundefined 1 Reply Last reply Reply Quote 0
                  • Danalundefined
                    Danal @Fdem
                    last edited by

                    @fdem said in CNC style Pendant:

                    @danal said in CNC style Pendant:

                    I'm confused... you just said you already have one that works perfectly? Are you asking for something else to be developed?

                    i have just reply to this post 🙂
                    for me it's possible to have a usefull simple pendant with only 3 inputs

                    @dc42 said in CNC style Pendant:

                    BTW, PanelDue has a connector with 3 spare inputs on it. I intended this to be used to support a rotary encoder with push button. This connector might be useful to connect a pendant, however I expect a pendant would need more than 3 inputs.

                    Again, that's great. As you point out, a rotary encoder only needs two inputs... phase A and B (plus power and ground). Again, this discussion is about doing more than just the encoder.

                    Also again, are you willing to share what you have done? Post a wiring diagram? Post the code? Here, or on github?

                    Delta / Kossel printer fanatic

                    1 Reply Last reply Reply Quote 1
                    • Fdemundefined
                      Fdem
                      last edited by

                      Yes i'll share soon

                      1 Reply Last reply Reply Quote 0
                      • Skysurferundefined
                        Skysurfer @dc42
                        last edited by

                        @dc42 Hi, new to this forum. I've just put together a CNC router, specifically a Workbee. I'm gobsmacked there's no way to use either the keyboard (ethernet), or a pendant. Or am I missing something? I may have been spoilt having come over from Mach3, as the Duet is a modern board.
                        No idea if this is the best place to renew the interest in this, but does anyone realise just how many people would love this facility?

                        When I replied to this thread, I was informed that it was an old thread. August last year? Six months is old? 🙂

                        TIA, & stay safe!

                        A Former User? 1 Reply Last reply Reply Quote 0
                        • A Former User?
                          A Former User @Skysurfer
                          last edited by A Former User

                          @Skysurfer said in CNC style Pendant:

                          but does anyone realise just how many people would love this facility?

                          To be blunt; not enough* - but that probably will change as more CNC users start using Duet boards. Ofc you can argue "build it and they will come". I'm still planning on making a USB gamepad work with the Duet3 and RaspberryPi but not before the RepRapFirmware and DuetSoftwareFoundation is more mature. The majority of the Duet users are 3d-printing and have a limited need for a pendant.

                          This approach is also quickly becoming more relevant as next iteration of the Duet 2 family will most likely also support interfacing to a Raspberry Pi or other singble board computer.

                          *)duet people have talked about making a pendant interface, but also after Duet3 is more stable

                          1 Reply Last reply Reply Quote 0
                          • gtj0undefined
                            gtj0
                            last edited by

                            Actually, I've got Python code mostly written that recognizes keypresses from programmable keypads like this one and sends them to the DSF. It actually works with most USB HID devices including things like foot switches.

                            Maybe I'll finish it one day. 😞

                            3250d640-ae63-47f9-97df-975fc264ebd2-image.png

                            You have to have 2 right feet to use this one though.
                            93d17b57-7c56-4ef9-ac24-d59be7e9c7aa-image.png

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

                              For those using Duet 3 + SBC there are plenty of USB-connected CNC pendants available, and I expect someone will write a DSF plugin for them soon.

                              For other Duet users, what's needed is a a board based on a small MCU to convert the signals from something like this https://www.ebay.co.uk/itm/EU-Send-4-Axis-MPG-CNC-Machine-Controller-Handwenheel-Pendant-w-Emergency-Stop/273588909379 to serial commands to feed to the PanelDue port. We've had it in mind to design one for some time, but we haven't found time to do it yet.

                              If anyone is interested in using a v3 PanelDue controller board for this, I can help with the firmware, because the PanelDue firmware already has most of the necessary functions. Alternatively, an Arduino Nano probably has enough pins.

                              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

                              Danalundefined 1 Reply Last reply Reply Quote 0
                              • Danalundefined
                                Danal @dc42
                                last edited by

                                @dc42 said in CNC style Pendant:

                                For those using Duet 3 + SBC there are plenty of USB-connected CNC pendants available, and I expect someone will write a DSF plugin for them soon.

                                For other Duet users, what's needed is a a board based on a small MCU to convert the signals from something like this https://www.ebay.co.uk/itm/EU-Send-4-Axis-MPG-CNC-Machine-Controller-Handwenheel-Pendant-w-Emergency-Stop/273588909379 to serial commands to feed to the PanelDue port. We've had it in mind to design one for some time, but we haven't found time to do it yet.

                                If anyone is interested in using a v3 PanelDue controller board for this, I can help with the firmware, because the PanelDue firmware already has most of the necessary functions. Alternatively, an Arduino Nano probably has enough pins.

                                For a one off, and even limited production or DIY runs, I leaned toward Arudino Pro Mini or Adafruit Trinket in the past. At this time ESP32s are purchasable through normal retail channels for $5 each, and even less if you are willing to wait. Overkill to the Nth degree, but actually cheaper...

                                Of course, some flavor of AtTiny if produced in any quantity.

                                I may take a cut at a "DIY" based on a hardwired pendant, and an ESP32. I'll order the pendant today.

                                Delta / Kossel printer fanatic

                                1 Reply Last reply Reply Quote 1
                                • Danalundefined
                                  Danal
                                  last edited by

                                  Now I remember why I never order one. The are $60 to $70 (wired, not USB) on Amazon, or $30 on Aliexpress with $30 shipping and a six week wait.

                                  Bit the bullet. It will be here mid next week.

                                  Delta / Kossel printer fanatic

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

                                    I've just ordered a pendant similar to the one I linked to, and an Arduino Nano, so I should be able to help. I considered using an attiny but I don't think it has enough i/o pins.

                                    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

                                    arhiundefined 1 Reply Last reply Reply Quote 0
                                    • arhiundefined
                                      arhi @dc42
                                      last edited by

                                      @dc42 btw, can paneldue usb port behave like master to ch430/ft323/similar usb2serial device? and receive commands from there (or just passtrough to duet)?

                                      A Former User? dc42undefined 2 Replies Last reply Reply Quote 0
                                      • A Former User?
                                        A Former User @arhi
                                        last edited by

                                        @arhi said in CNC style Pendant:

                                        @dc42 btw, can paneldue usb port behave like master to ch430/ft323/similar usb2serial device? and receive commands from there (or just passtrough to duet)?

                                        currently usb is only used for programming, specs for the ATSAM3S2 say device only, no (mini) host support like the bigger chips has

                                        arhiundefined 1 Reply Last reply Reply Quote 0
                                        • arhiundefined
                                          arhi @A Former User
                                          last edited by

                                          @bearer I have V3 with ATSAM4S4B, that's iirc cortex m4, but if the majority of the panel's out there are atsam3s2 than the approach is wrong 😞

                                          A Former User? 1 Reply Last reply Reply Quote 0
                                          • A Former User?
                                            A Former User @arhi
                                            last edited by

                                            @arhi stil says "device" support, some of the bigger chips say device + mini host, so same same but different i guess. interesting there are different chips (i only looked at the bossa pictures in a forum thread, easier than going to find the actual paneldues)

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