fra589/grbl-Mega-5X

Cloned Y Axis moving under normal G0 command, but not while homing

Jones1403 opened this issue · 6 comments

Hello,

I'm having trouble with homing on a cloned y-axis. I've read #4 #48 #51 and #62.
The machine will move both Y-motors on a normal G-code command, but only the default Y-motor will move when homing is issued.
The second Y-motor is enabled, but not moving.

I'm using an arduino mega2560 + ramps 1.4 to control a custom build machine with: 1 X motor, dual y motors, 1 z motor and 1 additional linear axis with a single motor. Thus 4 axis 5 motors

I have the following in the config.h:

#define N_AXIS 5        // Number of axes (3 to 6)
#define N_AXIS_LINEAR 4 // Number of linears axis, must be <= N_AXIS

// Axis indexing and names
#define AXIS_1 0        // Axis indexing value. Must start with 0 and be continuous.
#define AXIS_1_NAME 'X' // Axis names must be in X, Y, Z, A, B, C, U, V, W, D, E & H.
#define AXIS_2 1
#define AXIS_2_NAME 'Y'
#define AXIS_3 2
#define AXIS_3_NAME 'Z'
#if N_AXIS <3
  #error "N_AXIS must be >= 3. N_AXIS < 3 is not implemented."
#endif
#if N_AXIS > 3
  #define AXIS_4 3
  #define AXIS_4_NAME 'A' // Letter of axis number 4
#endif
#if N_AXIS > 4
  #define AXIS_5 4
  #define AXIS_5_NAME 'Y' // Letter of axis number 5
#endif

To put the additional Y motor on E1 of the ramps board.

I configured the grbl parameters: $101 and $104, $111 and $114, $121 and $124, $131 and $134 to have the same values and configuring $3 and $23 with 31 to invert all axes and homing directions.

I'm I overlooking something?
Thanks

Hi @Jones1403,

Linear axes must be defined before rotational. So, you must invert the second Y axis with your A axis.

(...)
#define AXIS_4_NAME 'Y' // Letter of axis number 4
(...)
#define AXIS_5_NAME 'A' // Letter of axis number 5
(...)

Then, don't forget to update the homing definition to make your 2 Y axis homing in the same time:

(...)
#elif N_AXIS == 5 // 5 axis : homing
  #define HOMING_CYCLE_0 (1<<AXIS_3) // Home Z axis first to clear workspace.
  #define HOMING_CYCLE_1 (1<<AXIS_1) // Home X axis
  #define HOMING_CYCLE_2 ((1<<AXIS_2)|(1<<AXIS_4)) // Home Y axis 
  #define HOMING_CYCLE_3 (1<<AXIS_5) // Home A axis
(...)

@++;
Gauthier.

I tried these settings.
The 4th axis aka 2nd y-axis moves while homing, but does not stop when the limit switch is triggered.
I have only 1 limit switch. on Y-min.

When that is triggered, the default Y-Axis stops, but the Y2 axis doesn't

What could be wrong?
Thanks

The second axis waits for the second limit switch....
So I would change the Limit Switch PORT and PIN to the same as the first y axis.
See cpu_map.h:139 - MIN_LIMIT_PORT and MIN_LIMIT_BIT
(Although I'm pretty shure that this will work, there could be a better solution for this? ;) )

Cheers
Raphael

For this setting, you need to have 2 limits switchs.
Perhaps there is another solution, but I don't try it and I don't know if it work... But it should:
Try to use the same settings for axis 2 and 4 limit switch pin.
in cpu_map.h

#define MIN_LIMIT_PORT_1 J
(...)
#define MIN_LIMIT_PORT_3 J
(...)
#define MIN_LIMIT_BIT_1 1 // Y Limit Min - Pin D14
(...)
#define MIN_LIMIT_BIT_3 1 // Y Limit Min - Pin D14
(...)

But I realy think it will be better and more secure to have 2 limits switchs.

@++;
Gauthier.
P.S. Thanks @RaphaelDives for the same id 😃

I can hereby confirm that the proposed method is valid. 👍

Thanks for helping @fra589 and @RaphaelDives
sorry it took so long to test.