Momentary Switch Homing and Dome Rotation Calibration - #48
Open
CTetford wants to merge 1 commit into
Open
Conversation
- HOME_SEQUENCE_MOMENTARY: homing for lever/roller switches. Seeks past the switch until it releases, approaches from the far side, records the coordinate where the sensor trips, and gotos back to it. The dome sets home from that recorded edge, and only if the sensor was reached. - :DM# measures steps per revolution via repeated home switch passes, for calibrating AXIS1_STEPS_PER_DEGREE. - Servo oscillation detection replaced with Hägglund's integral absolute error (IAE) method; the old check tripped on a single polarity change (normal reversals and settling transients). - Servo runaway detection is now direction-based: encoder moving opposite the target at >=90% power on two consecutive checks. The old distance-based check could mistake a growing following error for a runaway. - Fix: Axis::poll() zeroed the frequency during backlash takeup, giving the backends a zero step size - takeup never completed and the axis stopped dead mid-slew. Dome homing also runs with backlash off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds homing support for momentary (magnetic/limit) home switches, which are only ON for a short time. The stock fast/slow/fine refinement has no region to converge on with these. All opt-in; default behaviour is unchanged.
Momentary homing
HOME_SEQUENCE_MOMENTARY): seek past the switch until it releases, approach from the far side, record the coordinate at the sensor trip, then goto back to it.HOME_SETTLE_TIME), edges are debounced by travel distance (HOME_SENSE_DEBOUNCE), and seek direction is selectable (HOME_SEEK_REVERSE).:DM#rotation calibrationAXIS1_STEPS_PER_DEGREE. RequiresAXIS1_WRAP ON; writes nothing to NV;:DH#stops it.Servo safety - oscillation detection update
SERVO_SAFETY_OSCILLATION_*.Servo safety - runaway detection update
Fix - backlash takeup deadlock
Axis::poll()commanded a frequency of zero. The motor backends read travel direction from the sign of the commanded frequency, and zero has no sign - so the motor stepped nowhere, the takeup counter never advanced, andinBacklashnever cleared. The fix keeps the normal frequency ramp running during takeup; the backends already clamp it to the backlash rate, so takeup completes and the slew continues. Dome homing also zeroes backlash for the run (as park/unpark already do) and restores it on every exit path.New options (
HOME_SEQUENCE_MOMENTARY,HOME_SEEK_REVERSE,HOME_SENSE_DEBOUNCE,HOME_SETTLE_TIME,DOME_CALIBRATE_REVOLUTIONS,SERVO_SAFETY_OSCILLATION_*) all default to current behaviour and are checked in Validate.h.Tested on a modified Technical Innovations HD6 dome, Teensy 4.1 / OCS4: SERVO_EE DC drive, AB encoder, magnetic home switch.