03-28-2013 06:25 AM - edited 03-28-2013 06:27 AM
Use case: trimming Common mode rejection using a programmable potentiometer
Problem: The performance of each circuit varies greatly and searching for optimal value (lowest CMRR) gives erroneous results. The performance seems to be relatively flat on some circuits,steep on others. By starting in the middle of the potentiometer's range and moving up or down I compare the measured value after changing the potentiometer to the last measured value. In doing this I can search for the lowest CMR.
Setup: 5V 60Hz sign wave input to the positive and negative sides of a differential ADC. The potentiometer is trimmed and the common mode noise reduces. Go to far and the common mode noise goes up.
Question: I would like to use curve fitting to calculate the shape of the of the CMR performance. Take several measurements (no more then 10 hopefully). Fit the x,y (x= potentiometers trim setting 0 to 1023, Y = amplitude of the measured common mode signal). Find the vertex.
Is this possible and can someone point to an example. I have not found one.
Solved! Go to Solution.
03-28-2013 08:20 AM - edited 03-28-2013 08:22 AM
A parabola is the curve of a second order polynomial. The vertex should be at the peak value. Use the General Polynomial Fit.vi to fit your data. Use the Polynomial Coefficients outputs to calculate the peak location using a bit of analytic geometry.
Edit: Note that you may need to do some checks to make sure that your data has not generated some other curve tahn a parabola.
Lynn
03-29-2013 11:40 AM
Thanks Lynn for the direction. I have looked at the examples for the general polynomial fit.vi and understand its use. I have written my own vi and put in clean data and recieved the expected vertex out.
How would you check to make sure you haven't produced some other curve then a parabola?
03-29-2013 08:23 PM
A search of Wikipedia for "parabola" yields this definition:
with the parabola restriction that
Because of the process you are using to generate the data, you probably know that the parabola will have an axis which is vertical (or horizontal). In those cases there are simplified equations. The general equation without the restriction can generate an ellipse or a hyperbola. If you can use the knowledge of your system to guarantee that one of the simpler equations is always valid, you may not need the other checking.
Consider the case where the potentiometer is defective and does not change value. Your data may fall perfectly on a straight line rather than a quadratic curve. The curve fitting may produce a curve with the coefficient of the second order term very close to zero. That could produce large errors in the apparent position of the vertex.
Lynn
03-30-2013 12:16 AM
Thank you Lynn. It has been a long time since I done anything mathematically more complicated then my taxes.
I am measuring a parabola with horizontal symmetry. I have added fault checking to my code but wont get around to checking it until Monday. That said I have run it through on 3 seperate devices 10 times each and have repeatable results. Yeah.
Thanks again.
03-30-2013 02:26 PM
A parabola is more complicated than your tax return???
You may not need the error checking, but it is important to at least think about it.
Lynn