Unit position equivalence with GCode programas
Posted: Mon Sep 30, 2019 10:35 am
Hello again,
I am trying to run simple GCodes in my aplication using the metod KM.CoordMotion.Interpreter.Interpret("...")
This is the code I am trying to run, a simple square:
The problem is that when I run that GCode, the feedback positions are multiplied by 0.03937 (equivalence between cm and inch is 0.3937, I don't know why is divided by 10), I discovered this using the metod KM.CoordMotion.Interpreter.UserUnitsToInches(1).
I tried add some changes to my program to solve this, just after Initialize the interpreter:
KM.CoordMotion.Interpreter.SetupFile = "...DefaultKeepOffsetsMM.set";
KM.CoordMotion.Interpreter.SetupParams.LengthUnits = CANON_UNITS.CANON_UNITS_MM;
but does not work.
When I run this program in KMCNC the feedback positions are correct (I select mm instead of inches). It seems that the movement is correct, but the positions units are wrong.
Any idea how can I solve this?
I am trying to run simple GCodes in my aplication using the metod KM.CoordMotion.Interpreter.Interpret("...")
This is the code I am trying to run, a simple square:
In my aplication I put 3 position indicators with a timer to see the axies positions, like is done in SimpleFormsCS example.G0 X0 Y0 Z0
F50
G90
G21
G40
G1 X5 Y0
G1 X5 Y5
G1 X0 Y5
G1 X0 Y0
M2
The problem is that when I run that GCode, the feedback positions are multiplied by 0.03937 (equivalence between cm and inch is 0.3937, I don't know why is divided by 10), I discovered this using the metod KM.CoordMotion.Interpreter.UserUnitsToInches(1).
I tried add some changes to my program to solve this, just after Initialize the interpreter:
KM.CoordMotion.Interpreter.SetupFile = "...DefaultKeepOffsetsMM.set";
KM.CoordMotion.Interpreter.SetupParams.LengthUnits = CANON_UNITS.CANON_UNITS_MM;
but does not work.
When I run this program in KMCNC the feedback positions are correct (I select mm instead of inches). It seems that the movement is correct, but the positions units are wrong.
Any idea how can I solve this?