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

    Gamepad for Jog

    Scheduled Pinned Locked Moved
    Duet Web Control
    5
    18
    1.1k
    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.
    • scrhallundefined
      scrhall
      last edited by

      Hi, I'm looking for information in case someone has tried it before.
      I'm trying to integrate a gamepad (for example the xbox one), although any gamepad connected to the pc would work, to handle the movement of the axes manually.
      My idea is to use the GAMEPAD API (https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API)
      to develop a small code in javascript that converts the keystrokes into GCODE.

      Any similar project that has made progress?

      I have seen on the forum some related to hardware connections through the screen port, but my intention is that we do not have to use any additional hardware apart from the gamepad itself.

      Sindariusundefined Donpiundefined 3 Replies Last reply Reply Quote 0
      • Sindariusundefined
        Sindarius @scrhall
        last edited by

        @scrhall I was thinking of doing this exact same thing as a plugin for DWC 3.2 . I've just been busy with the 3d viewer to get around to it. My idea was to track the gamepad and use the buttons to toggle travel distance. I'd prefer a continuous mode but not sure how well it would work without testing.

        1 Reply Last reply Reply Quote 0
        • Sindariusundefined
          Sindarius @scrhall
          last edited by

          @scrhall
          So the API part is pretty straight forward, the main thing will be to make a user interface that is able to capture those actions and set them to jog commands. Maybe if I get some time this weekend I could knock something out ๐Ÿ™‚
          https://imgur.com/a/sv1ozrQ

          1 Reply Last reply Reply Quote 0
          • Sindariusundefined
            Sindarius
            last edited by

            Wasn't planning to get to it this weekend but figured it couldn't be that bad.

            https://youtu.be/6wbT5lbflPA

            UI is going to need work but everything is getting set and it is issuing move commands.

            16579ba7-70cd-4b68-b102-3cfb6b74b2d5-image.png

            1 Reply Last reply Reply Quote 1
            • Sindariusundefined
              Sindarius
              last edited by

              I am overlapping my posts sorry ;O

              Stopping for the night but wanted to share where I am at for those who may be interested.

              5703a4ca-f7b9-48d6-b878-f7e6cb935a1c-image.png

              Blue indicates that the button or axis is being pressed.

              https://www.youtube.com/watch?v=bW6pccIuNTo&feature=youtu.be

              little demo.

              scrhallundefined 1 Reply Last reply Reply Quote 1
              • scrhallundefined
                scrhall @Sindarius
                last edited by

                @Sindarius WOW, nice job.
                Is the code shared anywhere?

                Sindariusundefined 1 Reply Last reply Reply Quote 0
                • Sindariusundefined
                  Sindarius @scrhall
                  last edited by

                  @scrhall https://github.com/Sindarius/DWC_GamepadJogger_Plugin

                  I got a few things I want to button up like custom actions and Iโ€™ll build a pluginnfor 3.2-beta3+

                  1 Reply Last reply Reply Quote 0
                  • scrhallundefined
                    scrhall
                    last edited by

                    I don't know the world of duet too much yet, would this work with duet 2 wifi?

                    1 Reply Last reply Reply Quote 0
                    • Donpiundefined
                      Donpi @scrhall
                      last edited by

                      @scrhall dont know if you allready seen this, but here is ๐Ÿ˜›
                      https://forum.duet3d.com/topic/19970/duet-3-controlled-by-ps3-remote-via-bluetooth

                      scrhallundefined 1 Reply Last reply Reply Quote 1
                      • Sindariusundefined
                        Sindarius
                        last edited by

                        @Donpi That's pretty slick I do like the idea of it running on the SBC so that you don't have to be on the webpage but this plugin will allow people who run standalone to the ability to use a gamepad as well.

                        I have a plugin put together that runs on DWC 3.2 Beta-3.
                        https://github.com/Sindarius/DWC_GamepadJogger_Plugin/releases/tag/0.1.0

                        scrhallundefined 1 Reply Last reply Reply Quote 0
                        • scrhallundefined
                          scrhall @Donpi
                          last edited by

                          @Donpi since I don't have duet 3, I can't use that, although it's the same result I'm looking for.

                          I am assembling a workbee, as soon as it is assembled I will test your code @Sindarius , thank you very much, you saved me many hours of development.

                          1 Reply Last reply Reply Quote 1
                          • scrhallundefined
                            scrhall @Sindarius
                            last edited by

                            @Sindarius the plugin only works in DWC 3.2? I use the workbee version (i think is based in 2.0.4)

                            Sindariusundefined 1 Reply Last reply Reply Quote 0
                            • Sindariusundefined
                              Sindarius @scrhall
                              last edited by Sindarius

                              @scrhall 3.2 beta is the first version of DWC that includes support for plugins so thatโ€™s the only way, without making a custom build, that supports 3rd party development.

                              I run an OpenBuilds Sphinx I plan to put a Duet on so I had plans to make this plugin. Maybe the Workbee group will be updating their DWC at some point when 3.2 releases to support 3rd party plugins.

                              baird1faundefined 1 Reply Last reply Reply Quote 1
                              • baird1faundefined
                                baird1fa @Sindarius
                                last edited by

                                Hey @sindarius, I'm using your gamepad jogger for my CNC router with a Logitech F710 wireless gamepad and I have noticed that the buttons often seem to be double pressed. Is there a sensitivity setting anywhere? With the keyboard it seems to have a better delay for holding keys. I'm just worried I'll crash my router making moves that are too big.

                                Thanks.

                                1 Reply Last reply Reply Quote 0
                                • Sindariusundefined
                                  Sindarius
                                  last edited by

                                  @baird1fa there is a set debounce timer because the gamepad commands ultimately get translated to gcode commands. When using a gamepad I recommend using smaller steps to control the moves. If I change the timer it will potentially lead to more stuttering.

                                  As a side note web browser are converting the gamepad api functionality to require webpages to be secure (HTTPS) so it's highly possible this plugin will stop functioning all together in the near future.

                                  1 Reply Last reply Reply Quote 0
                                  • Pigeonundefined
                                    Pigeon
                                    last edited by

                                    Hello, thank You for this great plugin. I have one question. Is it possible to create an action to call commandType.plugin functions? I would like to create button/action to reset feedrate and steps to default values.

                                    Sindariusundefined 2 Replies Last reply Reply Quote 0
                                    • Sindariusundefined
                                      Sindarius @Pigeon
                                      last edited by

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • Sindariusundefined
                                        Sindarius @Pigeon
                                        last edited by

                                        @Pigeon It's something that I could look into adding but at the moment there's nothing built in to reset those values.

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