10-14-2017 11:45 AM
wiebe@CARYA wrote:
Looking at that data, I'd say there is a linear relationship between input and output. So once you know +10 at the input equals +7 at the output (you can get this from two measurements), calculating the correct can be done in one step, using linear interpolation. This would be very similar to the binary search. Just instead of dividing the steps, you can make a much better estimate.
If you've done this once, you know the relation. So the next time, you can set the value in just one step if you're lucky.
Assuming the relation IS linear (dangerous) One could use any two points to determine a line (y=Mx+B)
Of course that doesn't take any potential sources of error into account. (Hey, it looks like the OP is setting a current so self heating is another component) A linear search usually helps with some of that by not introducing large changes. A Binary search introduces changes from coarser to finer. A conditionally halted binary search should only be used if you know that the settling time is sufficient for all change magnitudes (I'm pleased that the OP selected the full Binary search option after re-reviewing the thread)
So, in table form
Type, Speed, Accuracy, (Error sources)
Linear, Slowest, Best, (Hysteresis)
Anti Hysterisis Linear(Go up, then go down. split the delta & not discussed in this thread) Turtleish, Unbeatable, ( Step size)
2-Pt Mx+B, Fastest, Good, (Settling time, Quantization errors, non-linearity)
Full Binary, Consistant Good, Very Good (Settling time)
Interruptible Binary, Very Fast to Good (depends), Fair, (Settling time, Tolerance limits)
Its on the Developer to do the "due diligence" and select an appropriate method. Yup, sometimes we do need to worry about having 3-n-1 oil around for our slipstick.
10-14-2017 12:15 PM
Jeff, I agree. Not saying don't iterate, just that he can use the relation to speed up the search. If the relation is reliable\reproducible might as well use it. Guess it takes some fiddling only OP can do.
10-14-2017 12:18 PM
Wiebe, That isExactly the point I was trying to make in the last post. thanks for restating it succinctly.
10-16-2017 03:49 PM
the data is 100% linear.
my senior engineer did mentioned to use the slope methods but haven't program labview in over 2 years.
I have never seen it done before. can someone show me where to find examples so I can look at?
"One could use any two points to determine a line (y=Mx+B)"
10-16-2017 04:46 PM - edited 10-16-2017 04:49 PM
@krispiekream wrote:
the data is 100% linear.
my senior engineer did mentioned to use the slope methods but haven't program labview in over 2 years.
I have never seen it done before. can someone show me where to find examples so I can look at?
"One could use any two points to determine a line (y=Mx+B)"
Your original data looks a little choppy ("White" Line). Rather than using any two points, I would use the Linear Fit.vi. Outputs from that VI also include the slope (M) and y-intercept (B).
EDIT: x-axis is your "Input" Column, and y-axis is your "Measured" Column
10-16-2017 06:45 PM
how would I use the linear fit to the current while loop I have?
10-17-2017 11:13 AM
@krispiekream wrote:
how would I use the linear fit to the current while loop I have?
Start with y = Mx + B. The linear fit.VI gave you M & B. You know what Y is (Target voltage). SOLVE for X!! That's the amplitude setting of the Frequency Generator.
As Wiebe and Jeff previously stated, and I agree, it's not advisable to immediately jump to full power unless you know what you are doing. A linear ramp or binary search is more advisable. Spending 40 seconds to slowly increase to full power is a lot less painful than trying to explain to your boss why you blew up his multi-million dollar equipment and delayed the delivery date by 6 months.
10-17-2017 11:28 AM - edited 10-17-2017 11:29 AM
@jamiva wrote:
@krispiekream wrote:
how would I use the linear fit to the current while loop I have?
Start with y = Mx + B. The linear fit.VI gave you M & B. You know what Y is (Target voltage). SOLVE for X!! That's the amplitude setting of the Frequency Generator.
As Wiebe and Jeff previously stated, and I agree, it's not advisable to immediately jump to full power unless you know what you are doing. A linear ramp or binary search is more advisable. Spending 40 seconds to slowly increase to full power is a lot less painful than trying to explain to your boss why you blew up his multi-million dollar equipment and delayed the delivery date by 6 months.
OH Come On Jam! if he forgot LabVIEW in 2 yrs how do you expect him to remember 7th grade algebra?
x=(y-B)/M