dlang
October 7, 2025, 2:57am
1
This PR attempts to make bit changes easier.
It adds a button that will raise the bit from wherever it is to a pre-configured max height (53mm by default) and then if you don’t have a probe, when you hit the button again it drops it back down to the prior location.
If you do have a probe, it should probe for the bit length when you click the button.
Maslow-Main ← copilot/fix-201
opened 02:47AM - 21 Sep 25 UTC
This PR implements the requested bit change height feature that allows users to … easily change bits at a configurable height with intelligent workflow management, available regardless of probe panel settings.
## Key Features
**Configurable Bit Change Height**
- Added new `bitChangeHeight` preference with default value of 60mm
- Configurable through the preferences dialog in the main GRBL panel section (always available)
- Validates input range (0-9999mm) with proper error messages
**Universally Available Smart Button Behavior**
- New "Change bit" button in the main GRBL control tab that's always visible
- Adapts based on actual probe hardware detection, not UI panel preferences
- When probe hardware detected: "Change bit" → "Probe for bit length" → "Change bit"
- When no probe hardware: "Change bit" → "Lower bit" → "Change bit"
- Button text dynamically updates to guide the user through the workflow
**Machine/Work Coordinate Z-Position Management**
- Automatically stores current Z position before moving to bit change height
- Moves Z-axis to the configured bit change height using G53/G90/G0 commands in machine coordinates for consistent positioning
- Returns to the original Z position using work coordinates after bit change is complete
- Integrates seamlessly with existing probe functionality when probe hardware is available
- **Uses machine coordinates (G53) for bit change height movement to ensure consistent positioning regardless of work coordinate offset**
- **Switches back to work coordinates (G54) after returning to ensure normal operational state**
## Implementation Details
The feature integrates cleanly with the existing system while being universally accessible:
- Added `bitChangeHeight` to the `probeValues` object for consistent validation
- Maintains state tracking for the bit change workflow
- Uses existing G-code command infrastructure (`SendPrinterCommand`)
- Follows established UI patterns and preferences system architecture
- **Uses machine coordinates (G53) for bit change height movement to provide consistent safe clearance**
- **Uses work coordinates (G54) for return movement to maintain user workflow expectations**
- **Moved from probe-specific tab to main GRBL control tab for universal availability**
- **Uses hardware probe detection rather than UI panel preferences for intelligent behavior**
The feature is now always available in the main GRBL control tab regardless of probe panel settings, with intelligent behavior based on actual probe hardware availability. The coordinate system uses machine coordinates for the bit change height (ensuring consistent positioning) and work coordinates for the return movement (maintaining user expectations).

Fixes #201.
---
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey.
1 Like