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

Prius Prime differentiated from Prius #294

Closed
wants to merge 12 commits into from

Conversation

ErichMoraga
Copy link
Contributor

The need to treat the Prime separately from the Prius has become increasingly evident. I've tested this code (3 files changed) with several users (various makes/models) successfully.

By popular demand, as Primes have different characteristics.
By popular demand, as Primes have different characteristics.
By popular demand, as Primes have different characteristics.  

For Prime-specific mods, I used this...
      ret.steerRatio = 15.00   # unknown end-to-end spec
      tire_stiffness_factor = 0.6371
      ret.mass = 3370 * CV.LB_TO_KG + std_cargo

That was because I realized the effective tire stiffness was a product of the above value, as well as tireStiffnessFront_civic & tireStiffnessRear_civic, so I did some math...

0.4.7.2 Comma values
tireStiffnessFront_civic = 85400*1.43353663=122424.028202
tireStiffnessRear_civic = 90000*1.43353663=129018.2967

0.5.0   Comma values
tireStiffnessFront_civic = 192150*0.7933=152432.595
tireStiffnessRear_civic = 202500*0.7933=160643.25

To determine what the new tire_stiffness_factor is, divide the old effective value by the new tireStiffness*...
122424.028202/192150=0.6371273911111111
129018.2967/202500=0.6371273911111111

Prime should drive the same as it did in 0.4.7.2.
@rbiasini
Copy link
Contributor

Changes look good. I only recommend to change CAR.PRIME into CAR.PRIUS_PRIME
However, before merging these changes I would need some evidence (or at least be able to verify it) that the 2 car models behave differently. Can you PM on slack the list of dongle ids you tested?

@ErichMoraga
Copy link
Contributor Author

I've PM'd you my Dongle ID, and put out an alert/request in #toyota for others to PM you too. I also agree w/ the "CAR.PRIME into CAR.PRIUS_PRIME" suggestion.

Per Rick Biasini's suggestion.
Per Rick Biasini's suggestion.
Per Rick Biasini's suggestion.
Copy link
Contributor Author

@ErichMoraga ErichMoraga left a comment

Choose a reason for hiding this comment

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

Changed CAR.PRIME to CAR.PRIUS_PRIME

@rbiasini
Copy link
Contributor

build failed @ErichMoraga

@@ -2,6 +2,7 @@

class CAR:
PRIUS = "TOYOTA PRIUS 2017"
PRIME = "TOYOTA PRIUS PRIME 2017"
Copy link
Contributor

Choose a reason for hiding this comment

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

change to PRIUS_PRIME

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh duh! Getting on it...

Forgot to add "PRIUS_" to this one earlier.
@ghost
Copy link

ghost commented Jul 17, 2018

Thank you !

@ghost
Copy link

ghost commented Jul 17, 2018

I feel like we should compare notes on steering ration, steer strengths and other tuning params. Passing down to everyone with a Prime the best tune to date. On that note things can only get better !

@pianohawk
Copy link

I have a 2017 Prius Prime and am interested in helping anyway I can. Is openpilot ready for this vehicle?

@andy867
Copy link

andy867 commented Jul 20, 2018 via email

@pianohawk
Copy link

OMG!!!! If I order the hardware, I can run it as soon as it arrives?

@mtourangeau
Copy link

https://community.comma.ai/wiki/index.php/Installing_OpenPilot_on_the_EON

Remember to set the jumper correctly. That will be your major problem.

ret.steerKpV, ret.steerKiV = [[0.5], [0.02]]
ret.steerKf = 0.00007   # full torque for 10 deg at 80mph means 0.00007818594
ret.steerKpV, ret.steerKiV = [[0.45], [0.015]]
ret.steerKf = 0.000065   # full torque for 10 deg at 80mph means 0.00007818594
Also, there was no steerActuatorDelay change.
1. Comma UI
2. Comma fan thresholds
3. ret.steerRatio = 15.00   # unknown end-to-end spec  [ala devel]
4. tire_stiffness_factor = 0.6371  [ala devel]
@@ -91,7 +91,7 @@ def get_params(candidate, fingerprint):
ret.steerKpV, ret.steerKiV = [[0.45], [0.015]]
ret.steerKf = 0.0000675 # full torque for 10 deg at 80mph means 0.00007818594
# TODO: Prius seem to have very laggy actuators. Understand if it is lag or hysteresis
ret.steerActuatorDelay = 0.40
ret.steerActuatorDelay = 0.43
Copy link
Contributor

Choose a reason for hiding this comment

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

Damn, that thing is slow as fuck :) I think @pd0wm has a way to measure exact delay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing a lot of tests, so not necessarily a final value.

@mtourangeau
Copy link

mtourangeau commented Jul 24, 2018

I’m testing those values and it’s much better. We can almost close #300.

@ErichMoraga ErichMoraga closed this Oct 2, 2018
@ErichMoraga ErichMoraga deleted the priusprime branch October 2, 2018 03:02
pd0wm pushed a commit that referenced this pull request Oct 9, 2019
30c7ca8 bump version to 1.5.3
9403dbe Need to fix wifi test before re-enabling.
0812362 GPS UART fix until boardd is refactored (#294)
ffbdb87 python2 -> 3 fixes to pedal flasher (#292)
78b75ef Added build type to release version strings
736c2cb Fixed sending of bytes over PandaSerial
0894b28 Fixed USB power mode on black (#291)
4b3358c patch to be able to switch from EON to PC with a Panda that has EON b… (#290)
a95c44a Made setting of NOOUTPUT on no heartbeat more efficient (#287)
9486836 UART instability fix with high interrupt load (#283)
9a9e9d4 Fix usb_power_mode missing initialization (#289)
af0960a DFU fix (#288)
70219d7 match safety enum in cereal (#285)
a338d39 Fix build for jenkins test
78ef4a6 Stop charge (#284)
5266a40 Fix typo (#286)
f4787ec Revert "turn on CDP when ignition switches on (#281)"
d37daee Revert "NONE and CLIENT should be the same thing in white/grey pandas"
e97b283 NONE and CLIENT should be the same thing in white/grey pandas
8c1df55 turn on CDP when ignition switches on (#281)
847a35d Fix bullet points
fac0277 Misra update (#280)
5a04df6 Added description of regression tests to README
c4aabae Fixed some python3 bugs in the test scripts and PandaSerial
9af0cb3 Bump version
c4ac3d6 Disable GPS load switching on black pandas
078ee58 This is the correct table, actually
578b95e Misra table of coverage added
d383a26 bump panda
b98ca01 fix sdk build in python3 env (#279)
63d3dc7 Set python3 env before runnign get_sdk, so we know if it fails
e951d79 legacy code we don't control can remain python2
11b7151 Merge pull request #276 from commaai/python3
9893a84 Merge pull request #277 from zorrobyte/patch-1
d326869 Revert "revert back esptool to python2 and force to build esptools with python2"
875e760 revert back esptool to python2 and force to build esptools with python2
9c40e62 needed to install python3
ed2ac87 Also moved safety tests to python3
6842b2d move esptool sdk installation before python3 env is set. Kind of a cheat
b5a2cab this hopefully fixes build test
6280509 Fixes safety replay
2c220b6 this fixes language regr test
fdbe789 use python 3 in Docker container
ee1ae4f Better hash print
0de9ef7 Revert "Final 2to3 on the whole repo"
c92fd3b Final 2to3 on the whole repo
5f2bc44 better
b2a30fd make works!
b74005d fix sign.py
fe72770 read file as byte and no tab before sleep
32a344ef6 Update README.md
2dc3409 2to3 applied
ffa68ef undo unnecessary brackets for print
dbc2480 Fix all the prints with 2to3, some need to be undo
5a7aeba xrange is gone
982c4c9 one more python3 env
1e2412a env python -> env python3

git-subtree-dir: panda
git-subtree-split: 30c7ca8
jyoung8607 pushed a commit to jyoung8607/openpilot that referenced this pull request Oct 10, 2019
30c7ca8 bump version to 1.5.3
9403dbe Need to fix wifi test before re-enabling.
0812362 GPS UART fix until boardd is refactored (commaai#294)
ffbdb87 python2 -> 3 fixes to pedal flasher (commaai#292)
78b75ef Added build type to release version strings
736c2cb Fixed sending of bytes over PandaSerial
0894b28 Fixed USB power mode on black (commaai#291)
4b3358c patch to be able to switch from EON to PC with a Panda that has EON b… (commaai#290)
a95c44a Made setting of NOOUTPUT on no heartbeat more efficient (commaai#287)
9486836 UART instability fix with high interrupt load (commaai#283)
9a9e9d4 Fix usb_power_mode missing initialization (commaai#289)
af0960a DFU fix (commaai#288)
70219d7 match safety enum in cereal (commaai#285)
a338d39 Fix build for jenkins test
78ef4a6 Stop charge (commaai#284)
5266a40 Fix typo (commaai#286)
f4787ec Revert "turn on CDP when ignition switches on (commaai#281)"
d37daee Revert "NONE and CLIENT should be the same thing in white/grey pandas"
e97b283 NONE and CLIENT should be the same thing in white/grey pandas
8c1df55 turn on CDP when ignition switches on (commaai#281)
847a35d Fix bullet points
fac0277 Misra update (commaai#280)
5a04df6 Added description of regression tests to README
c4aabae Fixed some python3 bugs in the test scripts and PandaSerial
9af0cb3 Bump version
c4ac3d6 Disable GPS load switching on black pandas
078ee58 This is the correct table, actually
578b95e Misra table of coverage added
d383a26 bump panda
b98ca01 fix sdk build in python3 env (commaai#279)
63d3dc7 Set python3 env before runnign get_sdk, so we know if it fails
e951d79 legacy code we don't control can remain python2
11b7151 Merge pull request commaai#276 from commaai/python3
9893a84 Merge pull request commaai#277 from zorrobyte/patch-1
d326869 Revert "revert back esptool to python2 and force to build esptools with python2"
875e760 revert back esptool to python2 and force to build esptools with python2
9c40e62 needed to install python3
ed2ac87 Also moved safety tests to python3
6842b2d move esptool sdk installation before python3 env is set. Kind of a cheat
b5a2cab this hopefully fixes build test
6280509 Fixes safety replay
2c220b6 this fixes language regr test
fdbe789 use python 3 in Docker container
ee1ae4f Better hash print
0de9ef7 Revert "Final 2to3 on the whole repo"
c92fd3b Final 2to3 on the whole repo
5f2bc44 better
b2a30fd make works!
b74005d fix sign.py
fe72770 read file as byte and no tab before sleep
32a344ef6 Update README.md
2dc3409 2to3 applied
ffa68ef undo unnecessary brackets for print
dbc2480 Fix all the prints with 2to3, some need to be undo
5a7aeba xrange is gone
982c4c9 one more python3 env
1e2412a env python -> env python3

git-subtree-dir: panda
git-subtree-split: 30c7ca8
jyoung8607 pushed a commit to jyoung8607/openpilot that referenced this pull request Nov 6, 2019
30c7ca8 bump version to 1.5.3
9403dbe Need to fix wifi test before re-enabling.
0812362 GPS UART fix until boardd is refactored (commaai#294)
ffbdb87 python2 -> 3 fixes to pedal flasher (commaai#292)
78b75ef Added build type to release version strings
736c2cb Fixed sending of bytes over PandaSerial
0894b28 Fixed USB power mode on black (commaai#291)
4b3358c patch to be able to switch from EON to PC with a Panda that has EON b… (commaai#290)
a95c44a Made setting of NOOUTPUT on no heartbeat more efficient (commaai#287)
9486836 UART instability fix with high interrupt load (commaai#283)
9a9e9d4 Fix usb_power_mode missing initialization (commaai#289)
af0960a DFU fix (commaai#288)
70219d7 match safety enum in cereal (commaai#285)
a338d39 Fix build for jenkins test
78ef4a6 Stop charge (commaai#284)
5266a40 Fix typo (commaai#286)
f4787ec Revert "turn on CDP when ignition switches on (commaai#281)"
d37daee Revert "NONE and CLIENT should be the same thing in white/grey pandas"
e97b283 NONE and CLIENT should be the same thing in white/grey pandas
8c1df55 turn on CDP when ignition switches on (commaai#281)
847a35d Fix bullet points
fac0277 Misra update (commaai#280)
5a04df6 Added description of regression tests to README
c4aabae Fixed some python3 bugs in the test scripts and PandaSerial
9af0cb3 Bump version
c4ac3d6 Disable GPS load switching on black pandas
078ee58 This is the correct table, actually
578b95e Misra table of coverage added
d383a26 bump panda
b98ca01 fix sdk build in python3 env (commaai#279)
63d3dc7 Set python3 env before runnign get_sdk, so we know if it fails
e951d79 legacy code we don't control can remain python2
11b7151 Merge pull request commaai#276 from commaai/python3
9893a84 Merge pull request commaai#277 from zorrobyte/patch-1
d326869 Revert "revert back esptool to python2 and force to build esptools with python2"
875e760 revert back esptool to python2 and force to build esptools with python2
9c40e62 needed to install python3
ed2ac87 Also moved safety tests to python3
6842b2d move esptool sdk installation before python3 env is set. Kind of a cheat
b5a2cab this hopefully fixes build test
6280509 Fixes safety replay
2c220b6 this fixes language regr test
fdbe789 use python 3 in Docker container
ee1ae4f Better hash print
0de9ef7 Revert "Final 2to3 on the whole repo"
c92fd3b Final 2to3 on the whole repo
5f2bc44 better
b2a30fd make works!
b74005d fix sign.py
fe72770 read file as byte and no tab before sleep
32a344ef6 Update README.md
2dc3409 2to3 applied
ffa68ef undo unnecessary brackets for print
dbc2480 Fix all the prints with 2to3, some need to be undo
5a7aeba xrange is gone
982c4c9 one more python3 env
1e2412a env python -> env python3

git-subtree-dir: panda
git-subtree-split: 30c7ca8
Vaggysag pushed a commit to Vaggysag/openpilot that referenced this pull request Apr 21, 2020
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.

6 participants