Joystick managed by Marlin

Actually my fork already has this PR and I am seeing the opposite problem.
(Joystick is moving faster than both the rate on the LCD and the maximum feedrate).

My problem might be I forgot to clear the EEPROM… I’ll try that tonight

Edit:
So managed to mostly solve my issue… the problem wasn’t feedrates at all… I think if you have the limits of the stick config set so that the pot drifts or spikes over those limits then the carriage stops moving… to the point where I had the stick full forward and the carriage moved then stopped for awhile and I had time to run M119 with debug on and verify that the readings still showed the stick full forward. All X Y and Z behaved this way.

I changed my config so the upper limits were 1000 lower and it seemed to almost completely solve the issue with still a little stuttering here and then (if the pots spike over the limits?)

I would also like to know if anyone has got this working with SKR 1.3, and what pins would be able to be used. I am using Dan’s(blomsd) settings for skr 1.3 and uart and I would like to add this joystick. He used a bugfix version from October so it is included, I just need to know what pins to use.

Hello im new in marlin can you zip the marlin file and put it to dawnload and uploadi in arduino for all taht joysick

Hi, I’m looking to integrate one of these joysticks into a pendant that also includes the RepRap display and hopefully a couple discrete buttons. Sort of an all in one deal. The joystick I got off ebay, has a switch in the top. I was wondering if the firmware changes have defined use of this too? Would be nice to use it to trigger Z homing or something.

Along the same lines, are there any other means (e.g. button presses) that are predefined in the firmware for triggering actions or g-code. As a means of replacing some of the custom commands in the menus. I know some have been able to use an arduino to feed gcode into the serial extension. Hoping for more direct support. I am running on a Rambo 1.4 with dual end stop firmware.

This analog joystick is its own module, both physically and in the firmware, so it is going to be independent from the other operations through the LCD or if there were some keypad. Nothing prevents the wires from running in the same bundle and being physically in a single pendant, but it will still be independent. This joystick does not have an Arduino to mediate the commands, so there is nowhere to put the extra ‘interpreter’ so to speak to translate a button press into some command.

I can see how a keypad for custom commands would be handy. The scrolling and clicking on the LCD is a little clumsy. I think a keypad would make a great addition but like I said it would be a separate thing. I think Armin’s approach would be a great starting point for a keypad, and it should work nicely in conjunction with this joystick.

Okay friends, don’t shoot me…but…WHAT!!!

I build my MPCNC middle of last year and LOVE IT!!! Thank you Ryan so much for what you created. I am running a Rambo with dual endstops, and every time I fire that machine up I am as excited as a kid in a candy store. I have effectively ZERO knowledge on firmware and electronics. As such nearly every single word of this post is a foreign language to me. I have been wanting to add a controller, PS4 or xbox or joystick, to my machine since day 1. In the last few weeks I have been reading every forum and watching every youtube video I can to learn how to do it…but alas………I’m lost.

I have read this post, all 70+ entries, countless times but I am just so lost. Its clear that those of you on this post know your stuff…and its amazing. Unfortunately I just cant follow it. I am 100% confident that Ryan put in countless hours to take what is an incredibly complex evolution and make the instructions so simple that anyone can build the MPCNC and run it…and man oh man was he successful! Its freaking awesome.

But here is my issue. I know there are a lot of people who use the MPCNC, based off of my time on the FB group, that want to connect an external joystick but we just cant figure it out. Like most novices, we run the basic setup with Marlin. I love it. Its just like my 3D printer. And like me, most of us don’t want to change out the hardware or stray from Marlin. Best I can tell this thread tells us how to setup Marlin and a Rambo to add a joystick. The real issue…………I just cant follow:

So here is the really…REALLY long story, sorry, dumbed down for us non computer code/non electronic savvy people.

“Can someone put into laymen’s terms how to actually do this”? Step by step instructions with pictures and/or video’s would be great.

Maybe sometime in the near future Ryan could make it a standard part of the build.

Thanks, and sorry for the novice questions.

5 Likes

Yes. I hear you. I can get the whole discussion about getting the code merged into Marlin. And that some firmware tweaking may be necessary so you would have to be comfortable with downloading the firmware, making the changes and uploading to your board. I understand that not all boards can support this easily. I understand that there is a specific joystick that Jamie recommends. I understand that some wires have to go somewhere else. And there is a diagram that is supposed to indicate how that happens. I am not familiar in circuit design symbols. It’s the fault of my education. Should be standard.

Putting it all together is where I get bogged down. Just some pictures of the setup. I know it should be pretty simple.

I have been rather lazy of late, and doing a ton of different things, and I keep wanting to get back and try this.

@jamiek I just wanted ask, is this ready for general use? or is it still in design mode?

from the comments there doesnt seem to be a guide to follow, which would be nice. but I am curious how much of it is hacking and hoping vs just do it, and cleanup?

And special thanks to Ryan as well, I am glad you did this, I have been playing in CnC for years, but some of it has been cost prohibitive to play with. my last CNC I build and played with had me about 5k into it. and I could justify tying that kind of coin up.

500$ is barely noticeable.

@jamiek I am glad there are so many smarter people than I.

1 Like

I’m really happy about all the enthusiasm. It’s ‘complete’ as far as the design and the firmware goes but the documentation is lacking and I only have experience with the RAMPS-like boards, not Rambo.

Let me see if I can pull together a more self-contained document that’s a bit easier to read than this thread.

At a minimum you will need to know how to enable a couple lines in the configuration and re-flash your board. The switch and joystick can be wired directly to the board if you skip the LED indicator light, so it shouldn’t need much skill beyond making good electrical connections. I’ll see if I can get a guide together this weekend.

6 Likes

Here’s a photo of the rambo (not rambo mini) connections I used.
On the left, Brown=ground, red = +5V
Working right, Blue purple grey are XYZ, and green is enable.

If you google how to wire up potentiometers you will see how the joysticks are supposed to be hooked up… power and ground on the outside pins, and signal on the middle.

featured_preview_IMG-3187

2 Likes

Are the configuration values for the joystick in EEPROM? It might make it possible to add in the default firmware (but pins are precious). But for that to be worthwhile, you wouldn’t want to have to reflash it to change the min/max/deadzone. You’d also need to choose a Gcode/Mcode…

1 Like

@jamiek

So I am willing to be your documentation guinea pig.

I have a Ramps 1.4 and I am using a Pi4 for Octoprint.

I believe I have all the parts needed to build the controller.

On top the above, I also purchased this item

https://www.amazon.ca/Freenove-Processing-Oscilloscope-Voltmeter-Components/dp/B06X3V84PV/ref=sr_1_1” in preperation of doing the mod.

and I also have this one :

WHICH was also a potential use.

Trying to bridge the knowledge gap here.

I’m trying to figuring this out, but it’s quite the treasure hunt. I have an Archim board. In the conversation above, folks are referring to pins that have specific names on certain boards.

So this comment assumes that everyone knows what board we are talking about, but nowhere in the first post does it name the board. I assume it is the RAMPS?.

So then how to we trace things out to get to the other boards?

I know the microcontroller has in/out pins. They have numbers. I know that these pins get mapped to pins on the control board and can be used for various purposes. Some are clearly set up for the motors, the fans, the extruders, thermistors, etc.

Some pins are still free for various jobs. Some pins can be remapped for other purposes. I’m going to keeping poking away at these boards and get a better understanding of all the pins and connectors.

And awaiting Jamie’s clearer documentation. Thanks in advance!

Jamie uses RAMPS.

You can choose the pins you want. They need to be capable of analog in (for the 3 axis inputs). Many of the rambo pins have assignments already, like the xmin endstop. But there are spare ones on the aux connectors.

1 Like

I have an Archim2. This is the perfect project to help me understand these boards better and how to control them to control other things.

So I could define the pins in the J20 header with the undefined GPIO pins referred to here in /Marlin/src/pins/pins_ARCHIM2.h? Just guessing. I am currently using one of the fan pins for a cooling fan on the control board. It seems I can use the other fan for the PMW part of the joystick.

Otherwise I am trying to figure out where the firmware is configured for this.

// Unused Digital GPIO J20 Pins
#define GPIO_PB1_J20_5 94 // D94 PB1 (Header J20 5)
#define GPIO_PB0_J20_6 95 // D95 PB0 (Header J20 6)
#define GPIO_PB3_J20_7 103 // D103 PB3 (Header J20 7)
#define GPIO_PB2_J20_8 93 // D93 PB2 (Header J20 8)
#define GPIO_PB6_J20_9 99 // D99 PB6 (Header J20 9)
#define GPIO_PB5_J20_10 101 // D101 PB5 (Header J20 10)
#define GPIO_PB8_J20_11 100 // D100 PB8 (Header J20 11)
#define GPIO_PB4_J20_12 102 // D102 PB4 (Header J20 12)
#define GPIO_PB9_J20_13 108 // D108 PB9 (Header J20 13)
#define GPIO_PB7_J20_14 98 // D98 PB7 (Header J20 14)
#define GPIO_PB15_J20_15 66 // D66 PB15 (Header J20 15)
#define GPIO_PB16_J20_16 67 // D67 PB16 (Header J20 16)
#define GPIO_PB14_J20_17 53 // D53 PB14 (Header J20 17)
#define GPIO_PA18_J20_21 71 // D71 PA17 (Header J20 21)
#define GPIO_PA17_J20_22 70 // D70 PA17 (Header J20 22)

Hello, great article and great work. Thanks. I only have a problem with the Z axis. After using the M119 command, the values ​​jumps. Actually on each axis they jumps but the most on the Z axis is also another potentiometer

2 4.7kR potentiometers X and Y axis
1 potentiometer 1.5-3.6k in the Z axis

Because of this I cannot adjust the value

#define JOY_Z_LIMITS {90, 150-30, 150 + 30, 290}

Do you know what to do?

1 Like

This is my take on a handheld controller for my MPCNC.


I have used the lastest firmware, but wanted to be able to software invert the polarity of the axis, so I have included the code from jamies pull request.
Files for the housing can be found here: https://www.thingiverse.com/thing:4144229

9 Likes

Od Makarewicza do Orzechowskiego mówię wam: cześć i witam!

1 Like

Another Rambo success! I finished adding this to my machine today, many thanks to Jamie, Greg (for Rambo specific details) and of course Ryan :slight_smile:!

Process was relatively smooth minus me glossing the fact that you need a double throw switch to enable the… enable led to work :wink: I did run into some weirdness in that my analog pin3 didn’t seem to work right. My Y axis reading came out ranged 14-25-40 while the other axes were pretty close to Jamie’s published offsets. I switched Y to analog 6 after confirming wiring and resistance of the pot and it worked. Printed quick enclosure and off to the races!

I found a 2x5 header block in my parts bin along with a cat5 surface mount jack. Made an adapter cable that dangles out of the bottom of Ryan’s enclosure and ran a cable from the joystick to the plug. Painter’s tape holding it to the main stepper bundle will be replaced with a ziptie at some point.

4 Likes