FluidNC icon indicating copy to clipboard operation
FluidNC copied to clipboard

Ganged motors with one direction pin

Open ein-erin opened this issue 5 years ago • 10 comments

How to set up two motors per axis if their drivers are using one direction pin?

  x:  
    motor0:
      stepstick:
        direction_pin: gpio.26
        step_pin: gpio.12
        
    motor1:
      stepstick:
        direction_pin: gpio.26
        step_pin: gpio.22

[MSG:ERR: Configuration error at /machine/axes/x/motor1/stepstick: ERR: Setting up pin [gpio.26] failed. Details: Pin is already used.]␊

ein-erin avatar Nov 08 '21 11:11 ein-erin

We did not consider that method in the design. Are you expecting the axis to auto square?

You could try changing the second one to NO_PIN and see what happens.

bdring avatar Nov 08 '21 15:11 bdring

Here's what happened:

[MSG:ERR: Validation error at /axes/x/motor1/stepstick: Direction pin must be configured.]␊
[MSG:INFO: Configuration is invalid]␊

ein-erin avatar Nov 08 '21 16:11 ein-erin

I wanted to configure it as in the previous version of Grbl_Esp32: https://github.com/bdring/Grbl_Esp32/wiki/Motor-Ganging-and-Axis-Squaring

ein-erin avatar Nov 08 '21 16:11 ein-erin

We don't support motors without a direction pin right now. It would probably be possible, but I think we would have to limit it to the second motor only.

You could submit a feature request. The primary devs have a lot of other priorities, so it might be months before someone worked on it.

bdring avatar Nov 08 '21 16:11 bdring

As a workaround, if you have a spare GPIO pin that is not already used for some other purpose, you could assign it as the second direction pin, but not connect it to anything.

MitchBradley avatar Nov 08 '21 18:11 MitchBradley

As a workaround, if you have a spare GPIO pin that is not already used for some other purpose, you could assign it as the second direction pin, but not connect it to anything.

It works. Thanks!

ein-erin avatar Nov 09 '21 12:11 ein-erin

I found another problem. In this version, as it turned out, the connection of double limit switches is also impossible. I mean this: This is an image

When specifying the same limit_all_pin for motor0 and motor1, an error pops up: "Pin is already used".

ein-erin avatar Nov 11 '21 04:11 ein-erin

If you have switches connected to only one GPIO, just list that GPIO under motor0 and do not list anything under motor1

MitchBradley avatar Nov 11 '21 06:11 MitchBradley

If you have switches connected to only one GPIO, just list that GPIO under motor0 and do not list anything under motor1

I tried this. Homing on the second motor does not work. I had to connect each limit switch separately...

ein-erin avatar Nov 11 '21 06:11 ein-erin

We do not support auto squaring with one switch. We chose to use the stress free method where the axis does not need to be pulled out of square during homing.

This requires Fluid to use independent switches.

bdring avatar Nov 11 '21 12:11 bdring