= "assets/CoolTerm Capture 2024-11-19 23-14-21.txt"
fileName with open(fileName, "r") as file:
= [float(num) for line in file for num in line.split()]
data
import matplotlib.pyplot as plt
plt.plot(data)'Load Cell Data')
plt.ylabel( plt.show()
9.1 Lab instruction – Bolted joints
This lab is about getting acquainted with screws and their properties under different lubrication conditions.
You will mount an M10 screw around a ring load cell and measure the tightening/loosening torque and axial force in the screw. Mount with washers on both sides. See figure Figure 9.1.1 for correct assembly.
You will perform measurements at three different lubrication conditions:
- Dry screw
- Lubricated screw with oil
- Lubricated screw with grease
Change the screw and nut between experiments.
Workflow
- Mount a screw without tightening it
- Start the load cell (instructions below)
- Start a measurement series
- Either tighten the screw to a suitable torque (not exceeding the recommended torque), note the torque
- Alternatively, tighten the screw to a suitable axial force (70% of the yield strength), note the torque.
- Loosen the screw and note the torque required.
- Repeat a number of times (3-5 times depending on the spread in the measured values)
- Save the measurement series and plot with python
Questions
- How does the tightening torque differ between the different lubrication conditions?
- How does the loosening torque differ between the different lubrication conditions?
- How does the tightening torque differ from the loosening torque?
- How does the spread in the measured values differ between the different lubrication conditions?
- How much force can the screw take before it breaks? (Use table values for the material and compare with your measured values)
- How much force does a vise generate?
- Lubricate the vise screw and compare with previous measurements. What happens and why?
Can you think of more questions? Discuss with your supervisor. Test if time permits!
Getting started with the Load Cell
- Connect the USB cable from the load cell to the computer.
- Start CoolTerm.exe, available for download here: CoolTerm
- Select “Options”
- Select the USB port to which the load cell is connected (in my case “COM7”). Unplug and plug the USB cable back in to see which one disappears and comes back.
- Select “9600” as Baudrate.
- In the Terminal tab, select Line Mode and set Key Emulation to LF.
- Connect the load cell by clicking on Connect.
- Now the load cell starts, give it a few seconds and you should see the welcome text from the load cell. Otherwise, you can press Reset on the load cell. Then you should see the text in the image above.
- Type L and press enter to start/stop the measurement.
- The load cell sends values in kg
- Click on the view icon to select plot, then the values are displayed in a graph. It is possible to reset the graph by clicking on Clear.
- If the load cell is not close enough to 0 for your taste, you can send T to tare it.
Save data
- When the load cell is running, press CTRL+R, save with a suitable name
- When you are satisfied with the experiment, press CTRL+SHIFT+R to save
- Open the txt file in excel or in python for visualization.
Assembly instructions
This lab is about getting acquainted with screws and their properties under different lubrication conditions.
You will mount an M10 screw around a ring load cell and measure the tightening/loosening torque and axial force in the screw. Mount with washers on both sides. See figure Figure 9.1.1 for correct assembly.


Plotting serial data with python
Let ’s say you have saved your data from CoolTerm in a file called CoolTerm Capture 2024-11-19 23-14-21.txt. You can use the following Python code to read and plot the data:
Or use plotly for a more interactive visualization:
import pandas as pd # uv pip install pandas
import plotly.express as px
= pd.DataFrame({'y': data,
df
})
= px.line(df,
fig ="y",
y="Raw Data",
title="plotly_dark")
template fig
Loading data from Excel
Here we want to load the data from loadcell_data.xlsx and plot it.
import pandas as pd
# Note: Takes a little time to load
= pd.read_excel('assets/loadcell_data.xlsx', usecols="D:E",header=None, names=["D", "E"])
excelData excelData
D | E | |
---|---|---|
0 | 0.000 | 0.000 |
1 | 0.013 | 0.039 |
2 | 0.090 | 0.270 |
3 | 0.041 | 0.123 |
4 | 0.010 | 0.030 |
... | ... | ... |
395 | -0.091 | -0.273 |
396 | -0.082 | -0.246 |
397 | -0.122 | -0.366 |
398 | -0.131 | -0.393 |
399 | -0.100 | -0.300 |
400 rows × 2 columns
Above, we have the data from the file loadcell_data.xlsx
.
We read in the columns D to E with usecols="D:E"
.
We name the columns with names=["D", "E"]
Below, we plot the columns D and E against each other.
import pandas as pd
import plotly.express as px
= px.line(excelData,
fig =["D", "E"],
y="Excel columns",
title="plotly_dark")
templaterange=[90, 180]) # Here we set the x-data to start at 90 and end at 180
fig.update_xaxes( fig.show()
Why not create a shaded area between the two curves to visualize the difference?
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
= px.line(excelData,
fig =["D", "E"],
y="Excel columns",
title="plotly_dark")
templaterange=[90, 180])
fig.update_xaxes(
# Add shaded area between the lines
fig.add_traces([
go.Scatter(=excelData.index, y=excelData["D"],
x='lines', line=dict(width=0),
mode=False
showlegend
),
go.Scatter(=excelData.index, y=excelData["E"],
x='lines', line=dict(width=0),
mode='tonexty', fillcolor='rgba(0,100,80,0.2)',
fill=False
showlegend
)
])
# Show the plot
fig.show()
It is interesting to see the average difference between the two curves, which we can get directly with pandas using our excelData
dataframe.
# Calculate the average
'Average'] = excelData[['D', 'E']].mean(axis=1)
excelData[
# Create the line plot
= px.line(excelData, y=["D", "E"], title="Excel columns", template="plotly_dark")
fig range=[90, 180])
fig.update_xaxes(
# Add shaded area between the lines
fig.add_traces([
go.Scatter(=excelData.index, y=excelData["D"],
x='lines', line=dict(width=0),
mode=False
showlegend
),
go.Scatter(=excelData.index, y=excelData["E"],
x='lines', line=dict(width=0),
mode='tonexty', fillcolor='rgba(0,100,80,0.2)',
fill=False
showlegend
)
])
# Add the average line
fig.add_trace(
go.Scatter(=excelData.index, y=excelData['Average'],
x='lines', name='Average',
mode=dict(color='yellow', width=2, dash='dash')
line
)
)
# Show the plot
fig.show()