Change default pin for RA_HOMING_SENSOR_PIN to pin 3 on mksgenlv21
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
Looks like your PR has code that needs to be changed in order to meet our coding standards! Here are your options:
- Apply the patch that was generated by the job
- Click
detailsunder the failing clang-format check - Click the
Artifactsdropdown in the top right - Download + unzip the
clang-format-diff.patchfile into theOpenAstroTracker-Firmwarerepo - Run
git apply clang-format-diff.patchto make the changes - Commit and push up the formatted code
- Click
- Run
clang-formatlocally- 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' - Commit and push up the formatted code
- Run the command
Rebased on 1.11.5 from develop branch.
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.
I believe I have made the requested changes now. @CTetford