,,Why is it a problem to make sure that each x has two corresponding y values?"
No, it isn't. Actually, I was aiming for that. The problem is, how do I make sure, that there ARE 22 y-values for one x-value. Because that way, I would be able to just subtract the smaller y-value from the bigger one for each x-value to calculate the average internal pressure. I was wondering if it was possible to divide the piston travel into say 50 segments (100 for one rotation was, what I aim for, but I could get tricky considering the rpms). That way, I could program it in a way to demand a pressure value for any step, that is reached at that moment. I don't know - It seems to be the simplest solution that comes in my mind - Like: 1. step: recognize the max and min points of the stroke and calculate the stroke. 2. step: divide the stroke into 50 segments. 3. step: whenever a segment is reached, the pressure sensor read gets associated with that x-value. Something like that? (capital question mark) Or maybe another method would be to use time as the thing to go. Maybe that would be easier. For any let's say 2 miliseconds, the sensor reading of each sensor get linked to draw a point. Meaning the faster the engine runs, the less points the graph will consist of. But this would not be such a problem.
,,Surely you just keep reading stroke position and pressure as a constant stream of points?"
This is let's say the starting point: There are 2 sensors offering values to the arduino. But to connect the values like mentioned here above is the question.
,,You probably can't, and I think you will eventually realise that you wouldn't want to. This might be after you work out what happens in the two seconds when the graph is stationery. You might get value out of the PLX macro, which gives a constantly updated graph in Excel, using data from Arduino..You probably can't, and I think you will eventually realise that you wouldn't want to. This might be after you work out what happens in the two seconds when the graph is stationery. You might get value out of the PLX macro, which gives a constantly updated graph in Excel, using data from Arduino.."
Actually this would be absolutely ok for now.
,,How many readings do you get with every engine revolution?
If you (also) get the crank shaft angle, you know when a rotation is finished. This angle will correspond to the volume, so that you may have measured this angle already."
I am not sure how many points I would need for a p-V-diagram, but I think 20 points for one revolution would already be very crude. I had 100 points in mind, though this would mean 0.2ms time difference for each point for 3300rpm. I doubt the sensors respond so fast. I need to experiment with that when it is set up to find the best settings for that.