VNT LDA Controller
This software is designed to let you build yourself a VNT controller using an Arduino. At a minimum you can run this with just a pressure sensor or just a TPS sensor plus an RPM signal, though for actual closed loop control you need all three. The software will also work with an EGT sensor and can control a second solenoid / device - this can be used to reduce the pressure seen by the LDA when you hit high EGTs thereby reducing fuel, or it could be used to control a water/methanol injector or really do anything you might be able to think of.
The included board design is intended to be used with Freescale MPX-series pressure sensors. Depending on what you want to do you can use either absolute or relative / gauge pressure sensors. Modern vehicle controls almost universally use absolute pressure sensors - this results in higher gauge pressure numbers at high altitudes providing consistent performance, however that assumes the ECU is controlling other things like fueling too. I personally have used relative pressure sensors - they will read '0' when off boost just like a traditional boost gauge would. This is also how wastegate turbos work. Given that you are building your own controller I'm guessing you aren't trying to comply with strict emissions control regulations so you'll probably find the relative sensors work just fine, plus you'll probably enjoy having all the potential power your vehicle could have at lower altitudes.
Here are some example sensors:
MPX4250DP - 2 port sensor (leave the bottom port open) - max pressure 36 PSI MPX5500DP - 2 port sensor (leave the bottom port open) - max pressure 72 PSI
Use the lowest value sensor that will meet your needs - don't be tempted to just go for the "biggest" you can get as the larger the range of the sensor the lower its resolution. I have used the MPX4250DP for my boost measurements and the MPX5500DP for my EMP measurements.
You need "something" that will provide varying resistance as the accelerator pedal moves. If you are using this with a Bosch VE/VP style pump there are a few options available. Some Dodge trucks with Cummins engines and automatic transmissions have a TPS sensor mounted to the pump already - if you control the automatic transmission some other way (like a knob on the dash) then you can use the TPS for this controller. There are also Land Rover 300 TDI pumps that came with a Bosch TPS to control their EGR system - these should bolt on to most other VE pumps as well. If you have a 300 TDI with the EGR otherwise removed then you are already most of the way there! If you have a different style pump then you are on your own - I recommend finding a "cheap" TPS at a parts store that you think you can work with as that way getting replacement parts will be easy. The Land Rover TPS is frigging expensive to buy new!
The project I based this off of was designed to work with a Honeywell GT101DC. I used the factory crank position sensor on my VW AHU TDI, this required me to add an extra IC to work with magnetic reluctance sensors. You can re-use the board design with the Honeywell sensor just by not installing a few components, namely the TI IC and its associated resistors. Then the Honeywell wire can be connected to the appropriate hole on the board, probably.
I initially used the readily avaiable GM 3-port boost control solenoids - AC Delco part number 214-474. They seem to work fine though they are a bit noisy - take care where you mount them (ie don't screw them to the firewall as the noise will drive you nuts). I have since moved to a VW-style "N75" valve from a Mk4 TDI; these valves are much quieter.
The system can stream live data via the serial port for logging purposes. Press the '#' key while connected via serial and the system will start streaming data in this format:
mapCorrected,vntTargetPressure,vntPositionRemapped,tpsCorrected,rpmActual,pidOutput,n75precontrol,vntMinDc,vntMaxDc,mode,targetRatioKp,targetRatioKi,targetRatioKd,boostCalculatedP,boostCalculatedI,boostCalculatedD,temp1,auxOutput,millis( / 10)
The output data can be captured with a tool like 'screen' and logged to disk. It can then be opened directly in a spreadsheet program like LibreOffice or Excel for graphing purposes.
Patches and updates very welcome! The code is currently "good enough" for to get things done; many improvements could be made. Assistance reducing memory usage, implementing the missing EMP stuff, etc would be well received.
The header for the MAX31855 amplifier board really should be flipped the other way around - I made a mistake on the board layout. This can be overcome by soldering the header and terminals to the opposite side of the MAX31855 board from normal. Everthing works fine this way.
This program expects to see an Adafruit RGB serial LCD backpack. It also expects the serial LCD backpack to have been configured for 115200 baud already - the display will appear corrupted if the baud rate of the LCD does not match the program rate. While I have tested successfully at 9600 baud (the Adafruit default) by far the longest running part of the program is the actual LCD update routine - while the VNT control stuff takes only a couple of ms (even with lots of float divisions!) the LCD update takes about 26-28ms at 9600 baud. It takes only 2ms at 115200 so your controller will be much happier with the faster rate. Remember it cannot calculate anything while it's writing to the LCD!
To set the baud rate on a fresh serial backpack plug it in via USB. USB doesn't make use of the baud rate so you can set it up no matter what the current settings are. Issue the following commands:
The baud rate setting is stored on the LCD's EEPROM and will be briefly displayed at startup allowing you to verify the setting was saved successfully.