Pages: 1 [2] 3 4 ... 6   Go Down
Author Topic: Automotive Compression Tester  (Read 6210 times)
0 Members and 1 Guest are viewing this topic.
Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to Coding Badly for the ADC information.  I'll investigate and see what I come up with.  Initially I was thinking that I would need to worry much because I don't need 0.25 PSI precision.  The plan was just to read a value and display it.  Then when the next value is read, replace that value with the new one.  Then I started thinking of R/C filters to condition the signal.  Now this stuff.  Yikes! smiley
Logged

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Coding Badly: I found this thread:

http://arduino.cc/forum/index.php/topic,86516.0.html

That seems to address the key elements of the ADC issues.  Would you agree?

Thanks!
Logged

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I'll admit that it's late on a Friday, I had a long week and I'm having doubts about what's going on upstairs right now.  That said, I cannot seem to come up with a good way to convert the 10 bit analog value to the corresponding transducer equivalent.  In this project my transducer will read pressures from 0 - 200 PSI, but the output is radiometric and will come in a voltage range from 0.5V to 4.5V.  So that offset and total range need to be taken into account it seems.  I found code in the forum that seems to do that by first calculating the voltage like this:

Code:
int reading = analogRead(0); 
 float voltage = (reading * 5) / 1024.0;
 float temperatureC = (voltage-0.5) * 100;

This was a temperature sensor.  However I cannot derive something similiar, which is why I'm thinking that my cognitive skills have really deteriorated tonight. smiley-red  Obviously a simple call to map() would do the trick, but it doesn't seem like it would factor in the offset.  But the offset also doesn't appear to be necessary because in the end the way I found to make this work was to do this:

Code:
   int reading = analogRead(0);
   float voltage = ( reading * 4 ) / 1024;
   float PSI = voltage * 50;

So let's say that the value coming in from A0 was 768.  That's .75 of 1024, so the PSI should be 150, which is .75 of 200:

768 * 4 = 3072 /1024 = 3 * 50 = 150 PSI

Am I out to lunch on this one?  What am I missing?

Boy but it must be late...
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

...but the output is radiometric...

Radiometric?  Are you sure that's the correct word?

Definition of RADIOMETRIC
1 : relating to, using, or measured by a radiometer
2 : of or relating to the measurement of geologic time by means of the rate of disintegration of radioactive elements
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That seems to address the key elements of the ADC issues.  Would you agree?

Yes.  (Sorry about the late reply.)
Logged

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Radiometric?  Are you sure that's the correct word?

No of course not.  I meant ratiometric RATIOMETRIC.  As I fully admitted, I was tired last night and so a typo is hardly a surprise.  Anyway, this doesn't address the issue I raised.  No big deal though, I'll just go with what I have 'cause it makes sense.  I searched too much last night too, thus adding to the likelihood of a typo.  Haha!

Thanks for the answer to the other question.  Late is no problem, thanks.
« Last Edit: May 12, 2013, 01:59:40 am by Coding Badly » Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If the project is just to determine engine wear and such, then it may be more important to stay with simple solutions. Most compression testing is to compare pressure variations between the cylinders in a single engine. I think the compression testers I've seen have a check valve between the cylinder and the readout device so the cylinder pressure is trapped in the readout device. This would be the ideal area to locate the pressure transducer.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If the project is just to determine engine wear and such, then it may be more important to stay with simple solutions. Most compression testing is to compare pressure variations between the cylinders in a single engine. I think the compression testers I've seen have a check valve between the cylinder and the readout device so the cylinder pressure is trapped in the readout device. This would be the ideal area to locate the pressure transducer.

Hmmmmmm....yeah I'll have to disagree with most all of that, save the differential aspect you mentioned.  But that's only one part of a CT.

Still, thanks for the feedback just the same.
« Last Edit: May 12, 2013, 01:32:17 am by av8or1 » Logged

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Y'all,

I am designing a custom board with the help of CrossRoads.  In this design, I need the SD card to be located off-board, either at the edge of the enclosure or mounted to a wall of the battery compartment (9V).  One question we had was regarding the reading/writing to an SD card at longer distances.  In this case it will only be a few inches, but just for fun I did some verification testing tonight and stretched things out a bit, see the attached picture.  This worked just fine even though I won't need anything this long.  This SD breakout has a level shifter and is from Adafruit.  The SD breakout from Sparkfun has no shifter.  Would it matter in this scenario, ergo does the shifter aid/facilitate the ability to read/write over a longer distance?  Anyone see any other potential issues with this implementation?  What about access to the SD card being located on a wall in the battery compartment, any issues with that?

Much thanks,

Jerry



* SD distance test 2.jpg (113.73 KB, 800x600 - viewed 31 times.)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyway, this doesn't address the issue I raised.

Which was impossible until you clarified how the readings had to be scaled.  Despite what you believe, I am not able to read your mind nor am I able to remotely divine datasheets.

Quote
No big deal though, I'll just go with what I have 'cause it makes sense.

Don't.  It's wrong.

Try this...
Code:
int PSI = (((analogRead(0) - 102) * 400L) + 819L) / 1638L

I assume to-the-nearest PSI is acceptable.
Logged

Green Bay, WI
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So when I put my compression tester in a spark plug hole and crank, I get readings like 70, then 100, then 120 with it jumping at each compression stroke, and then it levels at 120.  I also note that as the rubber hose fills with compressed air it moves and stretches a bit. 

The rubber hose, and the mechanical air tube inside the mechanical gauge fills with air.  That added volume is a problem if you are looking at a single compression event.  The check valve allows the hose/valve to fill and after 3 or so strokes, once everything is filled, my gauge is now reading the peak pressure inside the cylinder.

To read an individual compression event, you will have to design your tester to not add any additional volume.  Your sensor needs to be located at a place that adds no more volume than the standard spark plug.

Otherwise your compression readings will change depending on the ratio of the added volume of the hose/sender vs the volume of the compression chamber at minimum volume (tdc in piston terms)
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12549
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Engine bays are full of EM noise and the longer your wires are the more noise they will pick up. Since your have wires carrying a digital signal, they will be vulnerable to even low amounts of noise. The wires will pick up  far less noise if you use shielded twisted pair wiring (to avoid earth loops, only ground the shield at one end). You will still have to experiment with a running engine and see how far you can extend the wiring before the noise becomes a problem. Perhaps you could mitigate the problem by providing error detection/correction across that interface. If you can keep the SD drive and the processor inside the same EM shielded enclosure then this would probably eliminate the problem entirely.
« Last Edit: May 12, 2013, 09:10:34 am by PeterH » Logged

I only provide help via the forum - please do not contact me for private consultancy.

Austin, TEXAS
Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't.  It's wrong.

Ok, why?

Try this...
Code:
int PSI = (((analogRead(0) - 102) * 400L) + 819L) / 1638L

I assume to-the-nearest PSI is acceptable.


Ok, I'll try it today and post the results.  And where did you come up with those numbers, ergo what do they represent? I suspect that the stuff on the end is to avoid FP math, but...
« Last Edit: May 12, 2013, 10:10:45 am by av8or1 » Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12549
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And where did you come up with those numbers, ergo what do they represent? I suspect that the stuff on the end is to avoid FP math, but...

The algorithm I got, ignoring rounding errors, was:

Code:
((analogRead(0) - 102) * 200) / 819

Your input voltages 0.5V .. 4.5V correspond to analog input values 102 .. 920.

analogRead(0) - 102 gives you a number in the range 0 .. 819 corresponding to 0 .. 200 PSI. Multiply by 200 and divide by 819 to get PSI.

By multiplying by 400 / 1638 instead, the 819 added to the intermediate result has the effect of adding 0.5 to the result to that it is rounded instead of truncated, which reduces the error.
« Last Edit: May 12, 2013, 10:36:41 am by PeterH » Logged

I only provide help via the forum - please do not contact me for private consultancy.

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"Hmmmmmm....yeah I'll have to disagree with most all of that, save the differential aspect you mentioned.  But that's only one part of a CT."  (code/quote boxes don't seem to be working today)

You might want to detail the final expectations for your compression tester and its specific uses. You might do a lot of work and in the end find that what you develop will not be valid for your expectations.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: 1 [2] 3 4 ... 6   Go Up
Jump to: