Pages: [1] 2
Author Topic: Custom C167 Boost PID  (Read 25194 times)
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« on: March 14, 2021, 10:10:17 AM »

Since I will never need this anymore, I will throw this out here.
The main routine needs to run in a 20ms-100ms loop.

The PID has pre-control, D-kick suppression, anti windup, steady state and dynamic modes as well as an on/off window. It also has an application mode to force DC based on RPM.
I wrote it in assembler from scratch more than 5 years ago.

The GitHub repo contains the assembly code, and a sample implementation on a VR5 file. Including re-configuring the inlet manifold flaps switch output into a N75 PWM output.
I used the Keil assembler to assemble the code.

The controller works off of pssol_w as the setpoint and ps_w as the measurement. Whether from MAF or from SD calculation, both work equally well.
It can be used to add real boost control to things like VR5 and VR6 engines.

Do not ask me to implement it in your file unless you are ready to pay 4 digits.
If you have any questions, post them here.
I would rate the difficulty of integrating this as "advanced". If you do not have a good grip on assembler and C167, just move along, nothing to see here.

GitHub repo:
https://github.com/prj/C167BoostControl
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
RBPE
Sr. Member
****

Karma: +40/-5
Offline Offline

Posts: 395



« Reply #1 on: March 14, 2021, 01:05:23 PM »

Nice!
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #2 on: March 14, 2021, 04:17:02 PM »

Yes, now put it to use Smiley

I need to release a lot more stuff I've been sitting on, since it has no monetary value for me anymore...
If I only had the time.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
sda2
Full Member
***

Karma: +23/-1
Offline Offline

Posts: 76


« Reply #3 on: March 24, 2021, 03:29:50 AM »

Thank you very much for this piece of code! We will see how good this works in a non Bosch ECU Smiley

Attached you'll find an XDF made from the CSV you provided.
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #4 on: March 24, 2021, 04:46:36 AM »

It does not care very much about ECU in particular.
But you of course must provide your own actual pressure and target (pressure) and do some modifications.

You will need to patch in a "ldrxn" style map somewhere into the ECU.
And you will need to find how to configure the end stage for the correct frequency.
The biggest change is probably the fact that the map lookup routines are going to be different...
« Last Edit: March 24, 2021, 04:50:43 AM by prj » Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
dream
Full Member
***

Karma: +3/-3
Offline Offline

Posts: 92


« Reply #5 on: March 27, 2021, 03:03:22 PM »

Thank you for your contribution again Prj Smiley
« Last Edit: March 27, 2021, 03:07:24 PM by dream » Logged
jibberjive
Hero Member
*****

Karma: +23/-2
Offline Offline

Posts: 536


« Reply #6 on: April 04, 2021, 02:05:18 AM »

Very cool.
Logged
jochen_145
Full Member
***

Karma: +9/-4
Offline Offline

Posts: 177


« Reply #7 on: April 04, 2021, 04:41:18 AM »

Great stuff, thanks for sharing  Cool

btw.:
does someone got a A2L, Damos o.i. for 066906032A of prj´s example ?
« Last Edit: April 04, 2021, 06:42:12 AM by jochen_145 » Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #8 on: April 06, 2021, 12:24:02 PM »

I certainly did not when I made it... NA->Turbo, no damos, no problem Cheesy

I looked and I don't think I do even now.
But really, it should not be so hard to adapt the code. If you have a question about what is what in the binary, I can answer.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
jochen_145
Full Member
***

Karma: +9/-4
Offline Offline

Posts: 177


« Reply #9 on: April 06, 2021, 12:42:37 PM »

Thanks,
I do not plan to start sutch a project, but someone in a german TT-forum got the idee to build an 5-cylinder-turbo TT "RS" 8N based on the VR5..

So I´d like to search a little in the dump and playing around to extend the dump run with a proper and linear torque-model. Even chancing MDNORM to a proper value have effect to a lot maps, as you know..

I am too mutch OEM infected to run bended maps and start without the A2L meanwhile  Lips sealed
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #10 on: April 07, 2021, 02:01:12 AM »

Well that's what I did this for 5 or 6 years ago, a Golf mk2 IIRC with a VR5 engine and they managed to make a flange to fit a RS3 turbo on it with the manifold.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1282



« Reply #11 on: April 14, 2021, 01:41:08 PM »

Right well to bump this , I would be interested in giving this a go on a non turbo ecu before switching over to 1.8t ( yes still haven't done that, no time + thanks 'rona), however I dont think i possess enough asm skills to pull this off specially without a2l.. eh regardless I got some questions.

there are some CC 00's - the native writes ( I guess) which you mentioned to pw1 that are changed at 702B6-702496  how did you find these exactly, how would one find these in a completely different bin for example, dont seem to find much on this topic.
Just ref from PW1 (FE32) ? but still who knows how many hits that produces

6432E+ - 2 things changed (cmp r8/ mov r4) these are the hard caps I assume.

Also, there are 2 calls after eachother at 2030A (unless I misunderstand), one goes to 8c57e which "just" seems like a normal part of the bin - what is the reason behind this, the second one goes to the boostcontrol function.


Do you by any chance have the idb for the example file even without damos I guess you defined it quite extensively , would that be something that you would share?
Logged
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1282



« Reply #12 on: April 18, 2021, 06:44:15 PM »


Well figured it out.. I was actually dumb and completely forgot about the hookin, the first calls actually calls the normal function that was replaced  by the call to run the custom PID routine...

The writes to Port 7 bit 1(PW1) have to be disabled for this to work , there are bmov's from B_su (intake changeover on these cars) , like mentioned N75 output is used for the changover valve, nop these.
Rlsol hardcap was adjusted on the example file, also dont forget about the calls to the load by gear (last part of the custom code) where rlssol gets assigned.

That said I will probably attempt this on my own car if I ever get the downtime for it, then get back with feedback hopefully.

Thanks.
Logged
Pr3muToS
Full Member
***

Karma: +1/-5
Offline Offline

Posts: 69


« Reply #13 on: April 01, 2023, 06:07:35 PM »

@pjr did you ever did some like this on st10 ?!
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #14 on: April 02, 2023, 03:57:17 AM »

@pjr did you ever did some like this on st10 ?!
What do you mean? This can be used on ST10 as well, it makes no difference.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.04 seconds with 17 queries. (Pretty URLs adds 0.004s, 0q)