KIT4007 User Guide: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Calibration == | == Calibration == | ||
The load cell inside the scale produces a small voltage differential based on how much strain its metal body is experiencing | The load cell inside the scale produces a small voltage differential based on how much strain its metal body is experiencing. How do we convert this small voltage into a useful unit of weight or force? The load cell needs to be calibrated. | ||
The simplest way to calibrate the load cell is by using linear interpolation using two known weights and their corresponding voltage measurements. The output of a load cell is linear, so once we find the line that connects those two points, we can use it to convert any voltage from the load cell into a weight or force in the same units as our known weights. | The simplest way to calibrate the load cell is by using linear interpolation using two known weights and their corresponding voltage measurements. The output of a load cell is linear, so once we find the line that connects those two points, we can use it to convert any voltage from the load cell into a weight or force in the same units as our known weights. |
Revision as of 20:51, 24 April 2023
Assembly
- Select a load cell (780g, 5kg or 25kg) and bolt it into the bottom plate with the arrow on the end of the cell pointing down toward the plate
- Guide the load cell cable out of the notch in the back of the plate
- Bolt the top plate onto the load cell
Calibration
The load cell inside the scale produces a small voltage differential based on how much strain its metal body is experiencing. How do we convert this small voltage into a useful unit of weight or force? The load cell needs to be calibrated.
The simplest way to calibrate the load cell is by using linear interpolation using two known weights and their corresponding voltage measurements. The output of a load cell is linear, so once we find the line that connects those two points, we can use it to convert any voltage from the load cell into a weight or force in the same units as our known weights.
Here's the process:
- First, clear the scale and take a voltage measurement. This will be our first data point.
- Next, find an object of known weight. You'll either need to measure the weight of something with another scale, or use a weight from a lab weight set. If possible, try to get a weight that will be close to the maximum weight you expect to be measuring for your project.
- Take a second voltage measurement with this object.
- Now we have two points, so we can calculate the slope of the line:
- And we can use the slope and our first point to solve for the y-offset:
- Now, we have a formula that we can use to convert any voltage from the load cell into a useful value!
Click below for a code sample in python that shows how calibration could be done at the start of your program:
from Phidget22.Phidget import *
from Phidget22.Devices.VoltageRatioInput import *
import time
calibrated = False
m = 0
b = 0
def onVoltageRatioChange(self, voltageRatio):
if calibrated:
# Calculate calibrated weight with y = mx + b
sys.stdout.write("\rWeight: " + str(round((m*voltageRatio)+b,2)) + "g ")
def main():
global calibrated
global m
global b
voltageRatioInput0 = VoltageRatioInput()
voltageRatioInput0.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
voltageRatioInput0.setChannel(0)
voltageRatioInput0.openWaitForAttachment(5000)
try:
input("Clear the scale and press Enter\n")
except (Exception, KeyboardInterrupt):
pass
v1 = voltageRatioInput0.getVoltageRatio()
try:
w2 = input("Place a known weight on the scale, type the weight in grams, and press Enter:\n")
except (Exception, KeyboardInterrupt):
pass
v2 = voltageRatioInput0.getVoltageRatio()
# Calculate slope 'm'
m = (float(w2) - 0) / (v2 - v1)
# solve for b using zero point : b = y-mx
b = 0 - ( m * v1)
print("Calibration Complete: y = " + str(m) + "x + " + str(b))
calibrated = True
try:
input("Press Enter to Stop\n")
except (Exception, KeyboardInterrupt):
pass
voltageRatioInput0.close()
main()
Measurement Considerations
The measurement from load cells are susceptible to drift due to temperature changes in the wires. You may find that even when measuring the same object with no movement, the weight measurement may drift significantly. There are two ways to avoid this kind of error:
- For a long session of constant measurements, allow a 30-minute warm-up after the voltageRatioInput channel is enabled. The drift, due to self-heating of the wires, will eventually stop. Once stable, you can calibrate and measure.
- For brief, occasional measurements, you should enable the channel, immediately take the measurement, and then disable the channel. By doing this, there is so little current moving through the wires that the device does not get a chance to heat up. You should also follow this process when calibrating.
Overloading
Usually load cells can safely be loaded at 150% of their maximum weight. For example, you could put a 7.5kg object on the scale when the 5kg load cell is inside. The measurement would saturate (see the Saturation event in the Phidget22 API for your Bridge Phidget for details), so you wouldn't be able to tell how much heavier than 5kg the object is, but you don't need to worry about damaging the load cell.
However, you need to be careful with the 780g load cell- its high sensitivity makes it vulnerable to damage if loaded beyond 780g. If there's a chance your objects will go above this maximum, we recommend using the 5kg load cell instead.
Further Reading
For more information about how load cells work, see our Load Cell Primer.