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!
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.
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.
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
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
Another Rambo success! I finished adding this to my machine today, many thanks to Jamie, Greg (for Rambo specific details) and of course Ryan !
Process was relatively smooth minus me glossing the fact that you need a double throw switch to enable the… enable led to work 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.
How would I go about doing the same thing via the AUX2 port on the Ramps board, but with with 4 direction buttons instead. I need continuous jogging and the other solutions I’ve seen only jogs in increments.
You’d need a circuit that would make about 2.5V with not buttons pressed and then higher with one button pressed and lower with the other button pressed.
If you used 4 resistors of the same size (about 1k-10k) in series. You can wire buttons across the second and third resistors. The output is in the middle. With no buttons pressed, the voltage will be 2.5V. With B1 pressed, out will be 1.65V. With just B2 pressed, it will be 3.35V.
Repeat that for X and Y. You need completely separate buttons though. A D pad with a common pin for all 4 switches wouldn’t work this way.
I did think the starting point would be 2.5V as if the wiper was in the the middle of the potentiometer, but didn’t know how to go about getting the other two extents. But you cleared that right up.
Planning on using 4 tact switches so this would work perfectly.
Hi. I almost have this working, however I’ve not quite got the fine tuning down yet. I have a bunch of questions. I’m running a Rambo like @tailslide , with dual end-stops. At moment I am only working with x and y. My z seems to have a broken wire.
I am able to get the values from m119 but when I change the firmware values it doesn’t quite respond as expected. For instance, the dead band at ± 100 was very sensitive… I’ve tried increasing this a bunch but it doesn’t seems to be adjusting as much as I’d like so as to avoid those small off axis moves when positioning. How wide can this be?
Also should it stop and start or be completely smooth? If I push the stick full tilt too quickly it goes then halts. If I push slowly, it will mostly go ok. But still halts once in a while in travel. I’ve had to increase the over all range values (max and min) from what was recommended by @jamiek as well so that I could move the stick more freely, i.e. so it is not limited close to center. My range of values from M119 appear to be 0 (min travel) to 16378? (max travel). I expected to be able to go full on stick and have it run at its max speed but it seems to just stop. Normal?
Precision. Not really a joystick problem but it kind of stinks the lcd only reports X & Y at 1mm increments. If I drive to a location. Reset zeros (G92 X0 Y0). And machine something. If I later need to rehome for any reason (after disabling steppers for something) , there is zero chance I could return to exact same location. Best I could do is within .5mm. Better to use the menus.
Finally, I have found that it does not seem to respect the end stops (machine limits?). I can crash the gantry pretty easily using joystick. Should that be the case or is something amiss? I’m runnning dual end stop firmware. It seems this version of Marlin (downloaded in the last few days from V1 for this feature) does not handle endstops the same as my older version (downloaded last summer). In past version, when I home with G28 X Y, the coordinates X Y coordinates would set to zero. Does not seem to do that anymore. Could be why I can crash. Is this the new normal?
Sorry for long post. Any input is appreciated. Thanks.
Seeing pretty much exactly the same thing. I am a developer by trade and tried applying some smoothing algorithms to deal with the start-stop issue which didn’t help… I think the problem might be something other than bad analog readings. Also saw the same thing with the endstops not being respected. Fortunately it seems to be a minor annoyance that doesn’t prevent me from finding it very useful. All in all I’ve still found it the most time saving upgrade I’ve done.
Also regarding finding the same spot I have mine hooked up to raspberry pi cnc.js so it’s easier to read off or set the coordinates although in practice I never seem to need to but might try it some day on a very long job.
The design of the ranges is such that it won’t move within the dead band, and also outside the max range it will also stop. This was supposed to be a safety feature so if the thing came unplugged (and you were lucky with the floating voltages) it would stop instead of taking off at max speed. With an enable switch this is much less important and probably better to just use max speed beyond the limits too.
But given how it’s written now, the way I set the dead band is to push the joystick to the left and gently release, and note the value from M119. Then push right and gently release, and again note the M119 value. There is likely to be some backlash in the joystick mechanism so these “center” values won’t be the same. Do it several times if you want to get good confidence in the values. Then take these values and widen it a little and it should be within the dead band when its anywhere in the backlash area.
Then for the min and max, do the same thing but pushing the joystick to the maximum position, and then widen a little. But if you are already seeing 0 or 16383 then you can’t widen from that.
Also the M119 works even when enable is off, so you don’t have to worry about crashing while trying to get these readings.
As for crashing, the dual endstop firmware should have the soft stops set for xmin and ymin. If you haven’t homed then it wont let you move to -X or -Y from the point where it was powered on, or if you have homed then it wont let you move past zero. But if you disabled steppers and dragged the gantry in the +X or +Y and then started jogging, then it can crash because endstops are not monitored except when homing. And in any case it can crash at the +X or +Y ends.
Mine seems to stop-start-stop-start even within the max band … was never able to track down exactly why I even changed the code to get rid of the max band behavior and still saw it (to a lesser extent). I don’t do any marlin development so would take a long time to figure out. Maybe it’s got some movement queue that runs empty? Or maybe I just need a new cable… although I still saw the same thing doing exponential smoothing over hundreds of samples.
I have seen “stuttering” motion when moving in (for example) +X when I switch direction slightly to +X with a little bit of diagonal +Y. In my mind I am blaming it on the cornering behavior but really I don’t know. (And it might not be the same thing you’re seeing either…)