ATR Firmware 101

ATR Firmware

1) What is it

ATR stands for adaptive torque response, it replaces torque tiltback as you’d find it in 5.3 stable or 5.3 stable+ like v4/v6/etc on github. The basic idea is that instead of just looking at amps to determine whether the setpoint needs to be adjusted, ATR compares expected acceleration to actual acceleration.

If the board accelerates slower than expected (e.g. uphill or deep grass) then we raise the nose.
If the board accelerates faster than expected (e.g. downhill) then we lift the tail.

Also, this firmware includes all the other advanced features I’ve developed, including dark ride and many others, see the google sheet linked below for all details.

2)Requirements

#1 Requirement is a working board with stable 5.3 v6 firmware!!!
#2 Is your board having some isses and you’re hoping ATR will fix them??? You will be disappointed!

This only works with custom firmware, it’s not part of 5.3 stable. Here’s the firmware files for all 5.3 hardware, including Ubox 100V and VESC 6_75

ATR v24 ZIP File - Only use on working boards

IMPORTANT: ATR sucks balls if you try it with your existing app configs, so read on...

3) How to load

*The usual firmware loading procedure: Backup your config before loading firmware, select custom file, and DO NOT load the wrong firmware, LFOC v3.1 isn't the same as LFOC v3.0!!!*

PLEASE LOAD FROM PC ONLY!

Note: Windows Bluetooth will not work with VESCs, so you connect via your phone and create a TCP Bridge (checkbox on bottom of first page in app) - note the IP address of the phone (must be on same wifi as PC!!) - then in the PC choose TCP connection

4) How to configure

When loading ATR firmware for the first time, make sure you load my XML file after restoring your own settings:

ATR v23 ALL VESCs.xml (2.8 KB)

  • you don’t really need this when just upgrading from ATRv18 or ATRv20, but see the release notes *

This file is hand-edited and safe to load, it won’t overwrite any of your personal settings like IMU calibration or fault/tiltback settings. For LFOCv3.1 users: please change your balance frequency to 833Hz for optimal behavior.

Configuration is done using the existing torque tiltback settings plus yaw_ki in the Multi ESC section. And it also uses the biquad filter values on the Tune page.

For all details see the table in this google sheet:

Would love to have this table right here, but how do I create a table without going full HTML?

How to test whether the firmware download was successful? The revision number (currently 20) is being reported in the RT data screen (the last one) instead of “Loop Time” when first starting up (it switches to actual loop time after you first engage the board)

I recommend to stop right here, try my ATR xml file first. Once it's all working smoothly you can consider moving to Max's settings

5) Release Notes

v25 - FUTURE
  • FUTURE: Biquad filtering of Angular Rate P to prevent vibrations, allow much higher Rate P (aka YawP) on all IMUs - I’m currently testing this on my boards but it’s still not working as desired…

v24 - 6-Nov-2022

  • Experimental: Braketilt is now actually enabled, so pt1 low/high now do have the described effect
  • Experimental: ATR response boost for faster reaction, better handling of transitions - this is a feature I’ve been meaning to add back in for a while now, sometimes after a downhill the negative ATR can be detrimental to our ability to get up a steep climb if there’s not enough flat section between down and up, FM onewheels would perform way better in those situations - this should be fixed now
  • Allow dirty landings for tricks (extra 10 degree pitch margin for 1 second) - off by default (if you do a big trick where your feet come off the sensor and the board disengages - then this feature allows you to re-engage with an extra 10 degree margin) - but: dirty landings not permitted in dark ride mode, thanks Max!
  • Quickstop enabled with POSI too

Known issues:

  • Battery percentage is back to the old behavior, very much affected by voltage sag so it’s only useful when stationary
  • Caution: I’ve not tested the ATR response boost features with excessively low Amp/Accel ratios (YawD) - it might not work too well, in fact I’m pretty sure it will further amplify the flaws of configuring a low amp/accel ratio

v23 - 27-Oct-2022

  • Mitch’s magic IMU fix is now permanent and not changeable
  • Avoid taildrags after big bonks, jumps, drops - turn on via yaw_clamp=1
  • Braketilt (experimental/wip feature) - configure via pt1 lo/hi - SORRY, PURE PLACEBO, IT’S ALWAYS OFF IN ATR23 :slight_smile:
  • Click on start (to better notice that the board has engaged) - configurable, off by default
  • YawP / Angular Rate P behavior now mimics stable/v6 behavior
    <>
  • Known Issue: battery percentage takes a long time to initialize
  • Known Issue: dirty landing feature cannot be enabled
  • Known Issue: braketilt cannot be turned on

v20 - 10-Oct-2022:

  • Mitch’s magic IMU fix (set PT1 lowpass to 2Hz!)

  • PID “D” component has been eliminated, aka D value is ignored

  • Bugfix for an issue causing a harsh click on startup e.g. after a wheelslip dismount

  • UBox 100V support

  • Known Issue: big bonks can cause taildrag landings, so be careful!

  • Known Issue #2: battery percentage takes a long time to initialize

v18 - 20-Sep-2022:

  • CAN Bus support has been re-enabled
  • CAN based BMS current limiting is disabled

v17 - 6-Sep-2022:

  • More stable battery percentage
  • SimpleStart feature (think Badgersense SureStart), permanently enabled atm

v16 - 26-Aug-2022:

  • Disable ATR (revert to plain torque tilt) by setting TT-Filer to 0Hz
  • Improved hardware filtering for LFOCv3.1 (LSM6DS3 TR-C IMU)
3 Likes

~ Hey there this is Max. I’ve attached my most current trail settings (motor & app) using the CBCSO 84V battery. Make sure you 1) download Dado’s ATR firmware for Little FOCer v3, 2) upload my settings, 3) reconfigure the current, voltage, faults etc for your battery appropriately if you’re not using the 84V CBCSO!! 4) Press ‘WRITE’ for both Motor AND App settings. These settings feel pretty damn good. Can hit 27-31 mph without tiltback. Rips on trails without nose hunting. A quirk to be smoothed out is the motor will crunch when you are braking fast and hard, and when landing a bonk/drop leaning backwards slightly. No biggie tho. Give it a try and let me know! Shoutout Dado, Uy and Hannes for helping me tweak these settings ~

(MK2 means my 2nd MakersPev focer board, NW means Northwest Electric Fest where the board hit those speeds)
MK2 Motor Settings 84V (Trails) Post NW fest.xml (9.7 KB)
MK2 App Settings 84V (Trails) Post NW fest.xml (11.1 KB)

BTW (this is Dado now) - Careful when loading Max’s XML files - they wipe out all your existing settings! If you do want to load them, you will have to redo all your motor configuration, IMU calibration, battery voltage setup, ADC/fault/startup tuning the way you like it…

2 Likes

I was originally on firmware 5.3.002 but I wanted to check these settings out. I loaded the ATR firmware and notice a couple of improvements I really liked straight away:

  • your torque tilt settings
  • going downhill feels soooo much better being able to angle the nose closer to the ground

The only issue i noticed it was dipping a fair bit in acceleration. Tried playing with a ton of settings but could not get it to stop. Probably missed adjusting the settings that would help.

Uploaded the 5.3.004 firmware to my board and the dipping did not exist anymore.

You are right Tiz, due to the absence of torquetilt during flat acceleration the board remains a lot softer. Hannes is complaining about this too…

2 Likes

What can I do to tighten up the feel of my board running ATR? I’ve tried tightening things up as one would with V4, adjusting Mahoney KP and P/I values but it still continues to feel extremely loose. It’s a good feeling. I just tend to like my board a bit stiffer.

See row 80/81 in the spreadsheet: in the NRF section you can enable torquetilt (for acceleration only). Give 20 a try.

1 Like

Woah! Thanks! Will have to give it a try in the morning! :call_me_hand:

@surfdado I just updated to version 16 ATR to test it out and still have crazy dip through acceleration. Tried row 80/81 but it made no difference.

1 Like

Same here, I tried the nrf torque tilt option and it doesn’t feel like it’s working. At least not how it works when you disable atr by putting filter to 0

Hi, what firmware should I use for a BalancePro v6.6+ ?

I think BPro is just “60” - but you can see which hardware name it is in the firmware tab, see “how to load firmware”

1 Like

Thanks, yes, I was reading the thread, you are rigth, it’s a “trampa clone”

image

A good option is using Notion.so to create these types of tutorial/write ups and then you can do an export to “Markdown” and just copy it over here.

Creating tables in markup is much easier in their interface.

Then all you have to do is upload any images you used, which it conveniently sticks in a folder for you on export. so literally you just go to the part in the pev.dev post where the image should be and hit the upload button at each spot where the image should be.
image

I’ve found it is a great tool to use to easily create markdown pages. Much more user friendly once you get the hang of it, plus notion is just good for keeping personal notebooks and such.

And this is what the export file looks like:
image

@surfdado, thanks for all your work on DIY OneWheels. What’s the current recommendation between what I think is being referred to as 5.3+ (GitHub - surfdado/bldc: VESC bldc repo with my improvements) vs the ATR (looks to only being posted here? 5.3+ is more stable/reliable but ATR has more features?

Thanks!
PBZ

Should the IMU frequency change you mentioned for v3.1 to 416 be applied for the stable version of the firmware too? Guessing it’s not just a ATR thing?

From what I’ve been told, it’s due to a way IMU filtering is handled specifically in ATR that doesn’t seem to play nicely with the IMU of the FOCer v3.1 apparently, not totally positive. There’s nothing inherently wrong with running these values in stable V6 as well, but in V6 you should most likely have no issue with running 833Hz for Sample Rate and Loop Hertz as far as I know.

2 Likes

ATR may not be perfect yet, no doubt about it, I still got lots of things I want to improve but I personally find v6 vastly inferior, my 13yr old also immediately notices when I give him a v6 board - for me ATR is the only way forward.

3 Likes

Good to hear. I just took my first proper trail ride on 5.3.006 with Nico’s tune, and it was SOOOO much better than stock FM. If ATR is even better, well, that is an exciting prospect. Will give that a try soon.

1 Like

I’m riding on version 5.3+.006 and Nico’s tune Card on my custom HW ( rebuild from Surfdado’s source code). Everything is OK. I really want to try ATR firmware. But has no build file matching my HW ( I double check in all hwconfig file). Can you help me rebuild the firmware files for my hardware? I live in Vietnam, and only me with my onewheel. Pls, thanks!

I have updated the firmware to ATR23 from ATR20. On ATR20, when I turn on the board or write a config I get the expected short beep followed by a long beep. With ATR23, when I turn on the board or write a config I get a short beep followed by 4 beeps. I have reloaded ATR20 and the beeps go back to what I expected. I then reload ATR23 and I get the short followed by 4 beeps again. The board rides super great with both ATR20 and ATR23. I have ridden many hard trails with both. I am not sure why there are so many beeps on ATR23 startup and writes. Any ideas?

1 Like