Precision Metrology

By way of @Blaise:

The National Institute of Standards and Technology posted a paper describing a Watt-balance you could make out of LEGO bricks (and some electronics).

I think it’s made of LEGO purely for the “made out of LEGO” cred. Everything about it looks like it could easily be made out of laser-cut acrylic or wood.

The only expensive bits are a pair of USB multichannel DAC and ADC devices. It uses 4 analog output channels and 6 analog input channels, and the devices they used cost several hundred dollars. I wonder if it can be done with an Arduino?

The paper is at If this seems like an interesting project to you, let’s talk.

This sounds pretty cool. and I’d be interested in helping out with electronics and/or firmware (neither of which is a one-person job I think btw). I read the paper, and thought it was pretty dense on the front matter physics; much more digestible from section III onward.

I think doing it with an Arduino UNO is a bit of a stretch though. Maybe with an an assortment of Arduino’s orchestrated to the task.

One of these ADCs per differential input channel might work for the sampling side of things. The paper calls for 1k-sample/second sample rate, collected over 1.5 second periods (which is somewhat formidable).

I didn’t totally understand the details of the actuation mechanics. It sounded like what’s called for is the generation of a configurable voltage sine-wave with maximum peak-to-peak voltage of +/-10V, right? But what’s not really mentioned explicitly is the frequency of the sine wave; I read the term “microwave frequency” but that (300MHz - 300GHz) can’t be right? You can only practically generate sine waves in the 10’s of kHz using Arduino and a DAC (time spent commanding changes to the DAC output limits the maximum attainable period of the sine wave).

If 16 bits at 44.1-48 kHz will do, then these might work:

Those will give you two channels of input and output per, meaning that you’ll need to buy three and a hub. But, that should be all that’s needed on the hardware side. A headphone amplifier or two should do for the power amplification stage from the DAC to the balance itself.

Like these:

Nothing here is high speed, except the 1kHz sampling rate. The sine that I see them talking about is “amplitude of 2mm and a period of 1.5 s”, or 0.666 Hz. I think the Arduino might be fast enough to handle that.

I found a DAC shield for the Arduino capable of +/- 10 V (see, It only has three DAC outputs, but that may be sufficient. Looking at their setup they only use two of their four outputs for time-varying analog stuff (and even then, only one at a time). The other two they use to (a) control a relay to switch modes, and (b) run the photodiode for the position detection circuit. (a) is purely digital, and (b) seems likely to be a constant voltage.

Similarly, while they have six differential DAC inputs, they only use two at a time as well. They can measure both the current and voltage in either coil, but in one phase they measure the voltage across one coil, and in the other phase they measure the current through the coil, but never both at the same time. And the system is designed symmetrically so they can use either coil as the measuring coil. They also use one for measuring position, and one for measuring a potentiometer for “manual” mode.

Also, I’m not sure the +10/-10 V is strictly necessary, but it’s what they used. The voltages they are measuring are +/- 200 mV, and the currents they are measuring are +/- 3 mA (dropped across a 330 Ohm resistor, so +/- 1 V). It might be possible to redesign that so it’s using lower voltages, and use instrumentation amps to make it single-ended for DAC purposes.

The measurement process consists of two phases:

  1. “Velocity Mode”

In this phase, you don’t even need the measurement mass. This phase is more about calibrating the device, and is not mass dependent.

Force the coil on the measurement pan across the magnetic field. This will induce a voltage across the coil proportional to the velocity of the coil. By measuring the velocity (numeric differentiation of the position), and measuring the voltage, we can get this constant of proportionality, BL.

So we drive one end of the balance (using the other coil and magnet setup) slowly (0.666 Hz) and record the positions and voltages over a long period of time to get a lot of data points to compute BL. They recorded 1000 measurements/second, or 1500/period of oscillation, and used 80 oscillations to validate their procedure. that’s 2 minutes of recording at 1000Hz.

That gives us BL.

  1. “Force Mode”

In this mode, we put a weight on the balance, and measure the current through the coil necessary to hold the balance balanced. The force caused by a current through a coil in a magnetic field is proportional to the current, with a constant of proportionality BL, the same BL measured in phase 1.

So the procedure is to put the unknown mass on the balance, and then adjust the current through the coil (by adjusting the driving voltage through the coil, and measuring the current) until the balance is balanced and steady.

“Manual mode” uses a potentiometer that the user can tweak to get the balance balanced. “Automatic mode” uses a PID controller.

They specify a complex procedure for increasing precision by removing and taking off masses in a controlled manner to eliminate biases. But the end goal is to measure the current I necessary to balance the force of gravity mg.

Since the force F = mg = I*BL, and we know BL from the velocity phase, and we know I from the force phase, and we know g (from looking it up online, or using a gravimeter like your cell phone), we can compute m.

That device will only do one channel input, not two.

The other issue is that for this project we would be measuring small signal DC voltages (approx +/- 1 V), and sound cards tend to be AC coupled, filtering out DC.

@petmar while it might be possible to buy commercial audio equipment and write some software on a PC to make it work, I’d personally be more interested in a more microcontroller-based solution, whereas I think you’re kind of advocating for a Raspberry Pi / Beagle Bone Black / or other PC-like approach, right? I also don’t think it would necessarily be easier (for me anyway) to use the off-the-shelf stuff and wire together application software, but that’s certainly what I’d say they ultimately did in the paper. I’m obviously and admittedly biased by my background and what I know how to do, though. I would also maybe architect a solution that breaks the problem up into independent functional segments to encourage more federated participation. Thoughts?

Do you know why they use two lasers for the position measurement? I also don’t quite understand the physical setup of the lasers and photodiode. These element seem like the most expensive electronic bits once you eliminate the DAQ and DAC from their BOM, with just the photodiode costing $61.63! Their measured full-scale voltage span on that photodiode output is also ~50 millivolts, that is pretty tiny and certainly would require amplification I suspect. This excerpt [caption of Fig 6] also confuses me:

The shadow sensor detects angular motions of the balance and outputs an oscillatory voltage signature.

Do they mean when you are stimulating the coil with a sine wave, the photodiode outputs a correspondent oscillatory voltage, or do you they mean it always outputs an oscillatory voltage. And if it’s the latter, how do they boil that down to a single data point in the position calibration graph of Fig 7? Maybe I just don’t understand what’s actually being measured here, or how it can possibly result in positional resolution in the micrometer ranges.

Separate to any of the above, I’m not sure what AO3+ and AO3- are doing or what that half-transformer and flyback diode represent.

AO3+/AO3- control the relay that switches power between the left and right coils. It’s not really used in an analog manner. It could easily be replaced by a manual DPDT switch.

One of the two laser diodes is used to extend the lever arm of the balance to read its position directly off a scale. If the balance arm is 15cm long and the balance is placed 3m away from the wall, then a movement of 1mm of the balance will cause the laser dot on the wall to move 20mm. It multiplies the precision one can manually measure the movement of the balance by 20. More if you have more distance between the balance arm and the scale.

The other laser diode and the photo diode work as a pair to electrically measure the position of the balance. A sharp edge on the balance arm interrupts the beam between the laser and the photodiode. The lower the arm, the more of a shadow falls on the photodiode and the less voltage the diode generates. By measuring that voltage, you can measure the position. But first you need to calibrate the voltages to the actual positions, which is why you need the other laser to measure it directly.

I agree it’s a lot for the photodiode, and there may be other solutions. A part like this for instance, only costs $9/ea and claims to directly measure position with a 25 μm resolution (it’s slightly more expensive cousin the AS5311 claims to do about 488nm resolution). They might be other options to consider.

I’d rather do it embedded if we could. I also think that the idea of breaking this up into separate parts is a good one. After re-reading the paper, though, I think we have a bigger problem: it appears that all of the analog inputs and outputs are differential. We can easily get around this by using transformers, DC blocking caps, and shunt bias paths, but we’ll have to design it very carefully. Either that, or we could use an off-board differential ADC, like:
Outputs can be done by PWM into an audio transformer, with another PWM feeding a cap on the far side of the transformer through a large cap to give us the bias voltage.
Did I say easy? Maybe I should reconsider my choice of words.

@Blaise I think that using a filter, like this might be very useful in increasing the spatial resolution of the optical sensors. Also, using a current mirror with PWM inputs with a couple of power transistors (maybe MOSFETs) would most likely be the best way to switch current between the two coils. That allows for greater linearity between the two pulls.

Another question: why not just do this in the analog domain, with analog outputs to an ADC for computerized measurement? We can use VCOs like the LTC1799 and PWM them with the method that Mehdi describes here.

Trimpots for everyone!

Differential ADCs are no big deal… I think the one I originally suggested is differential in fact. At any rate, yes definitely external ADCs required.

Now that we have actually ordered samples of the AS5304, I’m concerned that it might not actually work for our purposes. 25 μm may seem like a lot, but it may not be sufficient. The calibration step of the process involves measuring the voltage/velocity relationship while driving the balance through a sinusoidal displacement of 2mm p-p with a 1.5s period. A quick bit of simple calculus ( d/dt 1mm sin(2π/1.5s t) ≈ 4 mm/s cos(2π/1.5s t) ) shows that the maximum speed of the balance is about 4mm/s, or 4μm/ms. If we are taking position samples every ms, it would take over 6 samples per position change, with a lot of slop.

I suppose we could use a precision timer and measure times between position changes (a minimum of about 6250 μs/tick), and use that to calculate velocity.

We also need position info to run a PID to hold the balance balanced when measuring masses. I wonder if the resolution will be enough? Or could we run the PID at a slower refresh rate (50Hz instead of 1000Hz)?

The AS5311, with 12-bit resolution over 2mm (488 nm/step) seems like it might be overall nicer than the AS5304. I wish I had suggested it before the samples were ordered.

We should meet this evening before the board meeting and talk.