Inventables Community Forum

Jet turbine control unit (ECU) - Arduino (Coding guidance - SORTED)

Hi.

I am using my CNC to machine a few components for my home-built jet turbine, parallell to those efforts I am looking at making a complete ECU (Engine Control Unit) to control and monitor it during ground testing.

When I started the turbine build I knew little about metal working etc and it has been a learning curve.
Ardunio / coding the same, I know little hence this new thread where I hope to get some guidance :slight_smile:
Any pointers or resources to read myself up on will be appreciated :smiley:

I currently have working code for reading and displaying temperature (EGT) and rpm (RPM) which form the base parameters to govern and control the turbine.

Video showing current state - https://www.youtube.com/watch?v=mfhCjIX6s7E
Build log for the turbine - HalAir Projects Log / Diary

I will update this thread with the Arduino code later today so those who are interested and curious can have a look.

My intention, in more or less prioritized order, is:

  • EGT / RPM / Throttle% values showing on the LCD
  • Potmeter to act as throttle control (emulating a servo) providing PWM signal to fuel pump (DC)

Turbine build status:

ECU mock-up code, current iteration look different but read/display real-time data:

1 Like

Arduino code, operational but not optimal :wink:

// Setup LCD
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 7, d5 = 6, d6 = 5, d7 = 4;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// Setup temperature sensor MAX6675 and Pin 8,9,10
#include “max6675.h”
int ktcSO = 8;
int ktcCS = 9;
int ktcCLK = 10;
MAX6675 ktc(ktcCLK, ktcCS, ktcSO);

// Setup of RPM sensing using Hall sensor U1881 and a 10k resistor
volatile byte half_revolutions;
unsigned int rpm;
unsigned long timeold;

// RPM
void rpm_fun()
{
half_revolutions++;

}
void magnet_detect()//This function is called whenever a magnet/interrupt is detected by the arduino
{
half_revolutions++;
}

void setup() {
Serial.begin(115200);
attachInterrupt(0, magnet_detect, RISING); //Initialize the intterrupt pin (Arduino digital pin 2);
half_revolutions = 0;
rpm = 0;
timeold = 0;
lcd.clear();
lcd.begin(16, 2);
}

void loop()
{
rpm = 30*1000/(millis() - timeold)2half_revolutions;
timeold = millis();
half_revolutions = 0;
lcd.setCursor(0, 1);
lcd.print(“EGT”);
lcd.setCursor(4, 1);
lcd.print(ktc.readCelsius(), 0); // 0 = No decimal points.
lcd.setCursor(0, 0);
lcd.print(“RPM”);
lcd.setCursor(4, 0);
lcd.print(rpm);
delay(250);
lcd.clear();
}

One thing you need to do is to detach the interrupt while doing calculations and then attaching them again. See the code here
http://engineerexperiences.com/tachometer-using-arduino.html.

Some more involved code using timers for rpm counting, which is just frequency counting is here
http://www.gammon.com.au/forum/?id=11504

Also, with this sort of code avoid using delay(). Something like this is better
if(millis() > timeold)
{
do stuff…
}
is better.

Also, one thing to be aware of when you are adding servo code is the possibility of interrupt conflicts between the servo and the rpm counter.

Have fun, is your turbine sounding like the wail of a thousand damned souls being dragged down to hell yet? :grinning:

Thanks for the reply :slight_smile:
I will look into that!

Last night (1am) I managed, with the help from Arduino forums, to dial in my code, both making it more efficient and also performing like I hoped for :slight_smile:

I hope not, turbines are loud but far from as loud as the pulsejets of the 40-80’s !! :slight_smile:

1 Like

Hello,
did you improve this project during 2019? Do you know the maximum RPM measurable by the hall effect sensor? Do the blade of the compressor is in aluminim?
I’m interested by your arduino ECU since i’m making a homemade turbojet

No I havent spent time that project this winter due to shifting priorities :slight_smile:
Its currently boxed up and waiting for re-newed interest. I started that path with a long time line and primarely for winter time as most of the warmer months I spend my time soaring fullsize gliders :slight_smile: Own an LS6a ship.

1 Like