Hi, i am new in CNC.

Hi, i am new in CNC. I use grbl controller with GRBL 1.1f soft, and ChiliPeppr/jpadie operator interface. So, the problem is with axes Coords. for example as move the CNC machine 1mm. Actual position moved 1mm, but the interface has moved only 0.039mm. I tried to change the settings, from inches to millimeters.

One thing I notice in the video is you played the simulator and then played the Gcode at the same time. I’ve not seen somebody do that before and I think it will cause the 3D viewer to jump around weird.

On the other hand, it also feels like perhaps the Grbl setting of “Reporting in inches” or “Reporting in mm” is confusing you with respect to whether you’ve sent a G20 or G21 into your controller. Maybe a Grbl user can shed light on whether a G20 or G21 does not override the “Reporting in xxx” setting.

Few things to note.

  1. Video was very out of focus so I could not really see the detail of the gcode and serial data
  2. The red grbl warning was in the grbl widget. This is suggestive that either there was no connection to the board or the wrong flow control was present.
  3. I have not done any testing with 1.1f
  4. The report in inches setting is handled currently by the grbl widget sensing G20/G21 either reported from the $G query or in the gcode. So whilst you can override it manually it will rapidly get rewritten by the logic code.
  5. As I’ve posted several times, there is a logic flaw with units reporting in different scenarios and different widgets handle unit pubsubs differently. I had hoped to be able to harmonise everything so that the reporting and display oriented with G20/G21 in gcode but there are use cases that make this hard. And I have found that some times the setting adjustment is sent by the grbl widget but if ignored by the serial widget. So the code thinks it has changed but has not.

The task of fixing this really involves going through every widget and analysing how it deals with units. Then ensuring that each widget does things more or less the same way. I intend the next iteration to publish the axis data with the units in the pub. Then widgets that subscribe can make their own choice about conversion.

The two widgets that I’m not familiar with are the axis and viewer widgets. Both of those do things with unit data but not having fully read and parsed the code I can’t be sure that they are playing ball in all scenarios.

I’d also add that the settings modal looked odd on that screen. It should be a bit more consistent and neat that it looked. At least it is on my dev screens. I will have to check whether it has been changed somehow.

So until the units issue is fixed the best way to report in inches/mm is to send a G20 or G21 manually from the serial widget.

This should not be necessary if you have loaded a gcode file. The likely use case is if you’re jogging without a file being in the workspace.

I think the only publish you have to do is /com-chilipeppr-interface-cnccontroller/units

The description is in the pulldown menu for the Grbl and TinyG widget.

“This widget will normalize the GRBL units to the interface object of units {units: “mm”} or {units: “inch”}. This signal will be published on load or when this widget detects a change in units so other widgets like the XYZ widget can display the units for the coordinates it is displaying.”

The Axes widget listens for that so it can change the units it shows. The 3D viewer does not listen to that as it only shows the units from the Gcode that is loaded. The 3D viewer will just blindly move to the numeric value it is told, as far as I recall.

Yes, handling units was very hard to figure out what made the most sense, so I understand where you’re coming from. Ultimately what makes the most sense is for all units to be the same, which does partly fall on the user’s shoulders.

It looks like it is just the wrong way around: If I enter G20 into the console setting grbl to inches it will automatically add $13=0 which sets the reporting to mm. But if I send G21 it will add $13=1 which means movement is mm but reporting is inches.

Line 1027 and 1031:


That is possible. But should not be the case. Have a look at the code for the grbl widget in my workspace. If you find the error please post a pull request via github.

I added a pull request

Thank you. I pushed a fix a few days ago.

It is still not the fix that is necessary to cater for all the edge cases. But at least plugs the main error.