CNCjs handwheel pendant (detailed howto for nerds)

So I double-checked your wiring photos compared to mine (which I re-post here for future use)

and it all matches.

Did you do the changes in /boot/config.txt to configure the GPIOs to use internal pull-up ?
Let me know if you want me to do a version of code with traces in the right places to investigate this (unless you have done that already?)

I did add that line to the boot/config file as well :X -

If you are able to make a branch for debugging, that would be super helpful (for others too I’m sure).

Can you please try this version (a few log traces added in key places),
cncjs-pendant-raspi-jogdial.zip (5.3 KB)

and try:

  1. push and hold enablebutton (keep it held throughout the test)
  2. turn dial (either way)
  3. change XYZ4 and X1/X10/X100 selectors to various positions, and turn dial again

and let’s see what is displayed then

Doesn’t appear to be making it to your console.log("DIAL TURNED") line. When I engage the side button, the enable/disable logs, as well as each change to X1/X10/X100, but nothing when turning the dial while the button is pressed.

Mmh. So for some reason the “A” signal is not read correctly, so we should first check whether the signal arrives from the pendant at all.
I don’t suppose you have a scope on hand to check that ?
When the dial is turned, a 5V pulsed signal should appear on the “A” wire. You could try and use a voltmeter between the Green wire (A) and GND, turn the dial continuously, see if the voltage is 0V when idle and jumps to non-zero values when the dial is turned. We’ll go from there.

EDIT: and assuming you do see some voltage coming to the green wire, next step would be to check whether the scaled down voltage is there in the middle point of the resistor divider, that’s the one that actually enters the GPIO.

I checked with a volt meter between green wire and ground and got around 3.6 as I continuously turned the wheel. https://drive.google.com/file/d/13pprFYLNdfCgddLVHr1fG6NGyfVbDVV9/view?usp=sharing

I then checked ground and TXD (I think thats what you meant by the middle point) and didn’t get anything when turning the wheel. Might have misunderstood what I needed to check there.

1 Like

Allright so the dial works.
Did you do that measurement with the green wire still connected to the top of the voltage divider? If so the pb would seem to be somewhere in the wiring/soldering of the top or bottom resistor. It’s getting late, I’m heading to bed, will check this thread tomorrow.

Just elaborating on my previous post, can you try and measure voltage like so:

  1. get GND anywhere convenient
  2. with everything plugged as in this photo, double check that you still get 3.7V at the top of the voltage divider (circled in red) when turning the dial
  3. just unplug TXD at the screw terminal and
  • do a continuity check with the voltmeter between the point circled in purple, and the extremity of the orange dupont wire
  • then turn the dial and measure voltage at that extremity.

But WAIT, after writing this, I took a second look at your picture, and I wonder about the color on that top resistor:

We don’t all see the colors the same way, but these two color bands look suspiciously close to being orange to me. If this is in fact orange, then the top resistor is 13.000ohms and you would get 2200/(13000+2200) * 3.7V at the middle point, so 0.5V, which is below the GPIO activation threshold, and mystery solved?

1 Like

OT: That resistor (“13000”) doesn’t look like it is soldered at the top connection point.

1 Like

Might be the lighting, I bought these a few ago specifically for this project.
As a test, I moved everything on the breakout board one row to the right to make sure there was no issues with the soldering. Made sure everything had solder on it on the top side as well ( there was full contact on the bottom side).

When I check voltage from ground and green, I get the 3.7 when turning the dial. However, when I moved down and check the top of the resistor (your red circle) and ground, I get nothing when I spin the dial.

1 Like

Can you clarify how the green wire that came with the pendant (and where you see the signal correction) is connected to that green wire that is soldered near the top of the resistor ?

I mean those two things:

Did you check continuity between those two ? (broken wire ? it can happen)

I attached one of my breakout wires with pins to the end of the original green so I could make sure it had a good connection. In my latest test, I removed the extension wires from Green and White and just went straight to the board. Thats where I am now testing the green (right on top of the solder point) and ground.

Did I follow correctly that probing in the green area below you get 3.7V, but probing in the red area you don’t have signal ?

Solder issue on the other side of the board then ? Sorry if I got this wrong.

You are correct as to what I was testing and my result, or lack of result I suppose. The other side appears fine which is why this makes no sense :slight_smile:

I am going to pick up some solder braid this evening to clean it all up and start over. It’s gotta be an issue with the wiring somewhere that I am not seeing. I want to make sure there is no solder I am missing that is jumping any of the pins together.

1 Like

I may be having a oops moment here. I was under the assumption that this PCB had traces that connected each of the rows together (vertically) this whole time. After further looking, I tested various points and none of them are in fact connected. This leads me to believe you are connecting or jumping together on the bottom side? What does your bottom side of the board look like? I was just soildering each point to it’s own hole, thinking that it was connecting the all together down the row to bring the voltage down through the resistors and back into the gpio.

Correct, the plated holes are not connected so you need to make solder blobs between adjacent holes:

Mystery solved then. Let us know if it works!

I added solder to the bottom to jump the points as you have here. It looks like it is logging the “DIAL TURNED” events you put in place. I’m not sure if this is just because I am using an arduino to simulate this, but I don’t actually see anything moving in my test setup in CNCjs. I will try and move it to the CNC tomorrow to see if it does anything, but the console makes me think there may still be something else going on (outside of my original issue).

    pi@torchedflags:~/cncjs-pendant-raspi-jogdial$ node bin/cncjs-pendant-raspi-jogdial 
? Specify which port you want to use? /dev/ttyACM0
Connected to ws://localhost:8000?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IiIsIm5hbWUiOiJjbmNqcy1wZW5kYW50IiwiaWF0IjoxNTkwNDY1MzAwLCJleHAiOjE1OTMwNTczMDB9.XC2iEfD8EOmGa9nfYoNJQTfjuASTb27K7mOLOpR78Ys
Connected to port "/dev/ttyACM0" (Baud rate: 115200)
{ port: '/dev/ttyACM0',
  baudrate: 115200,
  controllerType: 'Grbl',
  inuse: true }
[GRBL in]Grbl 0.9j ['$' for help]
[GRBL out]$$
[GRBL in]$0=10 (step pulse, usec)
[GRBL in]$1=25 (step idle delay, msec)
[GRBL in]$2=0 (step port invert mask:00000000)
[GRBL in]$3=0 (dir port invert mask:00000000)
[GRBL in]$4=0 (step enable invert, bool)
[GRBL in]$5=0 (limit pins invert, bool)
[GRBL in]$6=0 (probe pin invert, bool)
[GRBL in]$10=3 (status report mask:00000011)
[GRBL in]$11=0.010 (junction deviation, mm)
[GRBL in]$12=0.002 (arc tolerance, mm)
[GRBL in]$13=0 (report inches, bool)
[GRBL in]$20=0 (soft limits, bool)
[GRBL in]$21=0 (hard limits, bool)
[GRBL in]$22=0 (homing cycle, bool)
[GRBL in]$23=0 (homing dir invert mask:00000000)
[GRBL in]$24=25.000 (homing feed, mm/min)
[GRBL in]$25=500.000 (homing seek, mm/min)
[GRBL in]$26=250 (homing debounce, msec)
[GRBL in]$27=1.000 (homing pull-off, mm)
[GRBL in]$100=250.000 (x, step/mm)
[GRBL in]$101=250.000 (y, step/mm)
[GRBL in]$102=250.000 (z, step/mm)
[GRBL in]$110=500.000 (x max rate, mm/min)
[GRBL in]$111=500.000 (y max rate, mm/min)
[GRBL in]$112=500.000 (z max rate, mm/min)
[GRBL in]$120=10.000 (x accel, mm/sec^2)
[GRBL in]$121=10.000 (y accel, mm/sec^2)
[GRBL in]$122=10.000 (z accel, mm/sec^2)
[GRBL in]$130=200.000 (x max travel, mm)
[GRBL in]$131=200.000 (y max travel, mm)
[GRBL in]$132=200.000 (z max travel, mm)
[GRBL in]ok
ENABLED
DISABLED
ENABLED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponDialPulseTimeout / unsupported signal
DISABLED
ENABLED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: createServer smooth jogging / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponJoggingTimer / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponJoggingTimer / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponJoggingTimer / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponJoggingTimer / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X1 SELECTED
ERROR: uponJoggingTimer / unsupported signal
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DISABLED
ERROR: uponJoggingTimer / unsupported signal
SMOOTH JOGGING STOPPED
[GRBL out]…;
[GRBL in]error: Expected command letter
ENABLED
DISABLED
ENABLED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
START JOGGING Y mm in the positive direction at speed 100 mm/min
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
DIAL TURNED
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
DIAL TURNED
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X1 SELECTED
[GRBL out]$J=G91 G21 Y30 F100
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DISABLED
SMOOTH JOGGING STOPPED
[GRBL out]…;
[GRBL in]error: Expected command letter
ENABLED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
START JOGGING Y mm in the positive direction at speed 1000 mm/min
DIAL TURNED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
Y AXIS SELECTED
X10 SELECTED
[GRBL out]$J=G91 G21 Y30 F1000
DIAL TURNED
[GRBL in]error: Bad number format
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
START JOGGING X mm in the negative direction at speed 5000 mm/min
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
DIAL TURNED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
SMOOTH JOGGING STOPPED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DIAL TURNED
X AXIS SELECTED
X100 SELECTED
DISABLED

I am seeing responses in the CNCJS console such as:
client> $J=G91 G21 X-30 F5000
error: Bad number format
client> …;
error: Expected command letter

Again, this may just be due to it no actually being set up to my shapeoko and going through the Arduino, but if there’s anything that stands out to you before I make it to my machine test, let me know :slight_smile:

I appreciate all this help, so close!

1 Like

Not sure what’s going on with that “Bad Number format” error, my guess would be that there is some extra control character being sent after the feedrate value, it could be the “\n” sent at the end of each G-code string in the code, and somehow the GRBL on your Arduino does not like that. Let’s see how it works on the actual machine (I would be a little surprised if it behaved differently, but who knows)

Plugged it into the shapeoko today and everything ran just fine. Must be a difference between grbl on my Arduino vs the CNC. Thanks for your help through all of this :slight_smile:

2 Likes

So, I worked off Julien’s code to add an additional feed hold switch on top of the one that is built into the pendant.

Here are pictures and this is the link to the thread I have explaining the steps involved:
Adding Feed Hold Switch with 12V Light - Voltage Step-up

2 Likes