TL;DR: I need to choose a way to sense the suspension travel for each of the four wheels on a dune buggy, and then acquire/construct the chosen sensors. I would like input on my proposed sensor types, and any other sensor types that may be appropriate.
Background infoI'm working on a final project (in software development…) where we're developing a system to acquire data on the performance of a racing dune buggy that's in development by the school's Baja SAE club. Here's a video overview of the competition (though not from my school):
I'm the only one in my group with any electronics knowledge (hobby only); my groupmates only know software. The client (the club building the car) only has mechanical expertise.
We will have some kind of embedded controller (undecided yet: ESP8266, ESP32, STM32, Teensy 3, BeagleBone, Raspberry Pi, …) on the car which will gather data from various sensors. Data will then be transferred to a PC for storage and analysis by our software (the actual software development part of the project). It will have its own battery; there is no electrical system on the car apart from the spark plugs.
I would like as many of the sensors as possible to be digital (preferably I
2C or SPI) with a linear or trivially linearizable response—we only have a few months to build the whole system, so I don't want to deal with much analog or nonlinear stuff if I can avoid it. Plus, multidrop digital buses could help reduce wiring. (I could give each sensor its own local ADC, but that increases complexity…)
Also for rapidity of prototyping, I would like to consider modular sensor systems such as Grove (though I'm not sure Grove specifically would be great for this project because the way it puts either analog or digital on the same connectors, and provides only so many of each kind on a given board, could be restrictive and possibly confusing to the mechanics and mechanical engineers we're building it for). I think I
2C over TRRS connectors could work well, but I've never done that, so I don't know if that's a good idea or not.
Funding for the hardware will be from a small grant, us, and/or the club, so we'd like to keep the price low.
What I'm wondering about todayOne of the things we've been asked to record is the suspension travel. It's
double wishbone or something close to that. The expected travel is about 12 inches at the wheel, less as you move inboard, obviously degenerating to pure rotation at the pivot points. Our client hasn't specified accuracy and precision; from talking to them, I think these requirements are not very stringent, perhaps something like ±1" accuracy, ±¼" precision. I'm not sure about sample rate—I guess it should be high enough to see the suspension's response to landing after a jump, going over bumps at speed, etc., so maybe on the order of 100 Hz.
Measuring either the vertical displacement, the displacement at an angle, or the angle of the wishbones should be fine—it's simple trigonometry to convert one to the other. We also want to avoid changing the behavior of the suspension (i.e. small added mass relative to the rest of the car, no significant added springs).
Absolute measurement would be good, but relative measurement from power-on position would probably work too. An endstop switch or other absolute position reference could be difficult because they'd have to lift up or weigh down the whole car to reach it, each time they do a test drive. But I think the relevant data is how far the suspension moves from its resting position, so this shouldn't be much of a problem if at all. The real advantage I see to absolute sensing is that it can't lose steps—we're going to have several sensors, plus recording, plus possibly streaming data to the dashboard and to a trackside display, so depending on which controller we pick and how fast we sample, it could be under some load. However, there exist quadrature-to-serial ICs, or I could use a small microcontroller to provide that function, which could alleviate the load of interpreting quadrature manually if it provides step+direction output, and also prevent step loss if it tracks the position itself.
Also: the price of the sensor will be multiplied by 4 because we're putting one on each wheel; the sensor might need to be enclosed to keep out dirt; the whole system needs to be easily removable for racing.
Here are all of the sensing options I've thought up so far, over the course of multiple days, in what I hope is a sensible order:
- String potentiometer. This would be a string connected to the suspension, wrapped around some kind of spool, which is mounted on/geared to a rotary potentiometer. As the suspension moves up and down, the string turns the spool.
Problems: string can wear out or get tangled; requires a large-radius spool, gearing, or a multi-turn pot (easily solved by using a commercial string pot, but those are extremely expensive); analog (though super easy analog). - String encoder. This is the same as above with the pot replaced by a rotary encoder (one without detents, obviously). This solves most of the problems with the first option.
Problems: string can wear out or get tangled; encoder can wear out, if electromechanical; relative encoding only (but possibly easier than other options to add a reference position to that doesn't require moving the car, because you can pull out the string all the way by hand). - String ams rotary magnetic encoder, or another brand, but ams is what I have more than zero familiarity with. String encoder with the encoder being an ams rotary magnetic encoder.
Problems: string can wear out; relative encoding only over the full travel (if multi-turn), or large-radius spool (if single-turn). - Potentiometer at the pivot point. Converting linear motion to rotary motion is not a concern with this.
Problem: mounting could be difficult—there isn't really anything to connect its axle to; range of motion is much smaller than most pots', so signal amplitude will be small. - Encoder at the pivot point. Same as above with an encoder.
Problems: taking in data from four rapidly moving encoders (and other sensors) simultaneously; low resolution or expensive; mounting could be difficult; relative encoding only (and difficult to add a reference position). - ams rotary magnetic encoder at the pivot point. Same as above with a magnetic encoder. Provides absolute measurement (because the range of motion is less than 360°). Likely more durable/dirt-resistant than the above two electromechanical options.
Problems: mounting could be difficult; repeatability of mounting by the mechanics could be a problem if the magnet is separately mounted, because it's not as obvious if it's properly aligned. - Hall effect sensor and alternating permanent-magnetic strip, or variable reluctance sensor (Hall effect sensor + permanent magnet) and alternating ferro-/paramagnetic/nonmagnetic strip. Arbitrary length is easy.
Problems: requires implementation of quadrature sensing (easy but an extra step); apparently very sensitive to ambient temperature, which could necessitate a local temperature sensor for compensation or cause it to stop working entirely; either analog, or digital with potential difficulty getting the field strengths right for reliable switching; only relative encoding over the full travel—potentially absolute but nonlinear within one cycle of the magnetization, but this also requires analog (and I haven't seen any strips that would cover the entire travel within one cycle, and absolute position measurement within a short distance is not useful). - ams linear magnetic encoder and alternating permanent-magnetic strip. They have linear versions and linear magnetic strips in addition to the better-known rotary ones. Arbitrary length is easy.
Problem: I can't tell if any of them can track linear position over multiple alternating poles, as opposed to just within one magnetization wavelength, without which it would be a relative encoder only. - Linear (slide) potentiometer. The things used on audio mixers, some lamp dimmers, etc.
Problems: hard to find one long enough; poor reputation for reliability—probably not very reliable for this kind of application. - Linear membrane potentiometer (e.g. Spectra Symbol SoftPot/HotPot/ThinPot). These look like they could work well. They're IP66 rated and quite durable.
Problem: analog (though easy analog); longer ones are expensive; might require calibration; not sure if they like being actuated rapidly. - Some kind of optical rangefinder, like perhaps an IR reflectance rangefinder (e.g. GP2D120), ToF sensor (e.g. VL6180), or parallax rangefinder (e.g. Neato lidar).
Problems: some are analog and/or nonlinear; might not work well in sunlight; can be expensive. - Ultrasonic rangefinder.
Problems: expensive; potentially low accuracy/precision; might not work well on a noisy and vibrating vehicle. - Optical linear encoder, like in inkjet printers. These are typically single-track quadrature; a Gray code version is conceivable, but I haven't seen one and I think it would be difficult to implement. Arbitrary length is easy. We could make our own with laser-printed transparency sheets.
Problems: relative encoding only; we'd have to disassemble four identical or similar inkjet printers to obtain the heads, or make our own, which could be difficult. - Optical linear potentiometer (like above but analog). Could use either a gradient or a solid slope. Again, arbitrary length is easy, and we could make our own with laser-printed transparency sheets.
Problems: analog and possibly nonlinear due to things like more light going through the center of the strip than the edges. (Digital proportional light sensors exist, but they're more expensive, and don't necessarily solve the nonlinearity.) - Make our own combined optical linear encoder/potentiometers. I think it would be possible to put the above two side-by-side, or design a combined pattern, and read them with one sensor (not even a quadrature pair, because the analog part gives direction), and decode it algorithmically. I imagine the output could be made to look like this graph, which should be easy to decode.
Problems: untested as far as I know; analog part is analog (but maybe I can ignore linearity—while tracking, at least—because the digital part takes care of the details); takes more processing; we'd have to disassemble four identical or similar inkjet printers to obtain the heads, or make our own, which could be difficult; making the strip could be difficult. - Vernier optical displacement sensor. A stationary longitudinal reflective line/transmissive slit, with a pickup head containing a crossing transverse slit that slides along. Takes one or two analog or digital proportional optical sensors to tell where along the transverse slit the longitudinal line/slit crosses it.
Problems: analog, if analog; probably nonlinear either way. - Moiré optical displacement sensor. Print two transparencies with longitudinal stripes on them. The stationary one has a slight taper to the stripe pattern, and the moving one makes a varying moiré pattern as it slides along. This varies the effective opacity of the two pieces, producing the same result as the "optical linear potentiometer" option above.
Problem: excessively complex for no apparent benefit. (Maybe there would be a benefit if you can't print grayscale, and the slope version above doesn't work well.) - Capacitive displacement sensor in the form of digital calipers.
Problems: expensive (especially if we want the full travel); protocols can be weird; might wear out or break more easily than other options. - Make our own capacitive linear encoder/potentiometer/combo (equivalent to optical ones described above). Gray code would be easy with enough inputs.
Problem: too much analog hardware needed; possibly nonlinear; the necessary foot-long (flex?) PCBs would be expensive. - Make our own LVDTs. Would be pretty durable if properly made, and we can make them to any necessary length. We could also conceivably make them curved (not the same as an RVDT) and directly measure the angle rather than the vertical or angled displacement.
Problems: analog (though it's easy analog); lots of winding of coils. - Make our own RVDTs, to put at the pivot point. Would be pretty durable if properly made.
Problems: RVDTs seem harder to make than LVDTs; rotation will not be anywhere near 180°, so output signal amplitude will be small; mounting might be difficult, lots of winding of coils. - LVDCs/RVDCs. Like the above, but capacitive rather than inductive. Added 2016-12-05.
Problems: Same as above, minus coil winding, plus potentially large PCBs for LVDC. - Use a long compression or extension spring, connected to a force sensor. Can be made long enough. Very simple.
Problem: analog; FSRs are nonlinear, while strain gauges need expensive amplifiers; changes the behavior of the suspension because it adds another spring to it, though a very light spring might be okay. (We can't do this with the existing suspension springs or other parts because the whole data acquisition system must be easily removable for racing.) - Use a long syringe or a rubber tube with a sliding pinch roller, connected to an air pressure sensor. Can be made arbitrarily long, in the latter form.
Problems: a syringe would add friction; changes the behavior of the suspension because it acts as an air spring; will likely wear out quickly; could lose track of position if there's a leak; air pressure sensors are expensive. - Use a long syringe or a rubber tube with a sliding pinch roller, connected to an air flow sensor. Can be made arbitrarily long, in the latter form.
Problems: a syringe would add friction; relative measurement only; will likely wear out quickly; could lose track of position if there's a leak or the flow sensor is imperfect; flow sensors are expensive. - Put an IMU on the chassis and another IMU on each suspension mechanism and compare their motions. Totally immune to dirt, and easily implemented with no analog circuitry. (Added 2016-11-24; I thought of it while going to bed last night. Apparently _Wim_ had the same idea )
Problem: lots of math for the controller to do all the time; I'm bad at IMU math. - Linear CCD or 1-dimensional position sensitive device with a light shining on it. Would need to be mounted near the pivot point because the range is tiny.
Problems: difficult interfacing for CCD, analog for PSD; expensive; possibly difficult to align. - Optical mouse sensor, tracking on an arc-shaped sliding piece connected to the suspension arm.
Problems: interfacing could be difficult (USB host necessary?); hard to find new (and probably expensive); hard to find 4 identical used ones with suitable interfaces. - Camera and computer vision algorithms. Arbitrary range, pretty immune to dirt depending on where it's mounted.
Problems: computationally intensive even for one; low frame rate from the camera relative to what's achievable with other sensors; even lower CV frame rate; high power consumption; susceptible to different lighting conditions; expensive. - (in combination with another option) Put a wedge on the traveling part of the suspension, which slides past a shorter-range sensor, or a cam on the pivot point, which rotates past a shorter-range sensor. This could reduce the travel being measured to fit in the VL6180's range, for example, or even enough for a direct capacitive displacement sensor.
Problems: it would be far more susceptible to being knocked out of alignment; it's not likely necessary, because we can probably just mount a shorter-range sensor further inboard.
My favorite options right now are, in order of appearance in the list: string rotary encoder with local quadrature-to-serial IC or microcontroller, ams rotary magnetic encoder at the pivot point, linear membrane potentiometer, make our own LVDTs.
What other sensing methods can you think of? Any advantages or disadvantages I missed? What would you use?