Jet Turbine Ground Unit - Project Management and guidance

Hi :slight_smile:

Background:
I am currently building a turbine for model aircraft, this is a long term project that hopefully will be completed this year.

My primary goal is to make a working turbine and simply learn stuff! Flight operations are secondary as I have been out of the R/C world for some time now due other hobbies.

I do also want to DIY the electronic side of operating the turbine, based off an Arduino UNO.

I am very new with Arduino and coding, so my knowledge is very low. I don't expect you to do the coding but if you are willing to assist my endeavour I´ll appreciate it a lot. I will try to make my questions as specific as possible.

The controller (EGU, Engine Ground Unit) need to monitor and display the following:
1 - Throttle position (servo emulation, using a pot so it can be operated without R/C radio)
2 - RPM sensing and display value (Hall effect sensor, US1881 used) Sensor range <120.000rpm
3 - Exhaust Gas temperature(EGT), K-value thermocouple with MAX6675 on hand. (Ambient-1100degC range)

What I have achieved, modular (code attached for each module):
1 - RPM sensor and code working (require Digital pin2 which is occupied by LCD)
2 - Write to LCD (4bit setup, static text, no real-time data)
EGT lacking at the moment.

First goal is to individually have LCD/RPM/EGT/ServoPot operating.
Then I need to make a code where these are combined and displaying real-time to the LCD.

I realize the UNO is limited on digital input and I am already having a conflict in the LCD display / RPM code which both want to use Digital Pin2.

What changes should I do now to secure I have input capacity enough for the scope outlined above?

My very first LCD test, fixed values showing, no real-time data:

LCD-GR130-Modul1_OK.ino (978 Bytes)

ArduinoHallEffect.ino (795 Bytes)

I realize the UNO is limited on digital input and I am already having a conflict in the LCD display / RPM code which both want to use Digital Pin2.

Pin 2 is a an external interrupt pin. The RPM measurement probably requires an interrupt. There is nothing in the LCD software that requires an interrupt. Change one of the LCD pins. An I2C LCD may make your life easier as it takes only 2 pins and those pins can, also, be used for other I2C devices. Freeing 4 digital pins at the expense of 2 analog inputs. You can buy an I2C backpack to fit your LCD.

The MAX6675 takes the SPI pins; 13, 12 and a chip select. The pot 1 analog input. So, on an Uno, you have some pins left.

Thank you :slight_smile:

I already have a I2C LCD (16x2 and 20x4) on its way so will be able tidy up a little.

For the I2C LCDs I recommend the hd44780 library. That library will autodetect the LCD address and the I2C backpack to LCD pin mapping, making interfacing the LCD much easier. The hd44780 library is available through the IDE library manager.

I would use a second Arduino as the throttle. Use a simple analog pot as the input to that Arduino and use the Servo library for output. Then it will appear to the first one as identical to an RC receiver's throttle output.

The servo-throttle input should also use an interrupt pin, like the RPM. The UNO has only two pins with this capability.

Thank you both, I will research both aspects later. Good tip on the 2nd Arduino, I have a couple Micro´s I could use as throttle control.

I have managed to merge the LCD code with temperature after reassigning the LCD 4bit pins to 4-7 so I could use 8-10 for the MAX6675.
The initial value of the temperature do display but fail to refresh and the decimals are garbled.

  • I do not need the decimal point, how to eliminate these from displaying?
  • How to I make the temperature read-out refresh itself? I assume its a syntax detail and will research parallell to this post.
void loop()
{
  lcd.setCursor(0, 1);
  lcd.print("EGT");
  lcd.setCursor(5, 1);
  lcd.println(ktc.readCelsius());
  lcd.setCursor(8, 1);
  lcd.print("C");
  lcd.setCursor(0, 0);
  lcd.print("RPM");
  lcd.setCursor(5, 0);
  lcd.print("0");
  lcd.setCursor(13, 0);
  lcd.print("OFF");
  lcd.print(ktc.readCelsius());
}

Another thing, and a testament to my lack of coding skills, any way to tidy up the code below?
It serve no real function, just a cool start-up sequence :wink:

  lcd.clear(); 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.setCursor(1, 0);
  lcd.print("GR130 EGU v1.0");
  lcd.setCursor(1, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(2, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(3, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(4, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(5, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(6, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(7, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(8, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(9, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(10, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(11, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(12, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(13, 1);
  lcd.print(".");
  delay(300);
  lcd.setCursor(14, 1);
  lcd.print(".");
  delay(300);
  lcd.clear();
  delay(1500);
  lcd.setCursor(4, 0);
  lcd.print("STAND BY");
  delay(3000);
  lcd.clear();
}

My semi-working code in full is attached.

GSU-LCD_EGT_Test.ino (1.99 KB)

Update:

Thermocouple is now configured correctly and streaming real-time data to the LCD :slight_smile:

  • Need to figure out how to discard the two decimal points which for my intended purpose are not needed.
  • How to align text to the right when it goes from 2 to 3 digits the decimal separator don't shift position.

Current snippet of code:

{
  lcd.setCursor(0, 1);
  lcd.print("EGT");
  lcd.setCursor(5, 1);
  lcd.print(ktc.readCelsius());
  delay(250);
}

Need to figure out how to discard the two decimal points which for my intended purpose are not needed.

 lcd.print(ktc.readCelsius(), 0);

The 0 tells the print statement to print no (0) decimal points when printing a float data type.

Lovely, thank you!

My efforts for today:
Video ECU v1.0

Question:

I added the 0 to the print statement which removed the decimal points - worked just fine :slight_smile:

Issue:
When the value read ambient its two digits, when I provide flame I reach three digits real quick and also shift one digit to the right as the position is defined left oriented.

  • When the value again drop below three digits there is a 0 that remain displaying, so say the ambient is 25degC the LCD read 250. I crudely fixed that with a lcd.clear statement but needed a delay too.
    Result is screen flicker.

The loop code:

 lcd.setCursor(0, 1);
  lcd.print("EGT");
  lcd.setCursor(5, 1);
  lcd.print(ktc.readCelsius(), 0); // Show no decimals
  lcd.setCursor(0, 0);
  lcd.print("RPM");
  delay(200);
  lcd.clear();

One way to do it is to overwrite old data with spaces, move the cursor back and print new data. Don't use clear if you don't really have to. Clear is a very slow function.

 lcd.setCursor(0, 1);
  lcd.print("EGT            ");  //OVERWRITE THE REST OF THE LINE WITH SPACES
  lcd.setCursor(5, 1);
  lcd.print(ktc.readCelsius(), 0); // Show no decimals
  lcd.setCursor(0, 0);
  lcd.print("RPM");
  //delay(200);
  //lcd.clear();

Look at this thread for formatting strings.

Good info, I´ll read into that :smiley:

Quick update, last nite I managed to clean my code and rearrange it so it now dislpay EGT and RPM as intended - yay. First step achieved.

Due to the lcd.clear used in the loop, to get character cleaned, there is screen flicker I need to address.
So next will be to improve the code.

Next steps:

  • Write a servo routine to use a potmeter as throttle control
  • Have the throttle position show as a percentage
  • Using PWM output to govern fuel pump voltage (which control power (RPM)
  • Adding fail safe features like max RPM / EGT => Idle or Shutoff

Haldor:
Due to the lcd.clear used in the loop, to get character cleaned, there is screen flicker I need to address.
So next will be to improve the code.

Don't use lcd.clear except in the void setup().
Each time you go to write a value to the LCD, write spaces there first to blank just the characters you are going to update.
Tom... :slight_smile:

A for loop would help with your startup sequence:

  lcd.setCursor(1, 0);
  lcd.print("GR130 EGU v1.0");
  for(int col=1;col<=14;col++)
    {
    lcd.setCursor(col, 1);
    lcd.print(".");
    delay(300);
    }
  lcd.clear();
  delay(1500);
  lcd.setCursor(4, 0);
  lcd.print("STAND BY");

Very useful WB, I assumed there would be a fix but I havent had the chance to research that specific part yet. This is excellent information, thank you :slight_smile: