Commit Graph

27 Commits

Author SHA1 Message Date
Adeeb Shihadeh
ce4bac8218 remove unused last_actuators arg from lateral controllers (#30595) 2023-12-03 15:54:18 -08:00
Adeeb Shihadeh
a9626f95b6 add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
2023-08-20 20:49:55 -07:00
Vivek Aithal
15b880c0ea Bolt EUV: Non-linear torque function (#27696)
* add erf based ff

* silly bug; diff of nonlinear != nonlinear of diff

* add sigmoid based ff, ensure slope at 0 > 1

* reduce steer down limit and increase driver allowance

* rebase panda

* atry without friction, and with tanh nonlinear

* finalize the nonlinear function

* do not disable friction compensation in the ff

* bump panda

* bump panda

* update refs

* update refs

* resolve comments

* Add type hints

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-29 15:10:39 -07:00
Adeeb Shihadeh
2008332bd4 GM: revert custom Bolt torque tune (#27403)
* Revert "GM: cleanup torque feedforward function (#27347)"

This reverts commit 8c099dd4e5.

* Revert "Chevrolet Bolt: Non-linear torque tune (#27344)"

This reverts commit e49748d571.

* update refs
2023-02-21 15:27:48 -08:00
Vivek Aithal
e49748d571 Chevrolet Bolt: Non-linear torque tune (#27344)
* add non linear tune

* update refs

* rerun tests
2023-02-14 16:20:28 -08:00
Jason Young
cb88b3ed65 controlsd: set latActive with max minimum steer speed (#26805)
* refactor minimum lateral speed handling

* rename for clarity

* simplify without joystick at standstill

* intermediate standstill variable, check notCar

* check joystick for now

* cmt

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-01-10 20:51:10 -08:00
Vivek Aithal
e9eb5d99ff [torqued] Fix high speed oscillations (#26338)
* modify low speed factor during high speeds and rescale friction

* update refs
2022-11-07 17:01:24 -08:00
HaraldSchafer
1548db8962 Partial revert, lax torque control (#26146)
* Closer to original

* Update ref
2022-10-18 21:25:06 -07:00
HaraldSchafer
2c9b150761 Low speed lateral like before (#26022)
* Add explicit cost on steering wheel movement

* Laxer low speed control

* Laxer low speed control

* Lower min speed now there is a cost

* 3m/s

* Similar to old master

* Add cost

* Crazy high

* Update ref

* comment
2022-10-11 14:53:43 -07:00
Vivek Aithal
4fa62f1464 Live torque (#25456)
* wip torqued

* add basic logic

* setup in manager

* check sanity and publish msg

* add first order filter to outputs

* wire up controlsd, and update gains

* rename intercept to offset

* add cloudlog, live values are not updated

* fix bugs, do not reset points for now

* fix crashes

* rename to main

* fix bugs, works offline

* fix float in cereal bug

* add latacc filter

* randomly choose points, approx for iid

* add variable decay

* local param to capnp instead of dict

* verify works in replay

* use torqued output in controlsd

* use in controlsd; use points from past routes

* controlsd bugfix

* filter before updating gains, needs to be replaced

* save all points to ensure smooth transition across routes, revert friction factor to 1.5

* add filters to prevent noisy low-speed data points; improve fit sanity

* add engaged buffer

* revert lat_acc thresh

* use paramsd realtime process config

* make latacc-to-torque generic, and overrideable

* move freq to 4Hz, avoid storing in np.array, don't publish points in the message

* float instead of np

* remove constant while storing pts

* rename slope, offset to lat_accet_factor, offset

* resolve issues

* use camelcase in all capnp params

* use camelcase everywhere

* reduce latacc threshold or sanity, add car_sane todo, save points properly

* add and check tag

* write param to disk at end of route

* remove args

* rebase op, cereal

* save on exit

* restore default handler

* cpu usage check

* add to process replay

* handle reset better, reduce unnecessary computation

* always publish raw values - useful for debug

* regen routes

* update refs

* checks on cache restore

* check tuning vals too

* clean that up

* reduce cpu usage

* reduce cpu usage by 75%

* cleanup

* optimize further

* handle reset condition better, don't put points in init, use only in corolla

* bump cereal after rebasing

* update refs

* Update common/params.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* remove unnecessary checks

* Update RELEASES.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-19 15:19:26 -07:00
Vivek Aithal
85ed5c4cb5 Torque Refactor (#25822)
* add torque gains refactor

* update refs

* avoid dict, use cereal struct

* bugfix

* no as_builder

* address final comments
2022-09-17 00:07:54 -07:00
Adeeb Shihadeh
d462a08056 remove CS.steeringRateLimited (#25251)
* remove CS.steeringRateLimited

* bump cereal

* update refs
2022-07-24 14:56:55 -07:00
HaraldSchafer
b3226d505b Torque control: higher low speed gains and better steering angle deadzone logic (#24980)
* Try no friction and no deadzone

* Learn fromd ata

* update refs
2022-06-27 15:25:47 -07:00
Adeeb Shihadeh
062a8bcdbd cleanup torque tuning config (#24951) 2022-06-24 13:01:49 -07:00
HaraldSchafer
a6652a539d Torque control: low speed boost (#24859)
* Make very low speed more aggressive

* Less extreme low speed boost

* Update ref
2022-06-14 22:29:08 -07:00
HaraldSchafer
843e59f6f0 Misc torque control fixes (#24801)
* Fiction compensation should be based on error

* Update refs

* Add deadzone

* update ref
2022-06-10 22:52:48 -07:00
ClockeNessMnstr
b215d611b1 update DH names + notes for MPC output curvatures (#24701)
* update names + notes for MPC outputs

"current_curvature" is not the correct description of what the MPC is outputting in it's curvature_ego state.
The MPC is integrating it's free variable, curvature_rate, such that curvature[0] is actually the desired_curvature before any delay.
inversely: the curvature_rate_desired is the desired rate of change to the setpoint and not the actual curvature rate. 

If we were to set the initial curvature = measured curvature in the MPC initiation these names would be correct. 
This was possibly how it was initially set up but the nomenclature here is now confusing.

* more notes

* match

* Clarify #1
2022-06-07 09:41:03 -07:00
Shane Smiskol
c6bc03311c Car documentation: set steering torque star using car interface (#24709)
* Set good torque using torque controller tuning

* should be equal to

* save lateral accel to car params

* use maxLateralAccel

* always

* same convention

* nan will always evaluate to false

* The great good torque purge

* adjust default friction

* Add data for more cars

* adjust name

* Welcome back, guys. Only adjust good torque if maxLatAccel is set

* Update refs (1.7 is 1.7000001...)
2022-06-03 17:41:20 -07:00
HaraldSchafer
d708a134bd Tssp prius torque control (#24669)
* use llk

* use steering sensor at low speed stil

* Try more simple

* rm prius tune

* updated ref
2022-05-27 10:21:02 -07:00
HaraldSchafer
d928972150 Rerevert torque control (#24649)
* Revert "Revert torque control (#24565)"

This reverts commit 9f8b03753d.

* Move tune out of car specific stuff

* Update ref commit
2022-05-24 17:52:33 -07:00
HaraldSchafer
2181bbca71 Latcontrol torque: integrator need not be reset (#24606)
slow integrators need not be reset
2022-05-20 13:50:47 -07:00
ClockeNessMnstr
a693b3a26b LatControlTorque: clean up class variable (#24526)
* move to super

* no class variable

* there's CP

* whitespace

* drop CI from latcontrol super

* Revert "drop CI from latcontrol super"

This reverts commit 9218273060ade6431c4fc4c310b27e7e210158b9.

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-05-13 16:52:20 -07:00
HaraldSchafer
29afd53d88 Latcontrol torque: fix integrator induced ping pong (#24458)
* Latcontrol torque: fix integrator induced ping pong

* Reset on disengage since unwind resets anywayh

* Might be overkill

* rm whitespace

* update ref
2022-05-06 22:17:21 -07:00
ntegan1
9a44d4c4e0 LatControlTorque: log desired/actual lateral accel (#24406)
* log torque lateral accel

* bump cereal

* update refs

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-05-03 14:18:46 -07:00
Shane Smiskol
c9be2f02c3 Clean up controllers (#24340)
* clean up lat controllers

* pass CP once

* sort
2022-04-28 00:42:52 -07:00
Shane Smiskol
e834b4d9be LatControlTorque: fix deadzone and missing steer saturated warning (#24294)
* fix steer saturated alert and deadzone

* fix and formatting

* update refs

* update refs

* not needed

* remove
2022-04-27 01:18:05 -07:00
HaraldSchafer
fe0bcdaef6 Lateral torque-based control with roll on TSS2 corolla and TSSP rav4 (#24260)
* Initial commit

* Fix bugs

* Need more torque rate

* Cleanup cray cray control

* Write nicely

* Chiiil

* Not relevant for cray cray control

* Do some logging

* Seems like it has more torque than I thought

* Bit more feedforward

* Tune change

* Retune

* Retune

* Little more chill

* Add coroll

* Add corolla

* Give craycray a good name

* Update to proper logging

* D to the PI

* Should be in radians

* Add d

* Start oscillations

* Add D term

* Only change torque rate limits for new tune

* Add d logging

* Should be enough

* Wrong sign in D

* Downtune a little

* Needed to prevent faults

* Add lqr rav4 to tune

* Try derivative again

* Data based retune

* Data based retune

* add friction compensation

* Doesnt need too much P with friction comp

* remove lqr

* Remove kd

* Fix tests

* fix tests

* Too much error

* Get roll induced error under 1cm/deg

* Too much jitter

* Do roll comp

* Add ki

* Final update

* Update refs

* Cleanup latcontrol_torque a little more
2022-04-19 19:34:31 -07:00