Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESC Setup / programming (bidirectional telemetry / forward programming) - implemented for HW5 ESCs #114

Merged
merged 11 commits into from
May 17, 2024

Conversation

bob01
Copy link
Contributor

@bob01 bob01 commented May 14, 2024

ESC setup / programming (forward programming) using the Tx via bidirectional telemetry #101

Complete for HobbyWing V5

Configuration

Code

  • TELEMETRY_BUFFER_SIZE increased to accommodate larger HW5 responses
  • rrfsm protocol callback signature changed to accept time in Us vs Ms for protocols like HW5 which need to see the higher resolution timer
  • out of band metadata value sent every 128 tele frame as ESC status value that Tx widgets can use to...
    • identify ESC (for supported ESCs)
    • signal that ESC needs to be reset (for new settings to take effect / unsolicited telemetry to resume)
    • or can be ignored.

HW5 support

  • configure FC as 'HobbyWing v5'
  • requires Platinum 5 ESC, tested with PL-04.0.11 and current version PL-04.1.02
  • ESC can be configured at any time, restart required - ESC must be power-cycled e.g.
    • bench setup or adjustments in the pits

image
image
image
image
image
image
image
image

Copy link
Owner

@rotorflight rotorflight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor tweaks needed

@@ -1986,8 +2218,9 @@ static bool tribDecode(timeMs_t currentTimeMs)
}
}

static bool tribCrankUncSetup(timeMs_t currentTimeMs)
static bool tribCrankUncSetup(timeMs_t currentTimeUs)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be timeUs_t

typedef bool (*rrfsmStartCallbackPtr)(timeMs_t currentTimeMs); // return true to continue w/ default initialization (if in doubt return true)
typedef bool (*rrfsmDecodeCallbackPtr)(timeMs_t currentTimeMs); // return true if frame was decoded successfully
typedef bool (*rrfsmCrankCallbackPtr)(timeMs_t currentTimeMs); // return true to continue w/ default loop (advanced, if in doubt return true)
typedef bool (*rrfsmStartCallbackPtr)(timeMs_t currentTimeUs); // return true to continue w/ default initialization (if in doubt return true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be timeUs_t

typedef bool (*rrfsmCrankCallbackPtr)(timeMs_t currentTimeMs); // return true to continue w/ default loop (advanced, if in doubt return true)
typedef bool (*rrfsmStartCallbackPtr)(timeMs_t currentTimeUs); // return true to continue w/ default initialization (if in doubt return true)
typedef bool (*rrfsmDecodeCallbackPtr)(timeUs_t currentTimeUs); // return true if frame was decoded successfully
typedef bool (*rrfsmCrankCallbackPtr)(timeMs_t currentTimeUs); // return true to continue w/ default loop (advanced, if in doubt return true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeUs_t

}

static void pl5BuildNextReq()
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(void)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SMH - give me a minute :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeUs_t and fn(void) usage addressed

@rotorflight rotorflight merged commit 57d6254 into rotorflight:master May 17, 2024
1 check passed
@bob01
Copy link
Contributor Author

bob01 commented May 17, 2024

great - thanks

bob01 added a commit to bob01/rotorflight-firmware that referenced this pull request Jun 5, 2024
* hd - pl5 - hw5 / pl5 ported to rrfsm

* hd - pl5 - added: device info & get params req, extended decoder for additional responses, pack param payload for MSP editor

* hd - pl5 - enter MSP editor from tele

* hd - pl5 - added writeparams req, resp, err

* ESC Setup - param - OOB status (restart needed) and device identification

* hd - pl5 - added OOB restart + identification, cleanup

* pl5 - pre-pr code cosmetics, removed deprecated hw5

* pl5 - rrfsm - change callbacks to accept Us (vs Ms) to support protocols like HW5 that need to see the higher resolution timer

* pl5 - more pre-pr code cosmetics, removed debug/test

* pl5 - pr - timeUs_t and fn(void) usage addressed
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.

2 participants