|
Post by turbochris on Aug 13, 2018 12:20:32 GMT -5
fwiw- use a teensy, not an arduino. Also- oil pump current draw is almost directly proportional to output pressure, simply control the oil pressure by monitoring the current draw
|
|
|
Post by turboron on Aug 13, 2018 13:37:09 GMT -5
Chris, thanks. I will research the teensy. I am not familiar with the tennsy. Good idea on the pump it will save the cost of a sensor.
Thanks, Ron
|
|
|
Post by turboron on Dec 29, 2018 11:18:44 GMT -5
All, I have not posted here since I have been busy testing my DIY Gas Turbine. Now that the winter is here I am getting back into my FADEC control design derived from the KU teams project. Today I learned more about LEDs that I wanted to know. To test the Oil Pump control PWM program I want to give the Arduino a voltage that would be the same as the 50 psig signal from the sensor. I calculated this to be 1.5 volts. After reading about the pros and cons of voltage dividers I decided to use a 1.5volt AA battery. No problem right. I could not get the 1.5 volt battery to light an LED. Turns out that LEDs have a minimum threshold voltage. If you want to see the details I have attached a writeup I downloaded from a Google.
Sorry, I could not get the attachment feature to work. I will try again after I post this note.
Thanks, Ron
|
|
|
Post by turboron on Jan 1, 2019 9:47:43 GMT -5
All, turbochris suggest I consider the use of a teensy board for my FADEC instead of the Arduinos. I read the writeup on Sparkfun's website. The teensy seems to have similar features to the Arduinos and the Arduino IDE can be used. My first impression is that more soldering may be required which I would like to avoid during development of the control. Any experience or comments would be appreciated.
Thanks, Ron
|
|
|
Post by turboron on Jan 3, 2019 13:57:18 GMT -5
All, tested the oil pump pwm code today. See the attached photo for the setup: Note the small dc motor on the left side of the photograph. I used it to validate the code was running correctly. The code is posted earlier in this thread. In the center, note the 1.5 volt AA battery which is used instead of the pressure sensor analog output. Pin 5 of the Arduino switches the Dual MOS FET, Pin 9 lights a LED when the code has run through a complete loop. One lesson learned is that the analog pins A0 through A5 on the Arduino board can also be called pin 14 through 19 in the code. In this case Pin 14 (A0) receives the analog voltage from the 1.5 volt AA battery. Since I could not light a LED with this low voltage I hooked up my multimeter to show the input voltage. It can be seen on the right. Thanks, Ron
|
|
|
Post by turboron on Jan 21, 2019 11:16:16 GMT -5
All, I finally got the #2 oil pump PWM pressure control working. Key lessons learned are: 1) Analog inputs are read into the Arduino as a valve between 0 to 1023 depending on the sensor output voltage. Zero volts is read 0 and 5.0 volts is read as 1023. 2) A byte data type is used to compare the analog reading to the setpoint. A byte has the valve of 0 to 255. To get the byte value to use for comparison to our setpoint we divide 1023 by 4 = 256. We could also use the Arduino map function for this transfer. 3)However, the byte value needs to be converted to a psi since the numerical values do not line up. KS, which had a different sensor, they used psi = (byte-25)/2. With my sensor it is possible to get a "close enough" valve by simply substracting 30 or psi = byte - 30. 4) For trouble shooting I added Serial.print statements to the code for the analog and byte values. The I created a monitor in the Arduino Integrated Development Environment (IDE) to read these values when the code ran. If you connect the Arduino to its ground and the analog input pin(A0) you should output zero for the analog and byte values. If you connect the 5.0 volt Arduino on board source to A0 you should read 1023 and 255 respectively for the analog and byte values. I also used a AA battery at 1.58 volts and the Arduino 3.3 volt on board source for additional values.
Thanks, Ron
|
|
|
Post by turboron on Jan 25, 2019 7:50:22 GMT -5
All, now that I have work through the PWM of oil pump #2 I am ready to start on the gas turbine's Full Authority Digital Control (FADEC). I did a survey of the KU code and found that they had 5 modes to control their unit which has a person in the loop. I prefer different termology and addtional modes (their states) of control. I prepared the pasted spreadsheet below to explain the differences. Control Mode/State Comparsion # KU # KU Remarks RP LLC # RP LLC Remarks 1 0 Idle Waiting for start. If any other state is out-of-bounds and the engine is cold 1 Ready to start Oil pump #1 on, EGT ambient 2 1 Heating Engages starter and burns propane. 2 Purge Motor with start blower, oil pump #1 on, ignition and fuel off. 3 2 Starting Step up fuel flow and starter speed by conditional milestones of starter speed. Disengage starter after speed milestone 3 Start Motor with start blower, oil pump #1 on, ignition on, fuel and start position. After ignition, step up fuel flow by conditional misestones, disengage starter after idle compressor discharge pressure is reached. Idle for 3 minutes to warm up the gas turbine. 4 3 Running Monitor for out-of-bounds conditions and respond to throttle input 4 Accel Increase fuel flow until run compressor compressor dischage pressure is reached 5 4 Cooling After fuel is shut off motor engine 5 Run Govern power turbine speed by modulating fuel flow. Monitor gasifer compressor dischage pressure for out-of-bound conditions. 6 6 Decel Reduce fuel flow until idle gasifier compressor discharge pressure is reached. 7 7 Coastdown 8 8 Stop Shut fuel valve. Motor with start blower and monitor EGT and oil temperature until acceptable values are reached. Shut down oil pumps and start blower.
Thanks, Ron
|
|
|
Post by turboron on Feb 1, 2019 7:50:46 GMT -5
All, I created the spreadsheet below to set up the different control Modes. I also identified the control Events that need to take place in each Mode. I will add the required constants, variables and Booleans for each Mode and Event before I start coding. Please flag any logic that I need to add to the spreadsheet.
Use KU code as a guide TBD - To Be Determined Mode # Constants Variables Booleans N/A Oil on 1.Key to first stop. 2. Oil pump #1 starts - see oil pressure on gage 3. Digital Control not on 1 Ready to start 1. Key to second stop 2. Pushbutton to start Digital Control 3. Verify oil pressure greater than 40 psig 4. If oil temperature less than 60 degrees F start oil heater 5. If oil temperature greater than 60 degrees F shut off oil heater 6. If oil heater is still on after TBD minutes abort Ready to start and light Stopped LED 7. Verify fuel shutoff valve closed 8. Verify EGT below 300 degrees F 9. Transfer control to Purge 2 Purge 1. Receive control from the Ready to start 2. Engage starter blower to purge fuel from combustion chamber 3. Set timer for 15 seconds 4. Disengage starter blower 5. Transfer control to Start 3 Start 1. Receive control from the Purge 2. Set fuel valve to start position 3. Turn on ignitor blower, if used 4. Turn on ignitor 5. Engage starter blower 6. If EGT is greater that TBD deg F increase fuel flow 7. If CDP is greater than 4 psig increase fuel flow, Else abort 8. If CDP is greater than 6 psig increase fuel flow, Else abort 9. If CDP is greater than 8 psig increase fuel flow, Else abort 10. If CDP is greater than Idle psig increase fuel flow disengage starter blower 11. If CDP is between Idle CDP -.5 psig and Idle +.5 psig no action required. 12. Else if less than 9.5 psig increase fuel flow 13. Else if greater than 10.5 psig decrease fuel flow 14. If timer exceeds 3 minutes transfer control to Accel 4 Accel 1. Receive control from the Start 2. Compare CDP to Accel set point 3. If CDP not at Accel setpoint increase fuel flow one step 4. Loop until CDP setpoint +/- .5% is reached 5. Compare Power Turbine rpm to set point 6. If Power Turbine rpm not at setpoint increase fuel flow one step 7. Loop until Power Turbine setpoint +/- .5% is reached 8. If oil pressure is less the 40 psig start Oil Pump #2 9. If EGT exceed TBD degrees F reduce fuel flow and light LED, Else 10. Transfer control to Run 5 Run 1. Receive control from Accel 2. Maintain Power Turbine setpoint at +/- .5% by adjusting fuel flow 3. Alarm if EGT exceeds TBD deg F 4. Transfer control to Decel if EGT exceeds TBD degree F 6 Decel 1. Receive control from the Run 2. Compare CDP to Decel setpoint 3. If CDP not at Decel setpoint decrease fuel flow one step until Idle CDP is reached 4. Transfer control to Coastdown 7 Coastdown 1. Receive control from Decel 2. Close fuel metering valve 3. Close fuel shutoff valve 4. Transfer control to Stop 8 Stop 1. Receive control from Coastdown state 2. If EGT less than TBD turn off Oil Pump #2. 3. Operator shuts off Oil Pump #1 with the keyed ignition 4. If a restart is requested it is initiated by resetting the pushbutton on/off switch
Thanks, Ron
|
|
|
Post by turboron on Feb 16, 2019 15:23:37 GMT -5
All, one coding tip that I have discovered in coding the FADEC is the use of Tabs. The Arduino Integrated Development Environment (IDE) has a Tabs feature that allows you to break up your code into convenient Tabs (segments). Create new Tabs by navigating to the right hand side pulldown menu at the top of the screen. It allows you to add or delete Tabs etc. Tabbing makes it easier move back and forth in your program to fix bugs, etc. It is a big help in a long (almost 1000 lines of code) program like the FADEC.
Thanks, Ron
|
|
monty
Senior Member
Currently being spanked by mother nature.......
Joined: September 2018
Posts: 400
|
Post by monty on Feb 16, 2019 18:00:08 GMT -5
Ron,
I'm watching this space carefully....I'm going to need a FADEC eventually.
Monty
|
|
|
Post by turboron on Feb 16, 2019 19:27:11 GMT -5
Monty, thanks. I need all the encouragement I can get to finish this task.
Thanks again, Ron
|
|
CH3NO2
Senior Member
Joined: March 2017
Posts: 455
|
Post by CH3NO2 on Feb 16, 2019 20:29:15 GMT -5
Great work Ron. Its very apparent you are putting a lot of time and thought into this development work.
Tony
|
|
|
Post by turboron on Feb 17, 2019 8:29:08 GMT -5
Tony, thanks. It is like a giant puzzle.
Thanks again, Ron
|
|
|
Post by turboron on Feb 22, 2019 8:17:28 GMT -5
All, I will post tips from time to time based on my Arduino experience.
One troubleshooting/programing tip I want to share is the use of the Serial Monitor.
When creating an Arduino program the steps are as follows:
1. Cable the Arduino mini-USB port to your computer's USB port. 2. Open the Intergraded Development Environment (IDE). 3. Write and save your code. 4. Verify your code (compile) and fix bugs until the IDE says "Done compiling". 5. Upload your code to the Arduino firmware. The IDE will say "Done uploading". 6. Check to see if your code lights the LEDs etc. on your control as desired.
Note that even though the code compiles and uploads without problems it does NOT mean it will perform the tasks you want the control to achieve.
This is where the Serial Monitor saves the day. While in the IDE after you upload the code to the Arduino go to the Tools pull down tab of the IDE. In the Tools tab select Serial Monitor. Note that the code is looping continuously as long as the Arduino has power. Add Serial.print("Enter Loop"); and delay(500); etc. statements through out your code as necessary to make sure the code is progressing through the functions you have coded. Now as the code runs the Serial Monitor will show you where the code is hanging up.
One last tip is don't code on your wife's birthday.
Thanks, Ron
|
|
|
Post by turboron on Mar 27, 2019 9:35:38 GMT -5
All, I working my way through the Kansas State code I have found it helpful to create examples of the coding they have used to accomplish control of the DIY gas turbine. I share them here for your review.
March 24, 2019
Code Example #1
Analog Read Write
The following example sets forth an Arduino C pseudocode example to read and adjust an analog parameter:
1. #define statements:
a. A digital output pin that lights a Light Emitting Diode (LED) to announce (light) that the parameter is in an acceptable range.
b. An analog out pin that adjust the parameter.
c. An analog in pin that reads the current parameter.
d. A digital pin is set true or false whether or not the parameter is in an acceptable range (okay).
2. Identify data types
a. A Boolean (true or false) to indicate if the parameter is within an acceptable range (okay). Associated with pin 1.a.
b. An integer (int) data type to store the parameter of interest
c. A byte to which is assigned a modified 2.b sensor valve
d. An integer (int) nominal value (set point) of the parameter.
e. An integer (int) to establish the upper bound for the parameter.
f. An integer (int) to establish the lower bound for the parameter.
g. An integer (int) to establish the maximum desired value for the parameter.
h. An integer (int) to establish the minimum desired value for the parameter.
3. Within setup
a. Open a serial port so you can see the code run.
b. Delay (500) so the output does not scroll so fast you cannot see it.
4. Within loop
a. Analog read the parameter from the sensor input pin (1.c) and divide by 4 to convert the value from the sensor value (0 to 1023) to a byte value (0 to 255). This equivalent of 0.0 to 5.0 volts on the Arduino.
b. Scale the 4.a reading to parameter being used. For example, if you are using a 0-150 psi pressure sensor its full voltage reading will be 1023 or 5.0 volts. If you are interested in only the 0-50 range you would scale the parameter for use in reporting to the world via the serial monitor etc.
c. Assign that value to the byte (2.c) above.
d. Serial write the byte to the monitor.
e. Create an If statement to check if the byte is outside the minimum (2.g) and maximum (2.h) limits.
f. If it is outside the limits set the digital pin 1.d false.
g. If it is within the limits set the digital pin 1.d true and set (light) the LED pin 1.a true.
h. Create another If statement to take corrective action by incrementing the parameter value higher or lower if the upper or lower bound is exceeded.
i. Digital write the digital pin 1.s true and set (light) the LED pin 1.a true (What does this accomplish?).
j. Analog Write to new valve to the Pulse Width Modulated (PWM) motor or valve.
March 26, 2019
Code Example #2
Start Timers
The following example sets forth an Arduino C pseudocode example to create a series of start timers to use in starting a microturbine:
1. #define statements:
a. Define a fuelpwmout_pin to Pulse Width Modulate (PWM) a fuel control motor or valve with an analog write statement
b. Define a compressor discharge pressure (cdp) pin to capture an analog read of the cdp pressure sensor.
c. Define an microturbine start blower solenoid pin
d. Define a throttle_pin to take a throttle analog input from a potentiometer(Not used at present).
2. Identify data types
a. Unsigned long starttimer variable for timing start sequence
3. Within setup
a. Open a serial port so you can see the code run.
b. Delay (500) so the output does not scroll so fast you cannot see it.
c. Set the fuelpwmout_pin as OUTPUT.
4. Within loop
a. Initialize the starttimer by assigning it the millis(); function.
b. Create a While function to control the start. The while function loops while oil pressure is true and estop is true.
c. Create an If statement in the while function to compare millis() to the minimum starttime value. Analog write to the fuelpwmout_pin to open the fuel valve to the desired start fuel flow.
d. In the if statement accomplish the following:
i. Start the ignition blower
ii. Start the ignitor
iii. Start the start blower
iv. Open the fuel shutoff value
v. Analog read the Exhaust Gas Temperature (EGT) value and the Compressor Discharge Pressure (CDP)
e. Create an Else If statement that millis() has exceeded the minimum starttimer value and is less than the maximum startimer value. If it if the value is between the two values do the following:
i. Compare the measured EGT to the start limit and the CDP value to the desired value.
ii. If the EGT and CDP values are acceptable increase the fuel flow by analog writing an increased fuel flow to the pwm pin.
iii. If not close the fuel shut off valve.
f. Repeat the Else If statements until CDP are at the approximately 5 psig and the EGT is less or equal to the maximum allowable Idle EGT. If so do the following:
i. Turn off the start blower
ii. Check to see if the CDP stays above 4 psig and the EGT is not less than the previous EGT.
iii. If so turn off the Ignition Blower and the Igniter.
iv. If not turn off the fuel shutoff valve
g. Repeat the Else If statements until CDP are at the desired 10 psig and the EGT is less or equal to the maximum allowable Idle EGT.
Transfer control to Idle.
|
|