Replace y-axis motor drive by aux-drive in software?

I have a broken SMC chip (TMC2130) of the Y-axis motor. Certainly a full replacement of the farmduino board would be a solution. Replacing just the chip would be cheaper, but is quite a challenge without access to sophisticated soldering equipment.
So I was wondering whether the aux-channel hardware on the same board could be used. That would require to “redirect” the software commands addressing the y-axis chip to talk to the aux-axis chip (and of course connecting the y-axis motor to the aux output). The encoder wiring would be the wiring of the y-axis, so the “redirection” must be ‘low’ enough in the software hierarchy to only address the motor chip.

Would that be feasible, and where would I start looking?

Thanks
Franz

I digged a bit into the source code in the meantime and tried to answer my own question in this thread.
I didn’t yet have an opportunity to test it, though.

Did anyone else already try such an "AUX-for-Y“ TMC swapping?

I will report on my test later.

-Franz

1 Like

I tested it. Works like a charm.
Here’s what I did in order to use the TMC2130 of the spare AUX drive to drive the Y-axis motor:

  1. downloaded the farmduino firmware
  2. defined the correct board in src/Board.h:
  // Farmbot Genesis 1.6
  #define FARMDUINO_V32
  #define K16
  1. swapped the pin assignments in src/pins.h in section “#if defined(FARMDUINO_V32)”:
  //#define Y_STEP_PIN 32
  #define Y_STEP_PIN 40
  //#define Y_DIR_PIN 33
  #define Y_DIR_PIN 41
  //#define Y_ENABLE_PIN 31
  #define Y_ENABLE_PIN 37  
  //#define Y_CHIP_SELECT 28  // Y_CHIP_SELECT
  #define Y_CHIP_SELECT 43  // Y_CHIP_SELECT

and

  //#define AUX_STEP_PIN 40
  #define AUX_STEP_PIN 32
  //#define AUX_DIR_PIN 41
  #define AUX_DIR_PIN 33
  //#define AUX_ENABLE_PIN 37
  #define AUX_ENABLE_PIN 31
  // #define AUX_CHIP_SELECT 43 // CHIP_SELECT is not used for the spare AUX motor
  1. compiled the sketch in the Arduino IDE using ‘Sketch–>Export Compiled Binary’
  2. copied the file \src\build\arduino.avr.mega\src.ino.hex to the FAT32-Boot-Partition of the Raspberry SD card and renamed it to custom.hex
  3. connected the Y-motor cable to the AUX connector
  4. booted the system

Whether this works for versions other than FARMDUINO_V32 I can’t say

Regards
Franz

1 Like

Nice to know, thank you!