Skip to content

Conversation

Copy link

Copilot AI commented Dec 23, 2025

Belt retraction now maintains tension for 10 seconds after detection to enable proper tension testing. State transitions between RETRACTING, EXTENDING, and RELEASE_TENSION are fully bidirectional to allow interrupting operations without errors.

Changes

Tension hold logic (MotorUnit::pull_tight())

  • Continue applying retract force for 10 seconds after detecting current threshold
  • Track tension state with tensionDetected and tensionDetectedTime variables
  • Use named constant TENSION_HOLD_DURATION_MS for maintainability

Flexible state transitions (Calibration::requestStateChange())

  • Allow EXTENDING from RETRACTING and RELEASE_TENSION states (previously restricted to RETRACTED/EXTENDEDOUT)
  • Allow RELEASE_TENSION from RETRACTING, EXTENDING, and RETRACTED states (previously restricted to READY_TO_CUT, UNKNOWN, EXTENDEDOUT, CALIBRATION_COMPUTING)
  • RETRACTING already permitted from any state

Example behavior

Before:

// Tension detected → motor stops immediately → zero position
if (currentMeasurement > currentThreshold) {
    stop();
    return true;
}

After:

// Tension detected → maintain force for 10s → then stop and zero
if (tensionDetected && elapsedTime >= TENSION_HOLD_DURATION_MS) {
    stop();
    return true;
}
// Continue applying retract_speed during hold period

Users can now switch freely between retract all, extend all, and release tension operations at any time without validation errors, regardless of belt extension status or measurements.

Original prompt

This section details on the original issue you should resolve

<issue_title>Tension testing firmware</issue_title>
<issue_description>Create a version where Retract all uses the retract force value, and maintains it for 10 seconds after it finds tension.

It should also allow moving between retract all and extend all and back to retract all with no errors if not all belts are extended or if the measurements don't match the extended frame.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 23, 2025 14:07
Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
@DaveCoulthurst
Copy link

Modify Requirements Summary 2 from:

✅ Allow moving between retract all and extend all with no errors if not all belts are extended or measurements don't match extended frame

to

Allow moving between retract all, extend all and release tension states with no errors if not all belts are extended or measurements don't match extended frame.

Copilot AI changed the title [WIP] Fix tension testing firmware for retract force management Implement tension hold during belt retraction and flexible state transitions Dec 23, 2025
Copilot AI requested a review from MaslowBot December 23, 2025 14:17
@DaveCoulthurst
Copy link

Also allow moving between retract all, extend all and release tension states, with no errors if not all belts are extended or measurements don't match extended frame.

@DaveCoulthurst
Copy link

@MaslowBot Re-write to also allow moving between retract all, extend all and release tension states, with no errors if not all belts are extended or measurements don't match extended frame.

@MaslowBot
Copy link
Collaborator

@copilot-swe-agent

User @DaveCoulthurst mentioned @MaslowBot with the following request:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

@MaslowBot Re-write to also allow moving between retract all, extend all and release tension states, with no errors if not all belts are extended or measurements don't match extended frame.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This comment was automatically relayed by MaslowBot so that @copilot-swe-agent can respond to the request.

Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 23, 2025

@copilot-swe-agent

User @DaveCoulthurst mentioned @MaslowBot with the following request:...

Done. Updated state transitions to allow moving freely between retract all, extend all, and release tension states without validation errors.

Changes in commit 3ba2ba5:

  • EXTENDING now accepts RELEASE_TENSION as a source state
  • RELEASE_TENSION now accepts RETRACTING, EXTENDING, and RETRACTED as source states
  • Users can now switch between any of these three states regardless of belt extension status or measurements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tension testing firmware

3 participants