Commit 015de3ad authored by Jake Read's avatar Jake Read

new controller, compare and test

parent 6f4d5ccc
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
The DEX is an open source piece of materials testing equipment. The machine can be manufactured by anyone with access to a laser cutter with at least a 24x12" bed, or a milling machine of similar or larger size, and nearly any FDM 3D Printer. A bill of materials of purchased parts required to complete the machine is below, totaling some ~ $500 USD. The DEX is an open source piece of materials testing equipment. The machine can be manufactured by anyone with access to a laser cutter with at least a 24x12" bed, or a milling machine of similar or larger size, and nearly any FDM 3D Printer. A bill of materials of purchased parts required to complete the machine is below, totaling some ~ $500 USD.
The machine uses a NEMA 23 stepper motor and a small ball screw to exert force on samples, and any off the shelf load-cell to measure stress. At the lab, we use [squidworks](https://gitlab.cba.mit.edu/squidworks/squidworks) controllers to operate the machine, but rolling a controller with an off-the-shelf Arduino should not be an exceptionally cumbersome task. The machine uses a NEMA 23 stepper motor and a small ball screw to exert force on samples, and any off the shelf load-cell to measure stress. At the lab, we use [squidworks](https://gitlab.cba.mit.edu/squidworks/squidworks) controllers to operate the machine, but a standalone controller written for Arduino and with a JS frontend is [here](controller).
![dex](images/2020-02-11_dex-render.png) ![dex](images/2020-02-11_dex-render.png)
![dex-alive](images/2020-07-12_dex-on-desk-01.jpg)
![control](images/2020-07-11_dex-tools.png)
## Operating Principle ## Operating Principle
A [stress - strain plot](https://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve) is a very useful piece of information when characterizing materials. A [stress - strain plot](https://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve) is a very useful piece of information when characterizing materials.
...@@ -14,6 +18,13 @@ A [stress - strain plot](https://en.wikipedia.org/wiki/Stress%E2%80%93strain_cur ...@@ -14,6 +18,13 @@ A [stress - strain plot](https://en.wikipedia.org/wiki/Stress%E2%80%93strain_cur
To generate these curves, the DEX slowly pulls samples (normally some 'dogbone' shape [below](#testing-notes)) apart, while measuring the amount that it stretches (~ the strain), and the amount of force it exerts as it is stretched (~ the stress). These types of machine are common in industry, often referred to by their leading brand name 'Instron', or as 'Universal Testing Machines' (UTM). To generate these curves, the DEX slowly pulls samples (normally some 'dogbone' shape [below](#testing-notes)) apart, while measuring the amount that it stretches (~ the strain), and the amount of force it exerts as it is stretched (~ the stress). These types of machine are common in industry, often referred to by their leading brand name 'Instron', or as 'Universal Testing Machines' (UTM).
## Comparison to the Instron 4411
I compared results from the most recent DEX build to the Instron 4411 we have in the lab. Some errors still exist: it could be the case that the load cell needs better calibration: my largest calibration weights are near 2kg, but these loads approach 8kgf. I'm not sure how much nonlinearity exists in COTS (and cheap) loadcells like this, but I have *heard* they are *fairly* linear, so certainly we can do better than heresay. There is certainly some flex in the machine itself, but much less than earlier versions. To improve this, the DEX can be fabricated in Phenolic or some other composite, rather than Acrylic as used here. Finally, fixturing could be greatly improved, I believe some creep exists in the jaws as well. I have ordered some parts to test better (off the shelf) steel clamps.
![dt1](data/2020-07-12_compare-dex-4411/2020-07-12_compare-dex-4411-01.png)
![dt2](data/2020-07-12_compare-dex-4411/2020-07-12_compare-dex-4411-02.png)
## Hardware ## Hardware
### CAD ### CAD
...@@ -55,7 +66,13 @@ Part numbers are from [McMaster Carr](http://mcmaster.com) unless otherwise link ...@@ -55,7 +66,13 @@ Part numbers are from [McMaster Carr](http://mcmaster.com) unless otherwise link
Here, I list Acrylic Sheet as the main chassis material. With acrylic, the machine can be manufactured easily on a laser cutter. However, it should also be possible to build the DEX with different sheet material. Lately, I have been using Phenolic as a chassis material: it can be milled on a ShopBot or similar router, and performs much better than Acrylic, with around 11GPA flexural strength (vs. Acrylic's ~ 3GPA). Acrylic is best bonded with Acrylic Cement, a solvent that welds the plastic to itself. Phenolic is best bonded with a two-part epoxy: I use a 20 minute working life epoxy, and nearly any type will do. Here, I list Acrylic Sheet as the main chassis material. With acrylic, the machine can be manufactured easily on a laser cutter. However, it should also be possible to build the DEX with different sheet material. Lately, I have been using Phenolic as a chassis material: it can be milled on a ShopBot or similar router, and performs much better than Acrylic, with around 11GPA flexural strength (vs. Acrylic's ~ 3GPA). Acrylic is best bonded with Acrylic Cement, a solvent that welds the plastic to itself. Phenolic is best bonded with a two-part epoxy: I use a 20 minute working life epoxy, and nearly any type will do.
## Control and Interface ## Control and Interface: Standalone
I recently built a [standalone controller](controller) for this thing, it's written in Arduino and vanilla JS for Node (to serve the app and connect to the machine) and the Browser.
![dex-alive](images/2020-07-12_dex-on-desk-02.jpg)
## Control and Interface: Squidworks
DEX is designed to run a [squidworks](https://gitlab.cba.mit.edu/squidworks/squidworks) controller. The `dex` branches of [cuttlefish](https://gitlab.cba.mit.edu/squidworks/cuttlefish) and [ponyo](https://gitlab.cba.mit.edu/squidworks/ponyo) contain code that is known to work with the machine. For more info on the controllers, please consult those repositories. In all, controlling the machine can be achieved in any number of ways, on needs only to control one stepper motor and read one load cell. DEX is designed to run a [squidworks](https://gitlab.cba.mit.edu/squidworks/squidworks) controller. The `dex` branches of [cuttlefish](https://gitlab.cba.mit.edu/squidworks/cuttlefish) and [ponyo](https://gitlab.cba.mit.edu/squidworks/ponyo) contain code that is known to work with the machine. For more info on the controllers, please consult those repositories. In all, controlling the machine can be achieved in any number of ways, on needs only to control one stepper motor and read one load cell.
......
...@@ -69,6 +69,7 @@ uint16_t rl = 0; ...@@ -69,6 +69,7 @@ uint16_t rl = 0;
uint16_t one = 1; uint16_t one = 1;
int32_t stepsToTake = 0; int32_t stepsToTake = 0;
int32_t position = 0; int32_t position = 0;
uint8_t retries = 0;
void loop() { void loop() {
stepper.run(); stepper.run();
...@@ -78,12 +79,18 @@ void loop() { ...@@ -78,12 +79,18 @@ void loop() {
cobsSerial->getPacket(&pck, &pl); cobsSerial->getPacket(&pck, &pl);
switch(pck[0]){ switch(pck[0]){
case DEXKEY_LOADCELLREADING: case DEXKEY_LOADCELLREADING:
while(!loadcell.is_ready()){
delay(100);
retries ++;
if(retries > 10) break;
}
if(loadcell.is_ready()){ if(loadcell.is_ready()){
int32_t reading = loadcell.get_value(10); retries = 0;
int32_t reading = loadcell.get_value(5);
rl = 0; rl = 0;
res[rl ++] = DEXKEY_LOADCELLREADING; res[rl ++] = DEXKEY_LOADCELLREADING;
ts_writeInt32(reading, res, &rl); ts_writeInt32(reading, res, &rl);
debugmsg("reads: " + String(reading)); //debugmsg("reads: " + String(reading));
} else { } else {
debugmsg("loadcell not ready"); debugmsg("loadcell not ready");
} }
...@@ -97,7 +104,7 @@ void loop() { ...@@ -97,7 +104,7 @@ void loop() {
stepsToTake = 0; stepsToTake = 0;
one = 1; one = 1;
ts_readInt32(&stepsToTake, pck, &one); ts_readInt32(&stepsToTake, pck, &one);
debugmsg("to take steps: " + String(stepsToTake)); //debugmsg("to take steps: " + String(stepsToTake));
stepper.runToNewPosition(position + stepsToTake); stepper.runToNewPosition(position + stepsToTake);
position += stepsToTake; position += stepsToTake;
rl = 0; rl = 0;
......
...@@ -84,12 +84,16 @@ let DEXKEY_MOTORENABLE = 16 ...@@ -84,12 +84,16 @@ let DEXKEY_MOTORENABLE = 16
let dex = {} let dex = {}
let lsq = new LeastSquares() let lsq = new LeastSquares()
let oldReadings = [[25, 14854, 29649, 44453, 74061, 103695],
[0, -0.100, -0.200, -0.300, -0.500, -0.700]]
let calibReadings = [[1,2,3], [1,2,3]]
let newReadings = [
[42, 255872, 209341, 171922, 141727, 108767, 79558, 48830, 30461],
[0, -16.8854, -13.7983, -11.3386, -9.3394, -7.1638, -5.243, -3.2144, -2.009]]
//[0, 1723g, 1408g, 1157, 953, 731, 535, 328, 205]] // (gf)
// donate some x, y readings to calibrate the least squares // donate some x, y readings to calibrate the least squares
// here this was observed integer outputs from the amp, and load applied during those readings // here this was observed integer outputs from the amp, and load applied during those readings
lsq.setObservations( lsq.setObservations(newReadings)
[[25, 14854, 29649, 44453, 74061, 103695],
[0, -0.100, -0.200, -0.300, -0.500, -0.700]])
// loadcells need to be calibrated, // loadcells need to be calibrated,
dex.readLoadcell = () => { dex.readLoadcell = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -185,7 +189,7 @@ dex.step = (mm) => { ...@@ -185,7 +189,7 @@ dex.step = (mm) => {
} }
// calculate for spmm, // calculate for spmm,
let steps = Math.floor(- dex.spmm * mm) let steps = Math.floor(- dex.spmm * mm)
console.log('STEPS', steps) // console.log('STEPS', steps)
let req = new Uint8Array(5) let req = new Uint8Array(5)
req[0] = DEXKEY_STEPS req[0] = DEXKEY_STEPS
TS.write('int32', steps, req, 1, true) TS.write('int32', steps, req, 1, true)
...@@ -201,7 +205,7 @@ dex.step = (mm) => { ...@@ -201,7 +205,7 @@ dex.step = (mm) => {
} }
} // end recv } // end recv
let moveTime = (Math.abs(mm / dex.maxspeed) + 5) * 1000 let moveTime = (Math.abs(mm / dex.maxspeed) + 5) * 1000
console.log('TIME', moveTime) //console.log('TIME', moveTime)
setTimeout(() => { setTimeout(() => {
rejected = true rejected = true
reject('timeout') reject('timeout')
......
...@@ -173,7 +173,7 @@ export default function DEXUI(){ ...@@ -173,7 +173,7 @@ export default function DEXUI(){
// testing // testing
// test-by // test-by
let testStep = $('<input type="text" value="0.01">').addClass('inputwrap').get(0) let testStep = $('<input type="text" value="0.005">').addClass('inputwrap').get(0)
setPosition(testStep, 50, ypos += yinc + 10) setPosition(testStep, 50, ypos += yinc + 10)
// start / stop testing // start / stop testing
let testButton = $('<div>').addClass('button').get(0) let testButton = $('<div>').addClass('button').get(0)
......
...@@ -27,7 +27,7 @@ import { PerformanceObserver, performance } from 'perf_hooks' ...@@ -27,7 +27,7 @@ import { PerformanceObserver, performance } from 'perf_hooks'
import { TS } from '../core/ts.js' import { TS } from '../core/ts.js'
let LOGPHY = true let LOGPHY = false
// -------------------------------------------------------- WSS VPort // -------------------------------------------------------- WSS VPort
......
This diff is collapsed.
Time,Extension,Load
(sec),(mm),(N)
0.000,0.0000,-5.7219
0.928,0.0101,-5.3604
1.855,0.0202,-4.8679
2.780,0.0302,-4.2691
3.709,0.0403,-3.5415
4.617,0.0504,-2.5591
5.544,0.0605,-1.5403
6.469,0.0706,-0.3969
7.397,0.0806,0.7300
8.329,0.0907,1.9511
9.242,0.1008,3.2203
10.177,0.1109,4.4876
11.100,0.1210,5.7607
12.020,0.1310,7.1564
12.939,0.1411,8.4468
13.871,0.1512,9.7251
14.797,0.1613,11.0949
15.720,0.1714,12.4552
16.644,0.1815,13.8814
17.565,0.1915,15.2512
18.489,0.2016,16.5839
19.415,0.2117,17.9811
20.342,0.2218,19.2253
21.263,0.2319,20.5540
22.194,0.2419,21.8753
23.117,0.2520,23.2482
24.047,0.2621,24.5634
24.967,0.2722,25.9175
25.893,0.2823,27.2613
26.814,0.2923,28.6963
27.745,0.3024,29.9636
28.662,0.3125,31.2377
29.581,0.3226,32.5534
30.512,0.3327,33.8466
31.437,0.3427,35.1860
32.359,0.3528,36.5067
33.280,0.3629,37.8303
34.207,0.3730,39.2458
35.135,0.3831,40.5099
36.057,0.3931,41.7739
36.987,0.4032,43.0203
37.908,0.4133,44.3286
38.838,0.4234,45.6120
39.766,0.4335,46.8868
40.683,0.4435,48.1526
41.610,0.4536,49.5024
42.534,0.4637,50.7325
43.455,0.4738,51.9656
44.384,0.4839,53.2055
45.304,0.4940,54.3939
46.238,0.5040,55.6190
47.158,0.5141,56.7948
48.079,0.5242,57.9741
49.009,0.5343,59.2480
49.932,0.5444,60.3901
50.853,0.5544,61.5080
51.783,0.5645,62.5925
52.705,0.5746,63.7056
53.632,0.5847,64.7661
54.556,0.5948,65.8192
55.482,0.6048,66.8361
56.410,0.6149,67.9359
57.334,0.6250,68.8837
58.251,0.6351,69.7923
59.171,0.6452,70.7189
60.108,0.6552,71.5661
61.024,0.6653,72.4340
61.961,0.6754,73.1690
62.870,0.6855,73.8565
63.805,0.6956,74.5335
64.721,0.7056,74.9924
65.647,0.7157,75.3574
66.575,0.7258,75.5594
67.500,0.7359,75.6387
68.426,0.7460,75.5036
69.353,0.7560,75.1481
70.278,0.7661,74.5503
71.203,0.7762,73.7906
72.124,0.7863,72.7032
73.050,0.7964,71.5269
73.974,0.8065,70.3541
74.897,0.8165,69.1240
75.823,0.8266,67.9192
76.741,0.8367,66.7048
77.674,0.8468,65.5306
78.594,0.8569,64.4820
79.516,0.8669,63.3521
80.441,0.8770,62.3073
81.368,0.8871,61.3533
82.291,0.8972,60.5424
83.216,0.9073,59.7636
84.146,0.9173,59.0587
85.064,0.9274,58.4179
85.991,0.9375,57.9117
86.919,0.9476,57.2694
87.844,0.9577,56.6659
88.769,0.9677,56.1770
89.693,0.9778,55.7359
90.617,0.9879,55.3535
91.544,0.9980,54.9565
92.460,1.0081,54.6174
93.392,1.0181,54.3738
94.312,1.0282,53.9967
95.239,1.0383,53.6822
96.163,1.0484,53.3861
97.086,1.0585,53.1627
98.013,1.0685,52.9388
98.935,1.0786,52.7580
99.861,1.0887,52.5632
100.781,1.0988,52.4675
101.707,1.1089,52.2584
102.631,1.1190,52.0571
103.557,1.1290,51.9194
104.490,1.1391,51.7589
105.412,1.1492,51.6654
106.334,1.1593,51.5417
107.260,1.1694,51.4145
108.185,1.1794,51.3747
109.106,1.1895,51.2357
110.035,1.1996,51.1380
110.953,1.2097,51.0613
111.795,1.2198,51.1331
112.723,1.2298,51.0266
113.649,1.2399,50.9595
114.583,1.2500,50.8769
115.498,1.2601,50.8934
116.419,1.2702,50.7949
117.348,1.2802,50.6948
118.268,1.2903,50.6285
119.191,1.3004,50.5368
120.116,1.3105,50.4932
121.046,1.3206,50.4207
121.969,1.3306,50.3951
122.892,1.3407,50.4516
123.822,1.3508,50.3564
124.744,1.3609,50.2912
125.670,1.3710,50.2481
126.594,1.3810,50.2601
127.523,1.3911,50.2186
128.442,1.4012,50.2021
129.368,1.4113,50.1542
130.287,1.4214,50.1833
131.128,1.4315,50.2312
132.053,1.4415,50.1343
132.981,1.4516,50.0910
133.907,1.4617,50.0392
134.831,1.4718,50.0213
135.755,1.4819,49.9445
136.677,1.4919,49.9135
137.604,1.5020,49.9675
138.530,1.5121,49.8797
139.453,1.5222,49.8143
140.375,1.5323,49.7445
141.217,1.5423,49.8298
142.149,1.5524,49.7538
143.073,1.5625,49.7361
143.996,1.5726,49.6869
144.916,1.5827,49.7035
145.840,1.5927,49.6141
146.770,1.6028,49.5197
147.690,1.6129,49.4928
148.620,1.6230,49.4540
149.541,1.6331,49.4649
150.466,1.6431,49.4424
151.393,1.6532,49.4234
152.314,1.6633,49.4827
153.241,1.6734,49.4122
154.169,1.6835,49.3645
155.092,1.6935,49.3250
156.021,1.7036,49.3282
156.937,1.7137,49.2992
157.866,1.7238,49.2431
158.792,1.7339,49.1832
159.721,1.7440,49.2498
160.636,1.7540,49.2198
161.559,1.7641,49.1728
162.487,1.7742,49.1412
163.412,1.7843,49.0811
164.333,1.7944,49.0598
165.175,1.8044,49.1436
166.104,1.8145,49.1193
167.029,1.8246,49.1533
167.955,1.8347,49.0518
168.876,1.8448,48.9826
169.800,1.8548,48.9235
170.724,1.8649,48.9006
171.653,1.8750,48.8580
172.577,1.8851,48.8340
173.499,1.8952,48.7969
174.431,1.9052,48.8446
175.352,1.9153,48.7797
176.278,1.9254,48.7088
177.198,1.9355,48.7018
178.122,1.9456,48.6826
179.047,1.9556,48.6945
179.971,1.9657,48.6596
180.900,1.9758,48.6431
181.826,1.9859,48.6883
182.751,1.9960,48.6192
183.670,2.0060,48.5941
184.600,2.0161,48.5799
185.525,2.0262,48.5795
186.452,2.0363,48.5567
187.375,2.0464,48.5686
188.295,2.0565,48.6028
189.219,2.0665,48.6982
190.149,2.0766,48.6619
191.072,2.0867,48.5918
191.997,2.0968,48.5628
192.920,2.1069,48.5271
193.845,2.1169,48.5436
194.770,2.1270,48.5200
195.691,2.1371,48.5539
196.619,2.1472,48.6259
197.540,2.1573,48.5591
198.465,2.1673,48.5214
199.391,2.1774,48.5225
200.317,2.1875,48.5254
201.243,2.1976,48.4986
202.171,2.2077,48.4981
203.092,2.2177,48.5047
204.013,2.2278,48.5707
204.939,2.2379,48.4948
205.867,2.2480,48.2904
206.788,2.2581,48.2226
207.714,2.2681,48.2135
208.637,2.2782,48.2532
209.488,2.2883,48.3424
210.403,2.2984,48.3316
211.332,2.3085,48.4164
212.254,2.3185,48.3884
213.182,2.3286,48.3355
214.107,2.3387,48.2803
215.030,2.3488,48.2820
215.951,2.3589,48.2864
216.881,2.3690,48.2846
217.800,2.3790,48.2825
218.723,2.3891,48.3343
219.569,2.3992,48.3933
220.497,2.4093,48.2915
221.415,2.4194,48.2614
222.339,2.4294,48.1777
223.266,2.4395,48.1816
224.190,2.4496,48.1657
225.114,2.4597,48.1495
226.047,2.4698,48.2332
226.968,2.4798,48.2043
227.887,2.4899,48.2031
228.816,2.5000,48.1930
229.744,2.5101,48.2256
230.663,2.5202,48.2444
231.602,2.5302,48.2254
232.509,2.5403,48.2145
233.349,2.5504,48.3701
234.190,2.5605,48.4408
235.114,2.5706,48.3538
236.039,2.5806,48.3253
236.963,2.5907,48.2866
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
B<?xml version="1.0" encoding="UTF-16"?> B<?xml version="1.0" encoding="UTF-16"?>
Export Raw Data : Export raw data,True
Export Raw Data : Format,Comma Separated Values (.CSV)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment