Refloat v1.1 Feature Preview 2 (Haptic Feedback, Setpoint Smoothing)

Hello everyone, here’s the second Refloat 1.1 feature preview, featuring another iteration of Haptic Feedback (now with current modulation for low frequency haptics, instead of using foc_play_tone from VESC Firmware 6.05) and experimental Setpoint Smoothing.

Get it here: Release Refloat v1.1-preview2 · lukash/refloat · GitHub

Installation

  • Back up your current Refloat config.
  • Download refloat-v1.1-preview2.vescpkg from the release page, open “Package Store” in the VESC Tool, and (on mobile) choose “…” → “Install from file…”.
  • Restore your Refloat config.

Please read the release notes for more details about what’s in there.

As before, the Feature Preview goal is to allow interested riders to experiment and provide feedback. It contains a larger number of configuration options to mess with, while the final release will need a reduced amount of options that strike a balance between configurability and not being overwhelming / too involved.

Keep in mind this is experimental software. Only install it at your own risk and if you’re willing to mess with the settings.

For Haptic Feedback, we’re looking for feedback on:

  • How you like it (feel free to compare with Float).
  • Which frequencies work for you, at which strengths (and with which motor).
  • If you’re missing some customizability.

For the Setpoint Smoothing:

  • Which one you like and why.
  • Your settings for it (ideally with description of your ridding style and the terrain you ride).

Setpoint Smoothing

There is a description of the Setpoint Smoothing in the release notes, to reiterate and expand on it:

In Refloat 1.0, Setpoint transitions (for ATR and all the Tilts, the new smoothing is right now only available for ATR, Torque Tilt and Input Tilt) are linear, defined by the configured speeds (Max Tiltback Speed and Max Tiltback Release Speed for each of the Tilts). If these speeds are set too high, the movement is jerky. These experimental filters attempt to smooth out the jerkiness while allowing higher tiltback speeds.

The main configuration of the filters is on the ATR tab! You can set a different type of filter for Torque Tilt on the Tune Modifiers tab and a different Input Tilt filter on the Remote tab, but the configuration of the given types is always only one, on the ATR tab.

The filters were designed primarily with ATR in mind. They can be applied to Torque Tilt, likely with different values (I have not tested them with Torque Tilt much at all). For Input Tilt the requirements are certainly different and not that demanding. The behavior described and depicted below is for the most part not necessary for Input Tilt and some sort of a simplified version will be used for the final release.

3-Stage Filter

The 3-Stage filter has 3-Stage Alpha as the main configuration parameter, the higher the value, the less filtering (and faster response).

It has two additional parameters, 3-Stage In Alpha Away From Zero and 3-Stage In Alpha Back To Zero (again, the higher, the less filtering). These are best explained on a picture:

Imagine a sudden change of setpoint from 0° to 5° (Blue). The Green line provides a nice smooth transition, while Orange is even a bit smoother (and slower) when going up, but faster (and therefore less smooth) when going down. While the main Alpha defines the overall smoothness, the two extra alphas define specifically the two transitions marked on the picture.

This customizability is mainly intended for ATR, which in itself has a certain natural delay. I would say the most annoying effect of the delay is the lingering setpoint after transitioning from a hill (up or down) to flat. Hence, let’s try to smooth out the Back To Zero transition as little as necessary, so that the lingering setpoint goes away as fast as possible. Then, the overall speed of the filter is defined by the main Alpha, which should have a balanced value for an overall speed of the filter and to define the transition “towards” the new target (the two unmarked transitions the picture, when the curve reaches it’s new target). Lastly, the Away From Zero transition can be used to slow down and smooth out the initial “into a tiltback” transition, so that the ride feel is smooth overall, with no jerkiness on small bumps.

3rd Order EMA

The 3rd Order EMA is a more standard filter, defined mainly by the EMA Half Time parameter (the higher the more filtering, i.e. the opposite of 3-Stage!). But, it does have the EMA Return Multiplier parameter to speed up the whole transition back to zero (the higher, the faster it goes back to zero), picture:

Use the defaults for both filters as a starting point for a smooth ride, for ATR You can use these starting values for Torque Tilt and Input Tilt too. They may not be optimal and you’ll likely have to tweak them.

On top of these filters, the Tiltback Speeds (Max Tiltback Speed and Max Tiltback Release Speed) are still applied, you need to set those much higher than what you used before the smoothing. Recommended values are around 20°/s (these are the default on this version, but you will have your old values if you restore your config).

Note: For ATR, the Tiltback Response Boost and Tiltback Transition Boost are not applied if you use the 3-Stage or 3rd Order EMA filters.

3 Likes

I will give this a shot at some point!

How does this compare to the smoothing Dado/Nico implemented?

Are there any plans to add mkp scaling under ATR? Dado was experimenting with this at one point, and i grew to really like it.

1 Like

The smoothing is much smoother than the flawed original smoothing we tried for sure. The original is still there as “Nico’s Smoothing” or something like that if you’d like to compare. And bringing back Mkp scaling for ATR isn’t something that’s been discussed, at least as of now

Thanks! I’ll try this when it isn’t freezing out :sob:.

Have you tried the MKP scaling? Any reason it isn’t something being pursued?

Assuming you mean Pitch KP by MKP, could we call it so (to be clearer for anyone else as well)?

I don’t know almost anything about Pitch KP scaling based on ATR, only heard Dado was experimenting with it. Was it shared somewhere?

While I’d certainly love to test the ideas I have about how to dynamically change Pitch KP based on other parameters and other riding profile tweaks, there’s more important infrastructure work that needs to be done, so not my focus right now, sadly…

I’m not sure if it scales only pitchKP, or if it also scales rollKP /yawKP.

For the last 10 months I was running a refloat package(s) that dado built. That package was basically refloat 1.0.1 with Nico’s smoothing on ATR, Torque/Turn tilt AND also had hacky/hidden setting for MKP scaling based on ATR setpoint. It was configurable through the booster settings :joy:

Edit: He called it Dynamic Mahony. I will send post the discord chat.

Thanks! Yeah, I don’t know much about that, maybe he’ll submit it to Refloat at some point.

It should also get easier as other improvements hit the codebase.

FWIW I’m 99% sure he was only scaling the Pitch KP.

1 Like

@riddimrider

I got a chance to do some street riding today. I am running ATR 1.8up, 1.5down, 28deg/s, 0.5deg thresholds, -50% speedscaling, no torque tilt, some turn tilt, akp 2.0, rkp 1.7, p=35.

Overall the defaults for the 3-stage filter are great! Definitely smoother than Nicos! The biggest advantage I have observed is the quick return to level.

One side effect of the faster ATR and return to level, is that you can’t get away with bad amps to accel ratios. On my sfv1, I am running 12/12.

Float control doesn’t like/recognize this package.

I was running Nico’s smoothing for a while, I have not tried the 3rd order EMA filter, or tuning the 3-stage filter params. It has been so cold here, so I haven’t been able to ride much.

2 Likes

Anyone care to give some explanation on how to tune haptic buzz or some alternative configurations that work well. Not sure on safe voltages or frequency or how that strength vs speed works? Thanks

Thanks for the feedback! For completeness not sure what you mean by akp and rkp, though it’s not very important.

Yes, I also at some point noticed my messed-up amps to accel ratios (I was “tweaking” them at some point) are making the board act weird. FWIW what’s your weight? Are you a heavy rider according to your numbers? The defaults work well for me being lightweight at ~65kg.

Would be cool if you tried to mess with the filter settings too, I’d be curious if you find the defaults good and what would be the ones that you tweak.

Lastly, yes, no word from either Dado or Simon about support in FC and Floaty :person_shrugging: The way it is it’s tedious to add for each special version, hopefully one day we can solve this too.

1 Like

The defaults should be a configuration that works well, does it not for you? Voltages up to 10V should be safe and if you test carefully, you can try even more.

Strength vs speed is described in the help text. Basically a is a constant level regardless of speed, b will raise strength proportionally to speed (linear) and c will ramp up strength really fast as speed goes up (quadratic).

Note the point of the preview is for technical users to report parameters that work for them, not for causal users to have a comfortable experience.

Theres a test version of Floaty at least that supports this Preview 2, as well as a read-only mode that allows any unsupported package and just disables tuning. But this test version is limited access for now, but at least it exists

1 Like

I should have specified. akp = angle-kp (I don’t know why I didn’t call it pitch-kp :sweat_smile:), rkp is roll-kp.

I weigh ~ 75 kg. With the default ratios, riding on a flat surface and braking/accelerating would cause ATR to change the setpoint (resisting the tail/noseslide). Even at 12/12 it will engage when the nose is very far from the setpoint, like a nose-drag.

I will play with the filter settings when it warms up!

1 Like

Installed preview 2 after testing 1 for a while. The haptic and audible alerts feel more natural. I stuck with the default settings and turned up audible strength to 5v, haptic strength to 6amps. A to .3, B to .2 and C to .01. just enough feedback for me to be alerted.

Haven’t tried the filters yet. Nice work on this stuff. I think haptic and sound is an improvement over preview 1 for sure.

The purple feedback on the status LED after a write is nice also!

2 Likes