Manual joystick control fro MPCNC

New Home Forum Mostly Printed CNC – MPCNC Hardware Development – MPCNC Manual joystick control fro MPCNC

This topic contains 11 replies, has 9 voices, and was last updated by  kd2018 3 months, 1 week ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #87430

    Armin Thinnes
    Participant

    Dear all,

     

    during the last few days, I have developed and worked on a solution to  easily home, move, and zero the MPCNC (with RAMPS and Marlin, sorry, not working on GRBL) without going through the crappy display menu. I thought, a joystick would be nice! And in my son’s arduino megaset, guess what I found! 😀

    Arduino Nanos are also on stock so let’s go!

    From the way how the ESP3D project is controlling 3D printers I knew it was possible to directly write on the serial port. So I tried this with the Nano and it worked! Just send G28 X Y to the AUX-1 port and the machine homes like as if I had used the menu button (except for it doesn’t say user coomand executed. Yes Ryan, there is a typo in the firmware! LOL! Search for coomand!)

    So I soldered the Nano together with the joystick module, some switches and some LED on a breadboard, designed a shabby but functional case for it and gave it a try. I like it!

     

    The full documentation including all sources (software, wiring diagram and OpenSCAD file) resides on Thingiverse.

    https://www.thingiverse.com/thing:3404797

    Her you can see the controller in action:

    Some pictures:

    IMG_20190204_203002
    IMG_20190204_203049
    IMG_20190204_203234
    IMG_20190204_214921
    schaltplan_Steckplatine

     

    If you have any comments, please let me know.

     

    Enjoy!

     

    Cheers

    Armin

     

    6 users thanked author for this post.
    #87462

    Jeffeb3
    Participant

    That’s great. Do you want any help with it? Is it working how you want?

    I saw a setting in Marlin for enabling more serial ports. That would be nice so the serial port could still the used for other senders like a pi or a laptop.

    Do you have trouble with filling up the buffer with commands? There is a command for pausing until the buffer is empty. You’d then have to look for the ‘ok’ message to see that it’s done with the pause before sending another command.

    #87491

    MegaDad3D
    Participant

    Great idea, well implemented. A little coding, a little printing, a little electonics, and a nice design. Adds up to a very useful addition. I particularly like the single button homing buttons.

    1 user thanked author for this post.
    #87517

    Armin Thinnes
    Participant

    @jeffeb3

     

    It works perfect as is. And also parallel to the Octoprint. For the board, it’s totally transparent. It can’t distinguish between commands received from the external controller and commands received via USB/serial as both are physically connected to the RS232 on D0/D1 of the Atmega2560.

    I always flush the buffer so it’s no issue up to now. I will check on the “ok” message thing but for the time beeing, I am just dumping messages on the bus without actually reading anything. Will try this! THX.

     

    Cheers

    Armin

     

    #87532

    Ryan
    Keymaster

    This is just begging for a custom PCB….

    #88603

    Armin Thinnes
    Participant

    I have updated the software  to v0.2 and uploaded it to thingiverse.

    Initial version worked but caused connection problems with octoprint (timeouts occured that made it cancel the connection, SD-card uploads didn’t work).

    Looks like I solved the issue with v0.2.

     

    Enjoy!

     

    Armin

     

    1 user thanked author for this post.
    #88723

    Brian
    Participant

    This is crazy, I just finished making a keypad for the exact same reasons you did. A joystick would be even better but I don’t have the know-how to wire in a joystick, lol. I liked your design on thingiverse and will be following along with progress!

    1 user thanked author for this post.
    #89575

    Kevin Lease
    Participant

    Hi Armin,

    I really like the concept you came up with.  I am working on making one.  I think it was a clever idea you had to send gcode through the rx/tx pins with stand alone arduino.  If I understood correctly from above, it is possible to simultaneously connect usb e.g. repetier host usb connection to ramps and have this device connected at the same time to the ramps board (I’m not sure what would happen if you sent commands simultaneously if it would be garbled or executed sequentially)?  I am going to use an extra mega I have instead around of nano and try to add a few other buttons to be able to have additional push button G code commands available to send, will make a different enclosure.  For example, I ordered the triac board Ryan has been using to have pwm AC control of router speed,  I am not planning to do pid just want to adjust the pwm digitally to set the router speed with button interface for up and down, with a 16X2 lcd display output.   I am also interested to add some code for automated X and Y edge finding which I think your device could be extended to do (e.g. take 0.1mm step toward target then read a pin state, repeat until pin state changes when circuit completed by contact between router bit and conductive foil on wood workpiece edge), as I read that the marlin gcode for probing with G38 didn’t work.  I learned a German word googling “vorschub” today after I looked over your code, so I learned something else from your project too!

    Thank you,

    Kevin

     

    #89579

    Jeffeb3
    Participant

    (I’m not sure what would happen if you sent commands simultaneously if it would be garbled or executed sequentially)?

    When you do this the onboard USB to UART chip is going to try to drive the voltage high or low, while the external arduino fights it. They probably have some minimal protection, so you don’t destroy them if you goof up tx and rx, but the data will be garbled, best case.

    #91540

    Tony
    Participant

    Totally coming back to this when I’m a little smarter.

    #91582

    Chris
    Participant

     

    Definitely doing this today.

     

    But im looking to do mine a little different.

    Ill change mine so it moves in 0.1mm increments only, with a potentiometer adjusting the feedrate.

    So i can just hold the joystick down and have it constantly sending a signal every 10ms or so.

    Ill adjust the time delay with the feedrate so a faster feedrate means to send the movement command faster. and a slower feedrate sends the command slower.

     

    thanks for the starting point. Ive been hoping for something like this for a while.

     

     

     

    #96165

    kd2018
    Participant

    I just had this exact same idea (tapping into rx/tx for custom programmable pendant remote)! I’m glad you’ve already paved the way. I guess I’ve found my next arduino project.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.