|
Post by turboron on Jan 15, 2021 8:01:44 GMT -5
Scott, can you share the details of the problems you experienced with your thermocouple measurements? Also, details on the new approach are of interest.
I have been trying to set up a Arduino/MAX6675 system to measure EGT without success to this point. The thermocouple reads room temperature correctly at startup. However, when I heat the thermocouple the measurement is no where near the correct value. I am adding pinModes for the three data pins as follows:
pinMode(egt_soPin, OUTPUT); pinMode(egt_csPin, INPUT); pinMode(egt_sckPin, OUTPUT);
Hopefully, this will fix the problem.
Thanks, Ron
|
|
|
Post by slittlewing on Jan 15, 2021 14:39:40 GMT -5
Hi Ron, Of course. The first problem I experienced with the MAX6675 was similar to yours, and it turned out to be that the MAX6675 does not like to be "read" or polled very quickly. According to the datasheet: datasheets.maximintegrated.com/en/ds/MAX6675.pdfConversion time is a maximum of 0.22s. Therefore you should not read the temperature more often than this or it doesn't work, I now read it every 400ms. I have snipped and commented some bits of my quite long overall ECU code below: At the very top of the code before the setup section, I declare variables like so: #include <max6675.h> //Library for MAX6675 Thermocouple Reader const int TOTSO = 43; //TOT MAX6675 PIN NUMBERS for my Arduino mega const int TOTCS = 45; const int TOTCLK = 47; const int TOTVCC = 49; const int TOTGND = 51; double TOTRaw = 0.0; // this will be the temperature long tLastTCRead = 0; // this is milliseconds counted from arduino being turned on, of last read of MAX6675 MAX6675 ktc2(TOTCLK, TOTCS, TOTSO); //creates MAX6675 object to poll Then in void setup() { pinMode(TOTVCC, OUTPUT); pinMode(TOTGND, OUTPUT); digitalWrite(TOTVCC, HIGH); //power to VCC pin of MAX6675 digitalWrite(TOTGND, LOW); //ground to GND pin of MAX6675 } Then in void loop() { if (millis() > (tLastTCRead + 400)) { //if more than 400ms since last read of thermocouple TOTRaw = ktc2.readCelsius(); //read TOT tLastTCRead = millis(); //set last read time to current milliseconds } } Hope that helps. The second problem I had was that the EMC from my spark units upset the SPI communication and sometimes it never recovered meaning I was running the engine with no TOT or Oil temp. I tried numerous things like automatically powering the MAX6675 off and on again if the reading was 0 degrees, but it didn't work. Going forwards I am going to try using an AD8495 which is 0-5V for 0-1000degC. www.ebay.co.uk/itm/AD8495-K-Type-Thermocouple-Amplifier-Module-Analog-Output-Armz-Thermal-AD849X/332691343909?hash=item4d75f30a25:g:ofgAAOSwWfdbKRw8Obviously signal connected to an analog input pin instead of digital pins. No problems with read speed and hopefully more resistant to electrical noise Cheers Scott
|
|
|
Post by turboron on Jan 15, 2021 17:40:19 GMT -5
Scott, thanks.
Thanks again, Ron
|
|
Toni
Member
Joined: December 2020
Posts: 26
|
Post by Toni on Jan 19, 2021 10:22:44 GMT -5
Hi Scott
Did you test 17,5 gph nozzle already?
Best regards Toni
|
|
|
Post by slittlewing on Jan 19, 2021 16:28:24 GMT -5
Hi Toni,
Not yet, it will be a couple more months before I can fire up the engine.
Cheers Scott
|
|
|
Post by slittlewing on Jan 21, 2021 17:12:25 GMT -5
Well I finished the assembly of ECU version 2. I have tested the new high side drives and thermocouple readers and all looks to be working thankfully!! The ECU could drop straight in, replacing the existing but I will be relocating the relay which controls the spark units to outside of the ecu enclosure (I stupidly placed it right on top of the arduino so far) in a further attempt to reduce electrical noise. Cheers Scott
|
|
|
Post by turboron on Jan 22, 2021 10:46:04 GMT -5
Scott, in a previous post I said "I have been trying to set up a Arduino/MAX6675 system to measure EGT without success to this point. The thermocouple reads room temperature correctly at startup. However, when I heat the thermocouple the measurement is no where near the correct value. I am adding pinModes for the three data pins as follows:
pinMode(egt_soPin, OUTPUT); pinMode(egt_csPin, INPUT); pinMode(egt_sckPin, OUTPUT);"
This did not work. I changed the code to the following:
pinMode(egt_soPin, INPUT); pinMode(egt_csPin, OUTPUT); pinMode(egt_sckPin, OUTPUT);
Now I am getting good readings.
I ordered and receive an AD8495 Breakout board from Adafruit. What code are you using for this device?
Thanks, Ron
|
|
|
Post by slittlewing on Jan 22, 2021 14:37:01 GMT -5
Hi Ron,
In my experience there is no need to declare pinmodes for the SPI pins. I think the max6675 toolbox sorts that for you, as per my code in previous post:
MAX6675 ktc2(TOTCLK, TOTCS, TOTSO); //creates MAX6675 object to poll
For the AD8495, Its 0.005V/degree but I also found it has a 1.25V offset so actually it can only measure 750degC, which is still good enough for TOT! I coded very simply something like this:
const int TOTPin = A10; //analog pin number int TOTRaw = 0; // integer value of analog reading 1024 bits double TOT = 0.0; // actual temperature
void setup() { // put your setup code here, to run once: }
void loop() { TOTRaw = (analogRead(TOTPin)); // value 0 to 1023 for 0 to 5v TOT = ((TOTRaw/1024.0*5)-1.25)/0.005; //convert to voltage, subtract 1.25v and multiply by 0.005v per degree }
Cheers Scott
|
|
|
Post by turboron on Jan 22, 2021 17:50:57 GMT -5
Scott, thanks.
Thanks again, Ron
|
|
Sweetenough
Veteran Member
Joined: April 2016
Posts: 121
|
Post by Sweetenough on Jan 25, 2021 3:31:24 GMT -5
New board is looking fabulous Scott! Will it be tested on the bike?
Kind Regards Thomas
|
|
|
Post by slittlewing on Feb 1, 2021 18:02:25 GMT -5
Most certainly! On that subject.. the new ECU is now fitted. I have done function checks and everything seems to be working so far... I 3D printed a handlebar mount for the two new rotary potentiometers and have wired them in, and changed the digital dash so it displays readings for each of them. Once I get it running I intend to use one of them to adjust the idle PWM setting for the fuel pump. The other will be used for tweaking the oil pressure so I can easily increase the PWM if it’s too low. Once the idle is tweaked with the new 17.5GPH nozzle, I will change the usage of that pot, so it ca then be used to make afterburner fuelling changes. Also made a small printed box for the relays which feed the ignition units, and took the voltage supply direct from the battery instead of from the arduino power wire. This little box will now be the other side of the chunky lead acid battery (for EMC reasons). Not yet tested but hopefully this week. After nearly a month waiting, the replacement bronze gears arrived for the Marco oil pump and I changed the oil to 0W30 synthetic. Seems more controllable at the 0 degC temperatures we currently have in Uk! I bought a 240V silicone heat pad from eBay, I will try to heat the oil and map PWM vs pressure vs Temperature. Might not be able to get it that warm with only 300W though. On the last fireup at the drag strip, the bike took ages (>10sec) to start and smoked a lot, the fuelling was clearly way too rich during the initial spool up (I’m guessing draggy rotor with ruined bearings was also partly to blame). Going forwards I am going to try out a “one button press” start routine which ramps fuel pressure up to idle PWM over some seconds (maybe 3 or 4) whilst continually sparking - This is assuming the ecu is free of EMC problems. I have also built a 2kv hot spark ignition box to try. Cheers Scott
|
|
|
Post by racket on Feb 1, 2021 19:38:00 GMT -5
Hi Scott
The heat pad on my test stand gets the oil tank up to ~40C , it certainly helped with spoolups
Cheers John
|
|
|
Post by slittlewing on Feb 2, 2021 17:33:35 GMT -5
That’s half reasonable, I will have a go with the mains voltage pad next, and see what I can get out of it!
I tested the relay/spark units tonight. Pretty pleased, the new ECU didn’t show any signs of problems with EMC. I also tested the new 2kv hot spark system. I know this puts a fair voltage spike back down the 12v line because when I tested it with a battery, I could feel it in the crocodile clips as I held them onto the battery!! The 2kv system killed my cheapo Ebay voltage readout lcd immediately, but the ECU and sensors seem isolated from it. I’m glad I put a load of filtering components on the board now!
Cheers Scott
|
|
|
Post by slittlewing on Feb 5, 2021 14:03:28 GMT -5
Well I tried the Ebay heat pad with disappointing results. The aim was to get the oil circuit as hot as possible for the purpose of mapping PWM required to produce a given pressure. This will need programming into the ECU so it automatically controls the pressure correctly based on oil temp, as the oil thins during running.
The cheapo Ebay pad got way too hot and caused the silicone to smoke. It was so hot that attached to the oil tank, it burned the nice new paint job off 😡 I can’t repaint with the engine fitted so will have to vinyl wrap the damaged area. It feels like it was probably designed for US 120v Ac rather than Uk 240v
I then attached a lighting dimmer switch to run it at lower power. This stopped the pad smoking but after the oil travelled through the long circuit (pump, cooler, filter etc which were all cold) at low flow rate due to being choked by the turbo bearings, it hardly increased in temp.
So I will abandon this and try and map the oil as the engine warms up instead, once I get it running. I can control oil pump PWM on handlebar pot for now. I have also changed ECU code from dynamic oil pressure demand (P2 + 2 bar) to 2 bar during starting and 4 bar During running.
ECU has been reprogrammed to try “one button press” start and a ramp on the initial fuelling. Second handlebar pot controls idle fuel pump PWM at the moment.
The bike is ready to do static testing once again, once the UK is out of lockdown!
Cheers Scott
|
|
|
Post by racket on Feb 5, 2021 16:57:20 GMT -5
Hi Scott
My Ebay heater pad has a thermostat , following activation it heats up then "clicks" off for a few minutes, then "clicks" back on , and the process is repeated , its a 240V unit , sounds like your pad has a faulty thermostat.
Ideally my pad should have been attached under the oiltank but because the tank sits on its bottom I had to fit it to the side , but it still works OK , best not to have the pump running whilst trying to heat the oil , too many "heating surfaces" to lose heat from, once the "bulk" of lube is heated the pump can be switched on and the other parts of the circuit will heat up and the flows will increase .
Hope this helps
Cheers John
|
|