|
Post by turboron on Jan 4, 2018 14:49:53 GMT -5
marvnero, thanks for the support. I am including a lot of information so everyone can follow the control development.
Thanks again, turboron
|
|
|
Post by turboron on Jan 7, 2018 8:21:45 GMT -5
All, here is the test rig I setup to check out the pressure sensor I am going to use for the Oil Pump Arduino firmware. Note the pressure gauge. I purchased it from McMaster-Carr in Chicago, Il. I use them a lot for my DIY gas turbine fabrication. Vast inventory, fair prices and overnight delivery. Dual scale pressure gauge with steel case - 1/4" NPT male bottom connection, 2-1/2" dial, 0 to 100 psi 4000K722. $10.68 Thanks, Ron
|
|
|
Post by turboron on Jan 8, 2018 8:54:18 GMT -5
I tried to post information on my planned pressure sensor test using different Microsoft Office apps such as Word, Excel and PowerPoint without success. Any ideas on using these apps on this site? At present, I can upload photos and create Posts. Any other tools available?
Thanks, Ron
|
|
|
Post by turboron on Jan 8, 2018 9:33:06 GMT -5
Success by saving PowerPoint as a jpg. Chart shows pressure sensor pressure versus voltage for alternate sensor to one I plan to test.
|
|
Feathers
Veteran Member
Joined: August 2010
Posts: 169
|
Post by Feathers on Jan 11, 2018 13:36:07 GMT -5
I should point out that while the kart firmware is available on GitHub, I can't fully support it. It was written by several different people, and after years, it might take everyone involved some time to remember the thought process behind some of the code.
Especially in terms of specific hardware setups, much of the mapping and interpretation could be very different.
It looks like you're on the right track though!
- Feathers
|
|
|
Post by turboron on Jan 11, 2018 15:44:27 GMT -5
Feathers, your comments are inline with my many years of engineering experience. Once it works the files get thrown in a drawer until it doesn't work. You almost have to start at the beginning to get it to work again.
Thanks, Ron
|
|
|
Post by turboron on Jan 14, 2018 9:30:11 GMT -5
I have tested my Arduino and pressure sensor combination without pressure in the vessel. We expect that the pressure sensor output voltage to be approximately 0.5 volts with no pressure in the vessel. First we verify that the 9 volt battery has 9 volts with our voltmeter. The battery tested okay (not shown). Next we test the Arduino source volts to verify the 5+ voltage from the Arduino 5+ voltage supply pin. The Arduino Uno I am using came with my Arduino kit has a small breadboard as shown in the photo. I Googled the maximum current that can be sourced from the 5+ volt port. Most people think it is good for 500 milliamperes. Since the pressure sensor only draws 4.5 milliamperes we are good. I added a 1000 Ohm resistor to the test circuit which per Ohms law will limit the current draw to 5 milliamperes. The attached photo shows the measured voltage is near 5 volts. Note the barrel connector used to connect the 9 volt battery to the Arduino. My next post will share the pressure sensor zero pressure test.
|
|
|
Post by turboron on Jan 14, 2018 9:35:21 GMT -5
I left out a couple of things from my post that may be of interest. Note the small 1/2 ampere circuit breaker I included in the 5+ volt supply source. I always try to remember to protect the circuit. The alligator clips are just used to clamp the voltmeter leads to the resistor.
|
|
|
Post by turboron on Jan 14, 2018 9:37:26 GMT -5
Another left out point is that one of the grounds on the Arduino is used to complete the circuit. This is the same procedure as when the pressure sensor is in the circuit.
|
|
|
Post by turboron on Jan 15, 2018 8:20:27 GMT -5
Now I have hooked the Arduino to the pressure sensor for a zero pressure test for voltage. We are expecting around 0.5 volts based on the AEM sensor data. The photo shows the setup: As you can see we are reading 0.46 volts at zero psig gauge reading. In the next post I will pressurize the vessel and get voltages to develop the voltage versus pressure curve (straight line).
|
|
|
Post by turboron on Jan 15, 2018 10:18:30 GMT -5
|
|
|
Post by turboron on Jan 16, 2018 15:55:02 GMT -5
Sparkfun Learn and a good note on Analog to Digital Conversion (ADC). See the section on Relating ADC Value to Voltage. Now we can use the voltages obtained from our test to obtain the equivalent ADC Value. The ADC Value goes from 0 to 1023. The ADC Values from our sensor voltages is a ratio. ADC Value = 1023/5 times Analog Voltage Measured. The chart is below: In my next post I will share why I think the KU team converted this value to a byte data type in their program
|
|
|
Post by turboron on Jan 17, 2018 15:05:40 GMT -5
One of the hallmarks of the KU teams project was the use of multiple Arduino type (Atmel) microcontrollers that communicate via I2C or SPI serial protocol. The code defines the psi data type as a byte. Serial.write statements the communicate the values require a byte data type. Now we can see what the KU programmer did in his code. He or she reads a ADC valve from 0 to 1023 from the pressure sensor with a analogRead(pressurein); statement. To convert this value to a byte which is a number from 0 to 255 he or she divides the ADC value by 1023/255 = 4.01 rounded to 4 since the microcontroller prefers integer numbers. This seems to be a simple and effective approach compared to others that show up on Google. Now they what to convert this number to psi to control the pump and report the pressure with their statement psi = (pressure - 25)/2; which is a straight line similar the ADC value. For my sensor I came up with psi = (pressure -14)/2; by trial and error which is shown below: My code will now read: pressure = (analogRead(pressurein)/4); // read sensor pressure from pin xx psi = (pressure -14)/2; Serial.write(psi); // display and share sensor pressure with other devices I will discuss digital.Writes in my next post.
|
|
|
Post by turboron on Jan 18, 2018 14:57:41 GMT -5
I said I would discuss digital.Write in my last post. The reason is that the next section of KU code uses digital.Write statements to control the oilpump speed and thereby flow. First we need to discuss the boolean datatype. The code declares a boolean with the statement boolean oilok = LOW;. A boolean is commonly used to report the state of a switch because it can only have two values. The values are 0 and 1. The 0 can also be shown as false or LOW which means the pin's 0 voltage when read. The 1 can also be shown as true or HIGH which means the pin's voltage is not zero. Any non-zero integer is read as 1, true, HIGH. Remember that at the top of the code we used a #define oilcheck statement to assign a pin to indicate whether or not the oil pressure is ok. It is not clear to me why this is done rather that just use a variable. Part of the code to control the pump is:
if((psi > maxpressure) || (psi < minpressure)) // Remark - Conditional statement. If the oil pressure is between these two pressures the code in the French braces is executed.
{
oilok = LOW; // Remark - set the Boolean to LOW
digitalWrite(oilcheck, LOW); // Remark - write LOW to the oilcheck pin to set the voltage to zero which stores the state of the "switch"
}
else // Remark - The following code is executed instead of the code in the French braces above
With these explanations I believe the KU code is understood. The next step is to input it to an Arduino and compile it. I plan to do this in my next post.
|
|
|
Post by turboron on Jan 29, 2018 18:29:55 GMT -5
Enter the revised KU oil pump control code in my Arduino software and uploaded it to the firmware successful today. I will test it this spring when the weather breaks.
On to the tachometer code.
|
|