htevo80
Member
Joined: November 2018
Posts: 36
|
Post by htevo80 on Dec 15, 2019 20:29:43 GMT -5
That display is looking really nice. Good choice on it. it's the same one I use and it's given me no problems. Visibility in sunlight is the only thing that's left to be desired. And good luck on PID tuning it took me awhile to get it dialed in but well worth it -Gavin
|
|
|
Post by slittlewing on Dec 16, 2019 8:28:49 GMT -5
Thanks Chaps, its turned out as I wanted it to! The nextion display definately simplify things on the dash front (well worth the money compared to a standard TFT in my view) I have done some initial PID tuning with simulated pressure signals (on potentiometers) and looked at the PWM response via Serial, but I think its time to proceed to tuning on the bike. I intend to play a square wave demand into each input (i.e. fuel pressure demand square wave from 2 to 4 bar every 5 seconds) and then adjust based on the response. Once all is looking good hopefully I can try engine start!
There is a video below of the engine start sequence (glow plug on = red led, oil pump is expected to fire up to 2 bar, then after 10 seconds glowplug heating the blue led comes on to request scuba air, then once boost is >0.5bar Fuel demand is set to 2bar, then the TOT thermocouple is checked for a rise in temperature, then engine is running). Fog and Afterburn functions are also shown.
Ron - I will find a way of hosting/attaching the arduino sketch file once it is fully finished and commented,
Cheers
Scott
|
|
|
Post by turboron on Dec 16, 2019 10:30:52 GMT -5
Scott, thanks. Did you note that the Kansas State team did not use PID control? They achieved satisfactory operation with just PWM etc. Are you using the Arduino library algorithms for your PID?
Thanks, Ron
|
|
|
Post by slittlewing on Dec 16, 2019 18:17:29 GMT -5
Hi Ron,
To be honest I imagine the fuel system will not need PID control, because a given PWM will result in a given pressure. I may end up just doing open loop for those (although PI would give faster response). However as the oil system pressure vs pump voltage will vary with temperature (oil viscosity) PI control makes sense for that. Also for the radiator fans rather than just being on or off.
A workmate also mentioned the possibility of using a feed forward control (i.e. the open loop PWM value) and then adding a softer PID control on top which would make minor adjustments. With all these possibilities, I am looking forward to “playing around” with it and learning/seeing what works. As you know it’s easy to change the code and upload it in a few seconds!
I will upload a “state flow” diagram to show how the ECU works at the moment. I am planning on setting the afterburner fuel pressure relative to P2 pressure (via a gain, to be determined).
Cheers
Scott
|
|
|
Post by slittlewing on Dec 18, 2019 16:51:59 GMT -5
As promised please find the state flow diagram below for the ECU. Each label in the left column of the table is a separate function that can be called in the code. Cheers Scott
|
|
|
Post by turboron on Dec 18, 2019 18:07:10 GMT -5
Scott, I did not have much luck removing turbines or silver soldering until I discovered the Twin Torch. It has two nozzles results in double the heat input of a single torch. A blow torch probably is too little heat input. I use Mapp gas or a camper propane bottle.
Thanks, Ron
|
|
|
Post by slittlewing on Dec 22, 2019 7:07:52 GMT -5
So the last couple of days I spent "mapping" the PWM response of the pumps vs the Pressure achieved. I have 5V pressure sensors after the fuel filters, just before the Main injector and afterburner ring. I am using a Sytec 044 for the Main injector and a cheap copy for the Afterburner. Using the Arduino I created a slow triangular PWM ramp, with a hold at 100%. I passed the PWM amount (0->255) and fuel pressure reading to the laptop via Serial and logged it with free software. It turned out that the pressure signals were quite noisy so I applied an Exponential Moving Average Filter to get smoother values. Process and results are as follows: [/a]
Next is to do the same for the oil system (Waiting on 10W60 Oil) Then I will use the above formulas and play a square wave pressure demand through each circuit in turn. I can then assess whether using an open loop PWM value (from above charts) is sufficient or whether PID control is also needed. The Afterburner had a pretty ridiculous flow rate, so I may need to add a needle valve or restrictor to it! Now I know I cannot achieve more than 8 bar for the fuel injector and 2 bar (without restrictor at least) for the AB, I may select lower range pressure sensors that give more resolution (currently got a 15 bar sensor on the Main Fuel and a 10bar on AB) Cheers Scott
|
|
|
Post by turboron on Dec 22, 2019 14:48:06 GMT -5
Scott, are you using an oscilloscope to display the data? What is the free software you are using?
Thanks, Ron
|
|
|
Post by slittlewing on Dec 23, 2019 2:05:24 GMT -5
|
|
|
Post by slittlewing on Dec 28, 2019 14:07:04 GMT -5
Another small update.. I have had the last week off work and managed to get down to the garage occasionally around the usual Family Xmas stuff! I have destroyed many electrical components about 7 Mosfets + some diodes - but that's learning! I have now found a great "logic level" driven Mosfet that can supply ~35A continuously at 12v, and isn't even getting warm driving the pumps. Using this, I can get 10bar from the 044 fuel pump (now realise the old mosfet was rated at 8A). The flyback diode I am currently using is rated to 20A and is getting hot so needs upgrading to a 40A one. After characterising the oil pump and fuel pump circuits as per previous post, and electrical failures sorted, I have been able to conduct trials with PID Control. I rigged up the Arduino to do "Open Loop" Control based on the PWM vs Pressure curves, then added PI Control on top. I control the "Kp" and "Ki" terms with variable resistors and a screwdriver so I can tune them on the fly. Tuning the fuel system took many many refills of kerosene (into a bucket and then pour back into the fuel tank) with alot spilled on the garage floor!! On the Fuel side, here is a plot without PID Control (square wave input). Red is demand pressure, green is actual: And here a random square wave with PID control "tuned": Of course in reality the pressure demand will be from the throttle potentiometer, and I will filter the signal (so its smooth, and to prevent flameout on throttle off). Therefore the above "square wave" demand is giving the system a much harder time than it should ever see. For Oil Pressure, the demand will be P2 Pressure + 1 bar (or maybe 2 to begin with). I therefore played a "filtered" square wave demand to it to represent something more akin to P2 Pressure (also the pump is big and might have killed my 20A diode). Here it is without PID: And here with PID: I will need to introduce a temperature compensation as the oil viscosity (and therefore PWM amount) will change massively with temp. I intend to calculate this based on an oil viscosity-temp curve I have, but cannot test until I run the engine and get the oil hot. I will leave the afterburner PID stuff until I have a restrictor in the line - at the moment it flows too much at very low pressures and would be hard to control. Hopefully I will make a 6AN fitting soon with a drilling. At the moment I have about 7x 1mm holes in the AB Ring = 5.5mm^2 area which gives ~2 bar max. If I make a single restrictor drilling of 1.7mm diameter, I should get 5bar from the pump which is its rated maximum. I expect to use the same Kp and Ki gains as for the main fuel pump, as both are similar. Cheers Scott
|
|
|
Post by slittlewing on Jan 5, 2020 15:05:14 GMT -5
The past week or so I have been designing the PCB for the "ECU". I have hopefully designed it so that the Arduino just sits directly onto header pins and connects correctly to everything. In terms of software, I first tried using "Autodesk EAGLE" but this ended up being a dead end (PCB area limited to tiny 80x100mm). So I repeated the process using software called kicad which is free. PCB looks something like this at the moment: Before I send it for manufacture, I will test its new MOSFET circuit which is based on a "P Channel" Mosfet. This means I will PWM control all the pumps with positive voltage (high side drive - all pumps will be permanently connected to earth). I realise there had been some problems before with people using Chinese PWM circuits that do the modulation on the earth side of the pump (i.e. a low side drive). I also included 7 trimmer pots on the board in case I want to tune the PI controllers or other functions. Cheers, Scott
|
|
|
Post by slittlewing on Jan 11, 2020 9:14:27 GMT -5
Since the last update, I tested the "P Channel" Mosfet circuit which is replicated on my PCB design. It worked nicely and nothing blew up, so I pushed the button on PCB manufacture - now waiting for arrival from China! For the 044 Fuel pumps I am using a single Mosfet (~35A) and diode (40A). For the oil pump I will double up giving me ~70A (hopefully leading to cooler running of the components, as they were a bit toasty when running the oil pump with just one of each). I also made a 6AN restrictor for the afterburner. Previously the afterburner pump was running at only ~1.8bar at 100%PWM, and the flow was way too high. As I don't have space for a needle valve, my first guess for restrictor size was 1.5mm. This was annoyingly too big, leading to max pressure of just 2.4bar. I had it welded up again, and slowly increased the size of the hole from 0.7mm upwards. The golden number ended up being 1.2mm hole, giving 5.8bar at 100% PWM. My pressure sensor tops out at 6bar so this is optimal at the moment. This is all a bit of guesswork though.. If the AB flow still seems too high when I get running, I will need to go for a smaller hole and a 10 bar pressure sensor. I have today completed PID testing on the AB with similar method as before (First mapped pressure vs PWM %, then added PID on top):
[/a]
Hopefully that's all the "charaterising" done, next step.. build PCB and wire the bike!
|
|
|
Post by slittlewing on Jan 20, 2020 8:18:43 GMT -5
Finally my PCB arrived from overseas!! Fingers crossed I didn’t make any mistakes on the design, as there are about £60 worth components to solder on. I had a few extra boards made in the batch, so if it works I can sell them to other forum members. Essentially it’s a big break out board that an Arduino Mega plugs onto. It uses 12v supply and has 5v converter, spare serial connection (for dash), thermocouple inputs x2, high current PWM drives x4, analog inputs x5, plus a few digital in or outputs (for relays, led etc) Cheers Scott
|
|
|
Post by turboron on Jan 20, 2020 8:48:55 GMT -5
Scott, I like your PCB design better than the KU approach. In other words, you treat the Mega as a plug in component where as KU just used the computer IC from the Mega. I think this is a much more feasible and practical approach for our DIY community. Please post the PCB build as you add versus components.
Thanks, Ron
|
|
Deleted
Joined: January 1970
Posts: 0
|
Post by Deleted on Jan 21, 2020 0:48:00 GMT -5
Finally my PCB arrived from overseas!! Fingers crossed I didn’t make any mistakes on the design, as there are about £60 worth components to solder on. I had a few extra boards made in the batch, so if it works I can sell them to other forum members. Essentially it’s a big break out board that an Arduino Mega plugs onto. It uses 12v supply and has 5v converter, spare serial connection (for dash), thermocouple inputs x2, high current PWM drives x4, analog inputs x5, plus a few digital in or outputs (for relays, led etc) Cheers Scott Hi Scott im following this with great interest will there be any kind of data logging? i have heard that the arduino can get quite 'bogged down' when asked to do too many things i suppose it will depend on how fancy you want it keep up the good work! cheers Chris
|
|