Wednesday, February 12, 2014

Bathroom Scale Apparatus Gets An Upgrade!

In a previous post I talked about some unholy things (and by unholy, I mean awesome) I did to a digital bathroom scale so I could make a force measurement setup. Well, I finally arrived at a setup that I was able to use, so I wanted to take some time to document the equipment. The equipment discussed here is the same equipment used to collect the force data in the thrusts and column buckling post.
Here's the DAQ system and a single load cell being tested.
Update 4 March 2014: fixed a typo in the force resolution. It should have been 6 N, not 0.6 N.


Previously, I had only rigged up a prototype using a single load cell and it was housed in a foot from the digital scale. From the start, it was pretty clear this arrangement wasn't going to work terribly well, as the plastic case limited some of the configuration options. Additionally, I didn't wire the DAQ I was going to be using into the circuit because... well, I had no idea how to actually use it.

Datalogger

Since I had a working single load-cell arrangement after butchering the bathroom scale, and I'd received the DAQ already (a DLP IO8-G USB DAQ interface), the first step was to actually hook them together. From a circuit stand-point, this was dead simple: the DAQ provided a 5v power supply and ground, and 8 analog input channels I could use. But to actually get data from it I needed two things: a data logging program and a computer to run it on. The computer was the fun and easy part: I had a trusty and venerable Apple Powerbook G4 (circa 2004, awww yeah.) in my closet that was still functional. So I took it out, dusted it off and asked it nicely to come back into service. I'm kind of glad I didn't prematurely give it that viking funeral I have promised it.
Once more into the breach! It doesn't even mind the MS mouse.

The datalogging program would have also been dead simple if I was running Windows, or if I was willing to spend stupid amounts of money on pre-written packages. But since neither of those is how I roll, I went about figuring out how to write my own. DLP provided USB serial drivers, so the hard part had already been done. The software development went kind of like this:

  1. Install low level device drivers. Verify functionality with terminal emulator.
  2. Try to write logging program in C++.
  3. Get angry and remember I know Python way better than C++.
  4. Drink a beer. (I am convinced this is really what ??? means.)
  5. Find a python serial device interface package (PySerial) and install it.
  6. Write a working datalogger in about 30 minutes.
  7. Celebrate with a beer and a movie.

The main process of the datalogger is simple:

  • Input number of samples, \(N_{samples}\), and number of channels, \(N_{channels}\)
  • For each sample (\(N_{samples}\) total)
    • For each channel (1 to \(N_{channels}\) total)
      • Send the sampling command to the DAQ
      • Read in the returned value (a voltage), and calculate sample time
  • Output measurement data in tab delimited format: Time (ms)  Voltage (V)

But since I wanted to have time-series data of the event, I also had to do a bit of digging to find a reliable wall-clock timing method (i.e. not process clock based). This was also something that Python made a lot easier than C+ thanks to the time module. If you're interested in the code, shoot me a message and I'll get it to you, I don't want to clutter this post with it.

Note that this logger doesn't output the sampled data until after it is all collected. In testing, I'd found outputting every sample step slowed the samples down too much (the output took almost as long as the sampling). I was able to get a sample rate of about 66 Hz, or a time resolution of about 15 ms. The voltage output resolution was 0.01 V, limited by the 10 bit analog-to-digital converter (for the 5V range) in the DAQ interface.

 Hardware Time!

With the software out of the way, the next steps were mainly on the hardware side. The first new hardware step was to make a housing to hold the 4 load cells that I had ripped out of the scale.  I decided on some 3/4" thick pine board because I had it laying around and I could easily fabricate what I needed with it. The idea was to make a small square out of the load cells, and have a "pressure plate" sit on top of them. Here is a montage of its creation:



Now let's get into some of the fun stuff that was happening off-camera, and talk about some of the things that are in the video.

For the force transducer housing, I built a really simple pine box. But because the load cells needed to be able to deflect, I had to create a set of channels that the W-shaped load cells could straddle. I did this with a combination of drilling and chiseling (after making a template as a start). Ideally, I'd have used steel or aluminum but I was limited by my tools. Besides, if I broke it or it didn't work, I wouldn't be out much. The final touch was drilling a set of holes to run the wires out to what would eventually become a cable with a D-sub connector (an old computer serial port, or VGA monitor port for you youngins). I reinforced the surfaces of the pressure plate using some epoxy and 16 ga galvanized sheet steel, so it wouldn't break or dent significantly in use. During the process of making the pressure plate I had to sculpt it to fit properly without hanging up, hence the markings to indicate its orientation. This is definitely something I'd like to improve on, since it also had the unfortunate tendency to bind up if a load was applied to one side.

Once the housing was built, I epoxied the load cells in place and secured the wires making sure the epoxy didn't gum up operation. I joined the power wires for all of the cells so they could be soldered to a single pin in the D-sub connector and did the same for the ground wires. Each of the 'sense' wires got its own pin in the D-sub connector, however. Since I had electrician's tape but no shrink tubing, I just taped the wires to keep things tidy. I also built the interface cable that would connect the load cell unit to the amplifier setup (and the DAQ): six 22 ga wires in total, 2 for the power and ground, and one for each load cell sense lead.

This mess was my initial schematic, using variable resistors and a summing amplifier.


Next, I rebuilt my circuit to include 4 instrumentation amplifiers (INA-125P): one for each load cell. I also set up 4 sets of bridge completion resistors for each load cell (they need to be used in a wheatstone bridge arrangement). Initially when I tried this, I found that only 2 of my load cells responded: I later found this was due to having mis-matched bridge completion resistors. To get around having to buy very expensive low-variation resistors, I used my multimeter to measure and group my 1 kOhm resistors so that I was sure I had completion resistors that were close to the same value (less than 1 Ohm variation). It worked wonderfully, but as it ended up, my sampling rate dropped in proportion to the number of channels I had (since I can only send one request at a time with this DAQ). So now the question was: how can I collapse all my amplified output voltages into a single channel?

The answer at first appeared to be to use a summing amplifier. However, upon trying to make that work (and failing) I realized something: I had already amplified my load cell signals, so I could actually use a much simpler passive circuit called a passive averager to get the sum. The average of a series of numbers is just the sum divided by the total number of values (\(\bar{V} = (V_1 + V_2 + V_3 + V_4)/N\)), and I could just account for that constant value (\(N\)) in my datalogger or calibration. All my averaging circuit required was 4 resistors closely matched in value: easy enough to do, and it allowed me to keep things on one channel without additional loss of precision (since the analog inputs are limited to 5V). I also avoided buying more small electronics components: a bonus given the small budget.
And this mess is the final circuit schematic. Totally different.
With the amplifiers, DAQ and datalogger sorted out, the next step was to come up with some way to house them. I had originally planned on soldering the circuit, but decided to stay with the breadboard so I could reuse components and rework things easily. I knew I wanted to keep the amps close to the DAQ, and had the limited length of my custom interface cable. Enter the leftover Thai food container, which made a great portable box for my amps and DAQ with some minor modifications:
Not quite pad thai, but definitely more useful.
Things were shaping up, but I had one major hardware issue remaining. For one application, I'd want to mount my force transducer vertically: the perfect orientation for the pressure plate to fall out. As an initial solution, I used some nails on the edges of the housing, bent over the pressure plate to help restrain it without applying a measureable amount of pressure. This was a 5-minute solution, and is another thing to improve later. With that problem mitigated, I secured the force transducer housing to a board with a shelf to hold the electronics container, and it was almost ready for use:
Set up of thrust force measurements, with force transducer housing (Contact Pad) and electronics (Amplifiers and DAQ) labeled.
The last step I needed to perform, now that the hardware was set up, was a calibration not much different from the one I performed in my previous post. I streamlined the process a bit by placing the force transducer housing onto a bathroom scale and then placing various weights on it (including my own). The resulting calibration was still linear, but with a different equation from before and is given below. The force range is ~2kN with a precision of ~6 N.
Again, well worth the effort.

Future Upgrades

I've already started thinking about ways to improve this setup. Here are some thoughts:
  • Faster DAQ
  • Write datalogger to take total sampling time as an input rather than number of samples. 
  • Have datalogger warn you when it's done taking data and is just outputting it to a file.
  • Larger pressure plate with a better alignment and retention system. 
  • Way to fit transducer unit to drop tower (currently working on this)

1 comment:

  1. Thank you so much for sharing this wonderful information, I find your content to be unique and genuine. Keep sharing article and this will help many in finding the best Shear beam load cell

    ReplyDelete