calculation of crank angle position based on crank sensor

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

calculation of crank angle position based on crank sensor

Post by Yves »

Based on some daq equipment I have lying around, I'm going to give combustion pressure sensing a try. For this I would need to mount an extra crank and cam sensor. Crank toothed wheel is 60-2.

Does anyone know the equasions necessary to derive crank angle from the data coming from the sensors ?

PS : I intend on using labview for this.
m.s.t.
MS/Extra Newbie
Posts: 13
Joined: Mon Nov 09, 2015 8:30 am

Re: calculation of crank angle position based on crank senso

Post by m.s.t. »

It's near impossible. You need to log AT LEAST once per crank angle, that is 360 times per revolution.
The actual number you want to be logging at is once per 0.1 crank angle, which is 3600 logs per revolution, which gives 360kHz at 6000RPM. (3600*(6000/60))

To do this you need a much better crank angle decoder since 60 marks of ups and downs wont cut it, and have an advanced datalogger like Dspace or something from NationalInstruments.

I know there are a few "aftermarker" businessis which sell the whole package, can't remember their name, but I could look it up if you want to know.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

I'm going to answer as follows :

The aftermarket company is TFX and they log based on 60-2 wheel as well. In some cases they just log the oem wheel which is sometimes 36-1. You don't need to have tooths at .1°, you have to have fixed tooths and divide the space in between based on a timer at which during specified intervals you measure pressure.

I only need to have information from 90° BTDC to 90° ATDC. Worst case 180° BTDC and 180° ATDC. Information about compression exhaust stroke doesn't concern me too much at this time.
I'm also wondering why I would need to log at .1° intervals ?

I need to see a trend imo. Therefor I assume that .25° or even .5 degree is more than enough.
The NI card that I use samples at 200.000 samples per second. Taking into account that at 6000 rpm the engine goes through the compression and power stroke approximately 50 times per second this means that I'll have a sampling rate of 50 X 180 X 2 = 18.000 samples. Heck, I could even do 0.1 measurements if I want : 50 X 180X10 = 90.000 samples.
If sampling the entire 4 cycles this equates to 100 X 720 X 2 = 144000, which is the maximum since you also have to convert the signals which takes time.
m.s.t.
MS/Extra Newbie
Posts: 13
Joined: Mon Nov 09, 2015 8:30 am

Re: calculation of crank angle position based on crank senso

Post by m.s.t. »

I think it's easier to log the full 360deg, It will only give you more information, and thus more processing of the data, but it will be easier to setup I guess.

We did log cylinderpressure in the past, I have to ask the person who did it how he setup the trigger.

The reason you need to log at least per 1deg, and preferebly at 0.1deg is because of the speed of the pressure rising at combustion. (at least that's what i've been told).

What engine are you running and what sensors are you using? Any idea of the HP it makes?

The better your resolution on your crank sensor is, the more acurate it gets. For example you could calculate the degrees between a teeth on your triggerwheel, given the RPM you can calculate how much time it takes between the teeth. You could also calculate the time it takes to do one rotation, and thus how long it takes for the crank to turn 1deg and use that as triggertime in your logger...

That where if your engine has combustion all the time, which is not the case. Your crank accelerates en decelerates ALOT, and that is the reason why you need a high resolution crank angle sensor.

Maybe for your purpose all of this is not neceserry, I guess you are going to use it to map it and detect knock long before your ears or a knock sensor will do.(something which expierenced tuners say will be useless, their eirs are trained and pickup knock at the sametime your logger does). In this case I guess you can asume your crank rotates smooth and unanimous with no accel and decel, and calculate triggertimes based on the RPM you run and have a missing teeth as TDC reference, for example.

P.S. their is an other company which makes better kits, just can't come up with the name...
EDIT: found it! http://www.plex-tuning.com/products/ple ... on-monitor
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

SBC 350 with ITB's. ca. 530 hp, redline 7500 rpm.

I was thinking along the lines of trying to see knock/pre-ignition and the degrees ATDC where the PPP occurs so I can set ignition timing accurately.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

Coming back to this. I have been thinking about using a strain gage attached to the jacket of a spark plug to measure the strain due to stress it's undergoing. Found a firm locally that can equip a number of plugs with the strain gages.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: calculation of crank angle position based on crank senso

Post by racingmini_mtl »

Interesting.

I wonder how different the calibration will need to be from one plug to the other and how repeatable the results will be. I also assume that you will need to be careful about the amount of torque you use when installing them.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

racingmini_mtl wrote:Interesting.

I wonder how different the calibration will need to be from one plug to the other and how repeatable the results will be. I also assume that you will need to be careful about the amount of torque you use when installing them.

Jean
From the information so far, you have a choice between 2 wire and 3 wire ones. The 3 wires compensate for the change in resistance due to temperature. For me this is about seeing knock/pre-ignition and ppp.
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: calculation of crank angle position based on crank senso

Post by dontz125 »

What sort of effort / circuitry is involved in a simple burn / no-burn crank phase detection? No knock detection or peak pressure timing, just - did it fire and ignite a fuel-air mix, with all the glorious heat and ion charges that involves, or did it just spark into a cloud of smoke that's already half-way out the exhaust port?
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

dontz125 wrote:What sort of effort / circuitry is involved in a simple burn / no-burn crank phase detection? No knock detection or peak pressure timing, just - did it fire and ignite a fuel-air mix, with all the glorious heat and ion charges that involves, or did it just spark into a cloud of smoke that's already half-way out the exhaust port?
The circuitry is not meant to interpret. A misfire will show up as a much lower pressure in the time after TDC. Burn = heat = pressure. No burn =/= heat =/= pressure
madbouncy
MS/Extra Newbie
Posts: 5
Joined: Fri Dec 11, 2015 6:13 pm

Re: calculation of crank angle position based on crank senso

Post by madbouncy »

Yves wrote:
racingmini_mtl wrote:Interesting.

I wonder how different the calibration will need to be from one plug to the other and how repeatable the results will be. I also assume that you will need to be careful about the amount of torque you use when installing them.

Jean
From the information so far, you have a choice between 2 wire and 3 wire ones. The 3 wires compensate for the change in resistance due to temperature. For me this is about seeing knock/pre-ignition and ppp.
The 3rd wire on the strain gages is only temperature compensation for the lead wire and not the gage. The gage has to be matched for expansion to the material it's mounted on and it should come from the supplier with a temperature correction for its gage factor.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

madbouncy wrote:
Yves wrote:
racingmini_mtl wrote:Interesting.

I wonder how different the calibration will need to be from one plug to the other and how repeatable the results will be. I also assume that you will need to be careful about the amount of torque you use when installing them.

Jean
From the information so far, you have a choice between 2 wire and 3 wire ones. The 3 wires compensate for the change in resistance due to temperature. For me this is about seeing knock/pre-ignition and ppp.
The 3rd wire on the strain gages is only temperature compensation for the lead wire and not the gage. The gage has to be matched for expansion to the material it's mounted on and it should come from the supplier with a temperature correction for its gage factor.
Yes, it has to be calibrated at the temp the plug sees in operation. Otherwise the stress induced by temperature change would give an incorrect reading.

I don't see that as the mayor obstacle at this moment :D . I have more of an issue connecting the pressure data to crank angles. Right now, my best option is a daq and labview. The issue however is that I will have 2 systems when tuning ignition and not just one. Unfortunately I have very limited knowledge about the code ms3 is programmed in. According to James the high speed loggers could be up to the task if the pressure signal is coming in through the PT4 but it would require reprogramming.
madbouncy
MS/Extra Newbie
Posts: 5
Joined: Fri Dec 11, 2015 6:13 pm

Re: calculation of crank angle position based on crank senso

Post by madbouncy »

Yves wrote:
Yes, it has to be calibrated at the temp the plug sees in operation. Otherwise the stress induced by temperature change would give an incorrect reading.

I don't see that as the mayor obstacle at this moment :D . I have more of an issue connecting the pressure data to crank angles. Right now, my best option is a daq and labview. The issue however is that I will have 2 systems when tuning ignition and not just one. Unfortunately I have very limited knowledge about the code ms3 is programmed in. According to James the high speed loggers could be up to the task if the pressure signal is coming in through the PT4 but it would require reprogramming.
I generally always see the crank and pressure signal going into their own system and then the overlay with the rest of the vehicle and dyno information is done through post processing.

If you feed it into your ecu then you'll still need something that can take your strain signal and output it to an actual voltage. Are you hoping to make something where the ecu can respond to your sensor or are you just trying to track it while your running?
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

The output is going to be a voltage related to pressure. So I could, if wanted relay it through an iox.

I don't own a dyno, so this is essentially used for tuning on the street. I might be able to find someone to drive the car and then tune. A integrated system would be extremely helpfull, let alone the possibilities that it would off. However that's not going to happen anytime soon, so I'll have to deal with 2 different systems.

I've done some labview programming, so this would be easier to deal with than with programming code of ms or ts (if at all possible)
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: calculation of crank angle position based on crank senso

Post by jsmcortina »

Relaying through CAN is not going to work at all.
At just 1000 RPM the engine takes 60ms for a full rev.

The CAN comms are likely to introduce at least 20ms latency, so you would know engine position +/- 120degrees, getting worse at higher RPMs.

I think you need to work on understanding the fundamentals more before spending lots of money on hardware. A day on the dyno could be far cheaper.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

jsmcortina wrote:Relaying through CAN is not going to work at all.
At just 1000 RPM the engine takes 60ms for a full rev.

The CAN comms are likely to introduce at least 20ms latency, so you would know engine position +/- 120degrees, getting worse at higher RPMs.

I think you need to work on understanding the fundamentals more before spending lots of money on hardware. A day on the dyno could be far cheaper.

James
Correct, I didn't think about can latency. I don't seem to remember anything being mentioned about that in the manual, but I could be wrong.

Will have to stick to the NI DAQ to process so it seems.

What fundamentals ? The fundamentals of the electronics, data acquisition or those of the engine ?

As for cost : based on what was quoted, the plugs fitted with the strain gauges is not a big cost. The signal conditioning unit for the strain gage is about € 60 bought outright from them. I already have the NI cards (200 ks/s - which have cost me € 200 for the 3 cards). Maybe an expansion box with slots to connect them to the laptop (€ 100). The rest is time to be invested, but that's my own time. Seems like not such a bad cost, but opinions may vary.

PS : I have the impression that you are against the idea of a way to tune the ignition timing. If so, why ? Because of the risk and liabilities involved ?
madbouncy
MS/Extra Newbie
Posts: 5
Joined: Fri Dec 11, 2015 6:13 pm

Re: calculation of crank angle position based on crank senso

Post by madbouncy »

Is the strain gage place supplying you a pressure vs strain calibration and different temperatures? Id be interested in this as it sounds very cheap.

I think you are definitely a long way off from making it a simple enough signal for the ECU to talk to but as you said, it's all just time. Cylinder pressure fluctuates a lot and you have to spend much of your time just learning how to average the cycles to decide what is actually best and also a lot of time to calibrate at what point your starting to see trace knock. Lastly, as James said, you're still going to have to spend time on the dyno to find where you need your cylinder pressure to be to get the best torque and how much room you have to play.

Using pressure sensors in the spark plugs is normally not very reliable and hopefully you don't go through to many gauged plugs.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

I could be wrong the the peak pressure point is dependant on the burn rate and the speed at which the piston moves (which is dependant on rpm and engine geometry). So the way I see it, the point at which most of the fuel is burned and the highest pressure occurs in somewhat in the same region ATDC over the entire operating range, if tuned right. The actual pressure value of course can be different depending on several things (VE and fuel present). If I'm not mistaken the trick is to get the ppp within a range of 15-20° ATDC for maximum torque. I think the closer to TDC you go, the more prone to detonation the situation will become since the actual pressure value will be so high the remaining fuel will ignite all by itself. That last one will show up as traces of knock in the pressure signal.
On the other hand, if you see traces of knock occuring at say 17° ATDC you will necessarily have to reduce timing as at that point the engine is essentially knock limited. This is one of the reasons a dyno operator still listens for knock through headphones or with a knock sensor.

Am I seeing this correct ?
madbouncy
MS/Extra Newbie
Posts: 5
Joined: Fri Dec 11, 2015 6:13 pm

Re: calculation of crank angle position based on crank senso

Post by madbouncy »

It's a general idea of what is right but it's the actual workings of it that are difficult. Such as actually finding what those traces of knock look like in your pressure signal. Also finding how much variation in cylinder pressure you're seeing between cycles and filtering out any errors. Another concern you'll find with peaks is that to find a true peak of the burn will require some kind of analysis and you're likely to have too much noise to look for the peak by just normal arithmetic. This isn't difficult at all but it will slow things down if you're trying to do it in real time.
Yves
Super MS/Extra'er
Posts: 1505
Joined: Tue Jun 17, 2014 1:23 pm
Location: Belgium

Re: calculation of crank angle position based on crank senso

Post by Yves »

Ok, seems logical. Cannot comment on that as it's not clear what the signal will look like. Could be that vibration will cause too much havoc and it's all in vein.
Post Reply