To summarize the previous post, I wanted to see if there were two effects happening to my fancy new RS232 scale: 1) temperature and 2) sensor drift (or creep). The easiest way to track this was to measure the weight of an object with a constant mass over time, while also measuring temperature over the same time span. I did that and now have a week's worth of measurement data to sift through.
|Figure 1: Temperature and Weight vs. Time|
|Figure 2: Average Temperature and Weight vs. Time|
My next task was to try and figure out the mathematical relationship between weight and temperature, so that I can then (hopefully) correct for temperature and get a more accurate weight reading. The graph for weight versus temperature is shown in Figure 3. There are several interesting things here. The first is that you can see that both the weight and the temperature are quantized since all the blue points in the graph come out on grid lines. The next thing to note is that the point cloud is pretty widely distributed (which isn't good). I had Excel generate a best fit linear trend line.
Next up I repeated that graph (Figure 4) but with the the averaged temperature data from Figure 2. Now you can see that the quantization in the temperature data has disappeared but remains for the weight, which is what we'd expect. The trend line has changed a little based on this adjustment. I also threw a 6th order polynomial fit trend line on the data to see if that would fit the data better, but as you can see that is nearly a straight line, so we'll stick with the linear fit line for future calculations since it seems to be a pretty good approximation (at least compared with a polynomial fit).
As it stands this temperature correction is probably useful enough that I could start using the scale for continuous weight measurements, however I'd like to make it better if I can. I think one improvement I can make (which I mentioned in my previous post) was that my temperature sensor has pretty low resolution (about 1 degree Fahrenheit). I suspect that having a sensor with 0.1 degree resolution would help, and might bring the point cloud in Figure 3 into a tighter cloud which would make the generated trend line more accurate. So now I'm going to start looking around for a more suitable temperature sensor (I might already have one on hand in my parts library) and re-run the test to gather fresh data.