Go Down

Topic: Automotive Compression Tester (Read 22243 times)previous topic - next topic

av8or1

#15
Apr 25, 2013, 06:20 am
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!

av8or1

#16
Apr 25, 2013, 06:42 am

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!

av8or1

#17
May 11, 2013, 05:32 am
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: [Select]
` 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.   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: [Select]
`   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...

#18
May 11, 2013, 06:37 am

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

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

#19
May 11, 2013, 06:38 am
That seems to address the key elements of the ADC issues.  Would you agree?

av8or1

#20
May 12, 2013, 01:55 amLast Edit: May 12, 2013, 08:59 am by Coding Badly Reason: 1
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.

zoomkat

#21
May 12, 2013, 02:34 am
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.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

av8or1

#22
May 12, 2013, 08:29 amLast Edit: May 12, 2013, 08:32 am by av8or1 Reason: 1

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.

av8or1

#23
May 12, 2013, 08:42 am
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

#24
May 12, 2013, 09:19 am
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: [Select]
`int PSI = (((analogRead(0) - 102) * 400L) + 819L) / 1638L`

I assume to-the-nearest PSI is acceptable.

phonedawgz

#25
May 12, 2013, 03:41 pm
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)

PeterH

#26
May 12, 2013, 04:08 pmLast Edit: May 12, 2013, 04:10 pm by PeterH Reason: 1
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.

av8or1

#27
May 12, 2013, 04:49 pmLast Edit: May 12, 2013, 05:10 pm by av8or1 Reason: 1

Don't.  It's wrong.

Ok, why?

Try this...
Code: [Select]
`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...

PeterH

#28
May 12, 2013, 05:35 pmLast Edit: May 12, 2013, 05:36 pm by PeterH Reason: 1

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: [Select]
`((analogRead(0) - 102) * 200) / 819`

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.

zoomkat

#29
May 12, 2013, 05:41 pm
"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.