First test of a strain gauge trackpoint. I snapped one strain gauge while figuring out how to mount one well!
It sort of works! There's a lot of noise even though I stuck a 1uf cap on the analog pin. It's also not super sensitive - without the capacitor the signal is only barely visible through the noise.
There are proper load cell amplifiers for this - I think they'd be worth a try.
Here's a closer view of the setup. It's a 3D printed cross suspended above the table, with a strain gauge on one of the arms. The gauge is wired to a PCB with a Wheatstone bridge and an LM358 amplifier. The output from that is smoothed with a capacitor and then goes into an analog pin on the arduino.
I'm wondering how much of the noise is due to the wire length and lack of shielding, and how much is unavoidable.
Once my strain gauges arrived I built a version 2 of the strain gauge trackpoint, with both axes hooked up.
I've attached all 4 strain gauges to allow for temperature compensation later, but for now this seems to be ok. It's a lot more sensitive with the gauges superglued to the thing! Before they were secured with double sided tape, which must have absorbed some of the strain.
The prototype #trackpoint actually works surprisingly well! It has no acceleration or anything and it's a bit slow, but once I added a dead zone it's already fairly usable.
Not sure if you can see it in the video once it's compressed, but it's moving the pointer.
I *think* I've successfully reverse engineered the strain gauge amplifier circuit.
It would be great if someone familiar with opamp circuits could take a look at the opamp bit at the bottom and tell me if it looks about right. I've got no idea.
Here are some links to buy the module:
I simulated the amplification portion of the BF350-3AA strain gauge amplifier. For the range of resistances I've seen across the strain gauge (348.8-351.2 ohms), a V_TUNE of 0.5V gets me a 0-5V output.
I think once I have some components decided (e.g. I can get a hold of 348R resistors instead of 360R) then I can re-simulate to tune the resistor values and thus the gain.
I made some slight modifications to the strain gauge amplifier circuit, to use through-hole components for prototyping and add some gain adjustment.
There'll be something wrong with it but that's why it's designed for perfboard rather than a proper PCB.
The capacitor values are complete guesses though.
The parts for the strain gauge amplifier have all arrived now so I tried assembling one on perfboard. As far as I can tell I've done it ok (after forgetting to connect V_excite to half the bridge circuit) but I can't manage to strip the enamelled wire.
Apparently the best way is to heat it with a 400°C soldering iron and plenty of flux, but that didn't seem to be working.
Once I get that connected I can actually start tweaking the resistances.
Once I got the perfboard strain gauge amplifier prototype properly connected to the gauges, it still didn't work.
The method of stripping the enamel off the wires that worked for me was sanding. Some ~600 grit sandpaper worked well.
I probed a few voltages and checked the connections but couldn't see what was wrong.
So the next step was to do what I should have done in the first place - build it on breadboard!
I assumed that there'd be some dodgy connections so I had skipped it. There are, but it still mostly works!
I've found some settings for feedback resistors and V_TUNE that seem to work well - time to figure out what gain it actually gives me!
It looks like the gain values I settled on were -41.3 for stage 1 and 9.125 for stage 2. The second stage could probably be turned down a bit to allow for the signal to be offset a bit.
I'm kind of wondering why I couldn't just do that amplification in one stage - amplify by ~400x instead. I guess that makes it harder to adjust the offset.
The V_TUNE I ended up with was 1.040V, which I think means the bridge circuit is a few tens of millivolts offset when the trackpoint is centred. Not bad.
Tried out using a single inverting amplifier with a gain of 100x on the strain gauge bridge circuit. It seemed workable, with a range of ~0.75V when wiggling the stick.
I might increase that by changing resistors later, but I think that this could work to keep it simple. It means that I can use a single LM358 to amplify both axes of the pointing stick. Exact resistor values can be decided later - I think it would be good to actually get PCBs made!
I killed the strain gauges of one axis of the pointing stick prototype, so I put together a neater one. This one has the magnet wire connect straight to a rigidly mounted thicker wire, which will hopefully make it a lot less fragile!
I think if I do a proper version of this, it'll need to use something surface mount, because this took hours.
Is this a thing you can do with a digital potentiometer? It would be a way to get high resolution in a small range without needing a really high res DAC.
Otherwise, are there (cheapish) DACs where you can set two voltages for the output to be between?
I'm considering replacing the reference arm of the strain gauge bridge circuit with something like this. That way the microcontroller can set the reference point to zero it easily.
The MCP4251 seems like a solid choice for a digital potentiometer. It's a dual pot one so I can do both X and Y channels.
The plan is to have the output from that be the reference for the strain gauge amplifier. The microcontroller can increase and decrease it to find/set a centre voltage when you're not touching the trackpoint. Should provide a good way to automatically correct any minor drift.
Schematics for the pointing stick are coming along! It still needs some tidying up but I think this is enough to get it working.
With this I can make a ~40x40mm board that can be used over USB as a trackpoint, or over i2c with a keyboard, or just output raw analog voltages.
If this works, the version after this could use the PCB itself as the beam the strain gauges are mounted to!
@piggo Thanks for taking a look! That's what I thought was happening, I was just not sure on the various feedback (and other) resistors round the opamps. Pretty sure I had a single lecture on opamps about 5 years ago!
@piggo I'm seeing 1.2V on output when V_TUNE is set to 330mV. It seems to max out at 3.05V and then doesn't change as you keep turning the pot. I'm not sure what V_TUNE that occurs at because I just broke one of the wires to the train gauge.
@piggo Oh are you saying that if the first opamp is outputting 0V, then the second one will compare V_TUNE to 0V and just output V_TUNE?
@piggo Weird thing is that the resistance of the gauge never equals the resistor it's paired with. I'm guessing they used 360R resistors because they're cheap/common and V_TUNE allows them to compensate for the 10 ohm difference?
@piggo Yeah, the cheapness of this (and the fact that it already pretty much works as an input device!) is why I'm thinking of sticking with the LM358 solution, at least until I have the code side mature enough to find problems with it.
@piggo Yep, I couldn't even find any information on it which is why I
I think for my pointing stick I'll just do 2 strain gauges for each axis (so half bridge). I saw someone on stackexchange suggested just using a DAC for the comparison voltage on the opamp instead of the other half of the bridge. Might be worth a go!
@piggo Yeah exactly - if my goal is to build this into a keyboard and provide a PCB for other people to do the same tuning is a bit annoying (especially if it's more than once).
btw the rest of that first sentence was meant to be "which is why I tried to reverse engineer it"
@piggo Anyway I'm gonna leave this for tonight and put together a parts list to prototype it tomorrow!
@piggo Will do! I'll probably do a blog post too once I've made enough sense of it.
You might need something better for weighing stuff though - I just need to find a centre and deviation, nothing absolute
@cinebox Thanks, I might get an LM358 (apparently don't have one or it's hiding) and recreate the circuit myself!
@cinebox Thanks for calculating that! Those gains are calculated from the resistors around each opamp?
@gbrnt yes. the rule of thumb is to assume the two inputs of an opamp are equal voltage during steady state
@cinebox Ah I'd forgotten that! Thanks! I think I have my dad's copy of the Art of Electronics somewhere, should pick it up sometime
@gbrnt I've had success with scraping the wire with a sharp blade and using a screw terminal. Good luck!
@uglyhack Using a screw terminal how?
I didn't have much luck with a sharp blade but I didn't try for very long.
@gbrnt I meant screwing it into a screwterminal. The enameled wire I was using was platinum or nichrome, so I didn't think it would solder well, so I put it in a screw terminal instead.
I guess I wasn't thinking about what you were using. With normal copper wire I wouldn't expect a problem.
@gbrnt could probably also adjust the gain on the amplifiers to bring the maximum closer to your VCC
@AskChip Thanks for confirming, I thought it looked like it but I wasn't sure if I was just missing something :) I'll have a proper read of some datasheets now!
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!