This blog was originally published by Michael Stanley, manager of the systems/algorithms team within Freescale’s Sensors Solution Division, on the Embedded Beat.
I am famous (infamous?) among my sensor co-workers for all the “toys” scattered across my office. By “toys”, I mean power supplies, cables, PCBs, motors, mechanical fixtures and so forth. A big part of this collection was cobbled together from scrap and/or constructed in my home shop. While it’s a fun part of my job, it’s also a necessary part. As an algorithm developer, data is my gold standard. Virtually all of my toys are geared towards collecting data which is then used to guide algorithm development to solve various problems for my customers.
It used to be that putting together the electronics for data capture was a major effort, requiring people to design, build and test the PCBs I needed. Today I leverage the huge community of “makers” and the companies that support them. Freescale’s Freedom Development boards meet the standard Arduino R3 pinout, and can be used with a bewildering variety of 3rd party boards that require nothing more than a credit card and a few minutes of search time to find.
I do a lot of training at events and tradeshows. Last June at Sensors Expo, I gave a presentation on machine condition monitoring, and in the attached trade show I demonstrated how we might monitor machine vibrations to determine the health of that machine.
Figure 1: First Generation Motor Vibration Test Setup
The hardware component of that particular demo (shown in Figure 1) used a small motor running off the 60Hz AC, modulated via a standard in-line light dimmer. I used a Freescale FRDM-KL26Zdevelopment board coupled with one of our FRDM-FXS-9AXIS sensor boards to measure machine vibrations. It gave me something to measure, but that was about all. I wanted more control.
Figure 2: Second Generation Motor Vibration Test Setup
The setup shown in the Figure 2 was cobbled together from spare parts from my home workshop. I dropped the FRDM-FXS-9AXIS board in favor of using the native FXOS8700CQ accelerometer on the base Freedom board. The space previously populated by the sensor board was then occupied by a 3rd party motor control board. This lets me easily control the small servo motor (left), a stepper motor (center) and a DC motor (right).
Now motor speed and direction were under computer control. But I had a few problems with this setup:
- Clumsy user syndrome: Translation: smoke occurred when I accidentally shorted the motor supply to the logic supply on my motor board. Fortunately I had ordered TWO motor boards in my initial order.
- This setup offered no “absolute truth” as a way to validate my assumptions on motor speed.
- Although it gave me a chance to explore controlling multiple motor types, no one could accuse this setup of being “pretty”. Something better was needed for the next demo.
The setup in Figure 3 fixes these issues. It uses a different motor control board (Pololu Dual MC33926 Motor Driver Shield for Arduino at $29.95 USD) which seems to be more forgiving of my big thumbs (no smoke so far). It has the added benefits of having a Freescale MC33926 H-bridge chip at its heart, which supports an external shunt resistor that allows me to measure the motor current. Motor power is now supplied via a standard 12V (3A) DC supply, also bought online.
Figure 3: Third Generation Motor Vibration Test Setup
The new 70:1 geared motor came from Pololu Robotics and Electronics, and included a 64 counts per revolution quadrature encoder on the back of the motor. Pololu even carried the mounting bracket and mounting hub for the shaft that I needed. Total cost for that portion of the setup was $30+8+8=$46.As an aside: I wanted a geared motor for this version to see if I could observe some of the intermediate frequencies created by the gear box with my accelerometer. It turns out I can.Motor control, decoding the encoder signals, measuring motor current AND taking vibration measurements via the FXOS8700CQ accelerometer/magnetometer combo is all done using the single FRDM-KL26Z ($20 USD) on the bottom of the stack up. Precision machining and assembly by my friend Chad Krueger solved the hardware “ugly factor”. Another coworker, Mark Pedley, incorporated motor control slider, encoder feedback and 1X, 2X and 3X motor shaft fundamental cursers into our existing FFT demo.What we are left with is a very nice little demo (Figure 4) that gives us full control over motor operating conditions, independent feedback of shaft frequency via the attached encoder and ability to experiment with sensor selection and filter settings.
Figure 4: The Application GUI, showing 90.9Hz shaft speed 1X, 2X and 3X cursors on the PSD
Except for the machining of the base, this entire fixture is based upon commercially available components, but targeted at something that I’m sure none of the original board designers anticipated (machine condition monitoring using vibration analysis). THIS is the joy of the rejuvenated Maker culture. The creation of surface mount components years ago took away the ability for many of us to craft our own designs on the cheap. The broad availability and diversity of boards in the Maker community has given us back that capability. It is now common practice to use these off-the shelf boards to prototype new designs in a fraction of the time it would have taken historically. In some cases, those same off the shelf boards form the basis of the final product.In case you are interested in duplicating our setup, here is the basic bill of materials:
- FRDM-KL26Z Freescale Freedom Development Platform, $20 USD
- 120V/240V to 12V/3A Power Supply, $8.98 USD
- 1mmx5.5mm DC Power Jack Socket, three for $8.28 USD
- Right Angle Aluminum Bracket, four for $6.15
- 6061 Aluminum Rectangular Bar, (3 inches wide, 72 inches long, enough for 8-bases) $54.56 USD
- “Pololu Dual MC33926 Motor Driver Shield for Arduino” at $29.95 USD
- “70:1 Metal Gearmotor 37Dx54L mm with 64 CPR Encoder” at $39.95 USD
- “Pololu Stamped Aluminum L-Bracket Pair for 37D mm Metal Gearmotors” at $7.95 USD for two
- “Pololu Universal Aluminum Mounting Hub for 6mm Shaft, #4-40 Holes (2-Pack)” at $7.95 USD
- mini-USB cable, around $7 USB
- Freescale Vibration Monitoring Program, free at https://community.freescale.com/docs/DOC-103146
If you ignore shipping costs, and are building multiple units (which we usually do), this averages out to around $125 per setup. If you have a well-stocked supply of spare parts, you can obviously do it a lot cheaper (witness Figure 2). Either way, this is a LOT less expensive, and takes a lot less time than doing everything from scratch.
Makers Rule!