DerAndere1 / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform. The branch Marlin2ForPipetBot is optimized firmware for cartesian robots (lab robots, also known as liquid handling robots or pipetting robots)
https://derandere.gitlab.io/pipetbot-a8
GNU General Public License v3.0
53 stars 20 forks source link

axis names I, J, K conflict with G92 and G93 parameters and conventions for axis names #3

Closed DerAndere1 closed 4 years ago

DerAndere1 commented 5 years ago

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:

DerAndere1 commented 5 years ago

mecode by jminardi uses axis names I, J, K.

DerAndere1 commented 4 years ago

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

To get nicer output , One may have to change the characters at the additional places:

DerAndere1 commented 4 years ago

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
DerAndere1 commented 4 years ago

fixed in branch 6axis_dev. AXIS[4,5,6]_NAME can be configured.