Closed DerAndere1 closed 4 years ago
mecode by jminardi uses axis names I, J, K.
I think it is enough to keep the internal axis names XYZIJK and change the axis names in the interface and G-code parser, e.g. change I to A, J to B and K to C conditionally, dependent on the kinematics defined in Configuration.h.
Conditionally naming could be done with the following code pattern (pseudo code)
#if defined(XYZAB)
if parser.seen('A') do something with I_AXIS
parser.seen('B') do something with J_AXIS
#elif defined(XYZAC)
if parser.seen('A'):
do something with I_AXIS
if parser.seen('C'):
do something with J_AXIS
#elif defined(XYZABC)
if parser.seen('A'):
do something with I_AXIS
if parser.seen('B'):
do something with J_AXIS
if parser.seen('C'):
do something with K_AXIS
#elif defined(XYZUVW)
if parser.seen('U'):
do something different with I_AXIS
if parser.seen('V'):
do something different with J_AXIS
if parser.seen('W'):
do something different with K_AXIS
#endif
at the following places
-Lines following https://github.com/DerAndere1/Marlin/blob/f56521d1d5c6ba3b7f466d5e1881c7935ff3fa8f/Marlin/src/gcode/parser.cpp#L204
Lines following https://github.com/DerAndere1/Marlin/blob/f56521d1d5c6ba3b7f466d5e1881c7935ff3fa8f/Marlin/src/gcode/motion/G0_G1.cpp#L60
Lines following https://github.com/DerAndere1/Marlin/blob/f56521d1d5c6ba3b7f466d5e1881c7935ff3fa8f/Marlin/src/gcode/calibrate/G28.cpp#L275
To get nicer output , One may have to change the characters at the additional places:
My proposal is implemented in branch https://github.com/DerAndere1/Marlin/tree/bf2_6Xdev_axis_rename , ready for testing. in the configuration.h you need
#if NON_E_AXES > 3
/**
* Axis codes for additional axes:
* "A" for rotational axis parallel to X
* "B" for rotational axis parallel to Y
* "C" for rotational axis parallel to Z
* "U" for secondary linear axis parallel to X
* "V" for secondary linear axis parallel to Y
* "W" for secondary linear axis parallel to Z
* "I" for generic 4th axis
* "J" for generic 5th axis
* "K" for generic 6th axis
*/
#define AXIS4_NAME "I"
#if NON_E_AXES > 4
#define AXIS5_NAME "J"
#if NON_E_AXES > 5
#define AXIS6_NAME "K"
#endif
#endif
#endif
fixed in branch 6axis_dev. AXIS[4,5,6]_NAME can be configured.
Description
The names of axes I, J, K conflict with parameters I, J of commands G92 and G93. These additional axes should be renamed. Ideally, there should be a seperate axis indices for raw positions and positions with kinematics applied. A possible nomenclature would be: AXIS_4, AXIS_5, AXIS_6 as indices for raw positions and depending on the kinematic model, the following indices for post-kinematic positions: