07-08-2013 08:38 AM - edited 07-08-2013 08:47 AM
Hey guys,
I'm wanting to setup a counter to count a crossing of a sinewave. The thing is, the sinewave is not zeroed. It's a sinewave of a cyclic load cell that I'm testing a material with. With this test, I will put load on the load cell, then cycle from that position, which is my realitive zero.
So, say I put 0.043 volts on the load cell. I would then cycle the material at a certain strain both ways horizontally, and this "0.043" would be my zero for the crossing. I've included my Vi so you can see what's happening in the "strain" and "stress" state. These states are independant from eachother and don't work together in anyway. They're just recording data on different channels
Is there a way I can edit the Pt2Pt vi to look at this "0.043" value (which is an analog channel)? I was thinking global variable...or...something simpler I could put in my code. I'm still a novice in all this and I would greatly appreciate some advice.
Kindly
Gary S.
07-08-2013 08:52 AM
If all you're after is a "zero" crossing, couldn't you just subtract the DC offset?
07-08-2013 08:54 AM
07-08-2013 09:02 AM
Subtracting the DC offset...I'm about 60% sure I understand what you're talking about. But, won't this affect my data? I have a Load cell that's calibrated and I need those exact voltages. Also, aside from the stress and strain tests, I need to be able to do a biased test: where, I increment the load to a certain voltage, far from zero, then start cycling. This method of catching a non-zero crossing is mostly for the biased test but will be useful for the stress and strain portions if the load cell/LVDT isn't always zeroed at the beginning of the test.
Can you please help me understand more of what you advised about the DC offset?
Thanks
Gary S.
07-08-2013 09:21 AM
07-08-2013 09:46 AM - edited 07-08-2013 09:50 AM
Yes, I understand. But, I'm writing my "cycle" count to my data file in the first column. This column is used to identify the cycle as they match up with the sine wave data. If my load cell isn't zero when I start the test, and the Pt2Pt is incrementing the cycle count everytime is crosses true zero, then my cycles aren't true to what's being output to the data file.
So, say I start the test at -0.043V as the DC "zero" and the Pt2Pt is set for minus-plus. And I graph 1 cycle of data. The cycle count crossing is going to be at zero, but it's not going to match with my load cell data.The crossing is really at -0.043 volts.I would be over a couple of points the first cycle and the offset will cause the zero to "walk" with increasing cycles.
Basically I want to be able to catch this -0.043V (or where ever I set the voltage) and use it as my cycle count.
07-08-2013 09:59 AM
@glskinner wrote:
Yes, I understand. But, I'm writing my "cycle" count to my data file in the first column. This column is used to identify the cycle as they match up with the sine wave data. If my load cell isn't zero when I start the test, and the Pt2Pt is incrementing the cycle count everytime is crosses true zero, then my cycles aren't true to what's being output to the data file.
So, say I start the test at -0.043V as the DC "zero" and the Pt2Pt is set for minus-plus. And I graph 1 cycle of data. The cycle count crossing is going to be at zero, but it's not going to match with my load cell data.The crossing is really at -0.043 volts.I would be over a couple of points the first cycle and the offset will cause the zero to "walk" with increasing cycles.
Basically I want to be able to catch this -0.043V (or where ever I set the voltage) and use it as my cycle count.
I'm not sure I understand. You don't need to worry about where it crosses when calculating the crossing point - you already know where it is crossing. It is crossing at the offset.
07-08-2013 10:04 AM - edited 07-08-2013 10:24 AM
The signal is crossing at the offset, but my "cycle count" is crossing at zero since I'm using Pt2Pt. How to I get my cycle count to cross at the offset? Is there a way I can edit the Pt2Pt to look at my beginning load cell reading zero/offset (I have it a TTL that starts the data aquisition) and then increment everytime is reaches the offset?
As for the why I need to worry about where the cycle count crosses: I am recording the cycle count as a scalar numeric value in my data file, along side my load cell. I need this cycle count to match with the crossing of the load cell for data reduction purposes. So if the load cell crosses at -0.043, I need the cycle count to change when the load cell crosses that value. I understand the Pt2Pt crosses at zero, but the stipulation for the crossing of this vi, "0", is what I want to change. I want it to cross at my offset (-.043, or whatever the case may be), since that is my true "zero" in relation to the behavior of my load cell voltage.
07-08-2013 10:53 AM - edited 07-08-2013 10:53 AM
As has already been said, subtract your offset before going into the Zero Crossing VI.
07-08-2013 10:56 AM
@glskinner wrote:
The signal is crossing at the offset, but my "cycle count" is crossing at zero since I'm using Pt2Pt. How to I get my cycle count to cross at the offset? Is there a way I can edit the Pt2Pt to look at my beginning load cell reading zero/offset (I have it a TTL that starts the data aquisition) and then increment everytime is reaches the offset?
As for the why I need to worry about where the cycle count crosses: I am recording the cycle count as a scalar numeric value in my data file, along side my load cell. I need this cycle count to match with the crossing of the load cell for data reduction purposes. So if the load cell crosses at -0.043, I need the cycle count to change when the load cell crosses that value. I understand the Pt2Pt crosses at zero, but the stipulation for the crossing of this vi, "0", is what I want to change. I want it to cross at my offset (-.043, or whatever the case may be), since that is my true "zero" in relation to the behavior of my load cell voltage.
I think you're not following my train of thought. What you want to do is make a copy of the data (i.e, create a wire branch). On one branch, you will do the crossing calcs. On the other branch, you retain the actual data. On the crossing calcs branch, you will subtract out the offset so you can use the Pt2Pt without modifications. On the other branch you have your original data. There should be a direct correlation between the two. You should now have a record of both how many times it crosses and where it crossed.