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).
1 Like

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

@riddimrider

I did some trail riding yesterday and played with some parameters. For all these these tests tiltback speed and angle limit were constant. Tiltback speed = release speed = 28deg/sec, angle limit = 19deg. I will increase the speed to 30-35deg/sec and the angle limit to 25-35 next time I ride. I am also back at 11/11 accel/decel ratios (from 12/12). I need to tune these a little better, but 11 or 12 seems about right.

3-stage: I have settled on a=0.012, a_away=0.02, and a_back=0.15 for now. I wanted to try faster, but I ran out of time.

3rd order EMA: Out of the box, this one felt the best on trails, but it always seems just a little less responsive (slow) than I wanted. Decreasing halftime to 240ms and return_mult to 2 helped, but it still seemed just a little bit slower and didn’t feel quite as good as 3-stage.

Nico’s: How I ever felt like this was smooth is beyond me :joy:. It is fast, but it is much less comfortable than the 3-stage and 3rd order EMA filters. Still much better than no smoothing.

Question about 3 stage. Are the alpha parameters all on the same scale and are they additive? i.e. is a=0, a_away=0.032, and a_back=0.162 the same as a=0.012, a_away=0.02, and a_back=0.15?

Let me know if there is anything else you would like me to test!

1 Like

Thank you, great feedback.

What I don’t fully understand is you say 3rd order EMA felt best on trails but didn’t feel as good as 3-Stage. If you could describe better what you feel is the difference (what’s better on one and what on the other) that’d be great.

The a_away and a_back alphas on 3-Stage have the same scale / effect. Besides that, the main alpha vs the other two is not directly comparable and your “additive” example is totally not how it works :smiley: Don’t set a = 0, that’ll most likely make the number not change, probably means the setpoint will stay at 0 but I haven’t tested it… There’s no simple correlation like that (not even multiplicative, which one could assume makes more sense), their effects are just different.

FWIW, I haven’t even tried it yet, but I implemented realtime plotting in the package AppUI now. I think the effects of the filters should be quite well visible on the plot, looking forward to try it, once I find the time and the weather is warmer. I’m focusing on getting 1.1 out now, once that’s released, I’ll provide another feature preview of the setpoint smoothing, that’ll have the plotting too.

1 Like

What I meant by this, was at the default values 3rd order EMA felt the best on trails, while 3-stage felt better on pavement. 3rd order EMA felt like it handed fast transitions better (smoother, less tail drags, not sure how to say this in a non subjective way). After tuning the parameters, I found 3-stage to feel the best both on street and trails.

It is good to know there is no simple relationship between the values. I’m their current representation, it is hard to gauge the magnitude of the expected behavior change from the magnitude of the alpha values. Is there a plan to scale these to be more intuitive? If not, it would be great to have a better description of their roles in the smoothing.

Logging/plotting in the appui would be great! I would love a copy of the package if you think it’s safe.

1 Like

It remains to be figured out what the final config options will be. I’d like to ideally reduce them, but not sure it’ll be possible. Yeah, I know these values are completely unrelatable, but I’m afraid there’s no easy way to turn them into some nicer numbers. If there is one, it’s very complex math and I’m not that good to come up with it. But I’ll see what I can do, definitely these are pretty bad as parameters to be tuned by users :smiley:

1 Like