OpenAstroTracker-Firmware icon indicating copy to clipboard operation
OpenAstroTracker-Firmware copied to clipboard

Change default pin for RA_HOMING_SENSOR_PIN to pin 3 on mksgenlv21

Open JakobPetersson opened this issue 3 years ago • 4 comments

I am proposing to change the default pin for hall sensor from 53 to 3.

The board is designed to use pin 3 for homing the X-axis motor (RA-axis on OAT). And when using a hall sensor the 3-pin JST connector work perfectly in this port without splitting the cable to connect signal, voltage and ground in different places. It is a clean install.

Premise: This change is based on the premise that the most common use-case would be to only use one method of homing per axis (at a time).

My assumption is that you would reasonably only use either a hall sensor for very exact homing, an endstop, or the TMC sensorless homing (If it is implemented).

On mksgenlv21 a jumper controls if the diag-pin is connected to pin 3 or not. Jumper missing, free to use for hall sensor. Jumper in place, connected to X-diag in use for potential sensorless homing with TMC stepper.

Other: This wiki page would need to be updated along with this change: https://wiki.openastrotech.com/OpenAstroTracker/Addons/RAHallSensor

JakobPetersson avatar Mar 25 '22 16:03 JakobPetersson

Looks like your PR has code that needs to be changed in order to meet our coding standards! Here are your options:

  1. Apply the patch that was generated by the job
    1. Click details under the failing clang-format check
    2. Click the Artifacts dropdown in the top right
    3. Download + unzip the clang-format-diff.patch file into the OpenAstroTracker-Firmware repo
    4. Run git apply clang-format-diff.patch to make the changes
    5. Commit and push up the formatted code
  2. Run clang-format locally
    1. Run the command bash -c 'shopt -s nullglob globstar;GLOBIGNORE=./src/libs/TimerInterrupt/*; for i in ./{.,src/**,unit_tests,boards/**}/*.{c,cpp,h,hpp}; do clang-format -i $i; done'
    2. Commit and push up the formatted code

openastrotech-bot avatar Mar 25 '22 16:03 openastrotech-bot

Rebased on 1.11.5 from develop branch.

JakobPetersson avatar Mar 27 '22 09:03 JakobPetersson

We discussed this internally and agree with your reasoning, but each of the X/Y/Z min/max pins have been allocated already for future features (they're shared with the diag pins).

X-min/max and Z-min/max are going to be used for limit switches for each axis on the OAM. Y-min/max are already used for the separate debug serial port which is needed for development purposes.

The best alternative is pin D11. It is adjacent to a 5V and gnd pin, so a single 3-pin Dupont connector can be used for the hall sensor.

Please change the pin and version number to the next available increment and we'll get this merged.

CTetford avatar Apr 15 '22 15:04 CTetford

I believe I have made the requested changes now. @CTetford

JakobPetersson avatar Apr 24 '22 19:04 JakobPetersson