Off-The-Shelf Hacker: Model Your Mechanisms with SolveSpace
We like our tools, here at Off-The-Shelf Hacker. Drill presses, screwdrivers, soldering irons and anything power or manual are all part of what it takes to bring one-off physical computing gadgets into our reality.
We also use software tools like programming languages, Linux, interactive development environments (Arduino IDE) and various niche desktop applications.
Then there are the more exotic engineering-centric computer-aided design tools, such as SolveSpace. This program helps you model your mechanisms and see if your design operates as envisioned. You can also simulate your model, as you build it and tweak various parameters to get the desired action in your gadget.
SolveSpace is a fairly simple-to-use program that will show you how your mechanical devices perform in the real world. I like it because it is bare-bones and you don’t need to learn a bunch of extra graphics-related topics, just to see how your designs might work.
Today, we’ll look at Hedley, my robotic skull’s jaw mechanism and see how it works in SolveSpace.
Installing SolveSpace on a Linux notebook is straightforward. At the command line, first add the SolveSpace repository to the apt software repository list.
sudo add-apt-repository ppa:alex-p/solvespace
Next, run apt-get with the update option to make sure all the repositories are current.
sudo apt-get update
Do the installation.
sudo apt-get install solvespace
Finally, run the program at the command line in a terminal.
The program will start with a blank construction display screen. The toolbar will be along the left edge with the floating property browser window in the upper left-hand part of the screen. Minimize the property browser using the small up-arrow at the upper right-hand corner of the window.
Building a Basic Four-Bar Link
The four-bar linkage is a common mechanism in engineering. It consists of four bars linked together with pinned joints. Two points on the same link are typically anchored to something solid, like the ground or perhaps a main robot frame. Two links are then pinned to the anchored link. The other ends of these links are free to move. Connect those free moving link ends with another link and you have a four-bar. They can operate in two (2D) or three (3D) dimensions. We’ll confine our discussion to 2D this time. Four-bars are useful to translate motion, increase/decrease leverage or keeping a couple of links parallel.
Hedley’s four-bar linkage translates the rotary motion of a servo motor into opening and closing his jaw as he speaks. I used calipers to get measurements of the bar links and distances between pivot points. I didn’t take Hedley completely apart, so the values were eyed in as closely as possible. They are within about 50-thousandths of an inch.
Constructing the model in SolveSpace follows traditional computer-aided design (CAD) concepts, using lines, circles, boxes, points and so on. Available elements show up in the toolbar on the left.
You can actually draw all four links in one operation. Select the “line segment” box at the upper left of the toolbar. Then move over to the display space and left-click the first point. Move the cursor up vertically about 1/2 inches and left-click the second point. Move horizontally about 1.5 inches and left-click the third point. Move vertically down about 1/2 inches and left-click the fourth point. Last, travel left, back to the starting point and left-click one more time to complete the model.
Now, if you go up and grab one of the upper points and move it, the two lines will change lengths as you move with the mouse. For this model to behave like a four-bar linkage, we need to add some constraints.
Left-click the lower left-hand point on the linkage. Select the Constrain menu at the top of the window and pick “Lock Point Where Dragged.” This will anchor that point in space. Highlight the lower horizontal line, go back up to the Constrain menu and select “Horizontal.” This action will anchor the line to the horizontal. Now, highlight the left vertical line, go to Constrain and this time select “Distance/Diameter.” This sets the length of the link. Double-left-click the dimension value and change it to 0.660 inches. Do the same “highlight and Constrain/Distance” process for the other three links. Use the values from the four-bar graphic above. You can highlight the dimensions and drag them around to make the model less cluttered and easier to read.
With the model now constrained, grab the left upper point and move it. The right upper point should move in unison with the left point. In this model, the left vertical link represents Hedley’s servo arm, while the right vertical link represents his jaw pivot arm. Change one of the link values and watch how the movement of the mechanism changes.
You can also trace a point as it moves. Highlight the upper right point. Now go to “Analyze” and select “Trace Point.” Move the links and watch it trace the path. Go pack to Analyze and “Stop Tracing” to halt tracing. This model just traces an arc. More complex, compound mechanisms create interesting circular-shaped traces.
The following graphic shows the links representing the extended lower part of the jaw pivot and his jaw (extending to the right).
The rightmost endpoint is Hedley’s lower, center front tooth, in real-life, when viewed from the right side of his skull. Here’s a video of his jaw model in action.
We’ve only touched the surface of modeling mechanisms with SolveSpace. Get comfortable with the program and I think you’ll find useful ways to save time by simulating your mechanisms, before you cut, drill and assemble that initial working prototype.
Catch Dr. Torq’s Off-The-Shelf Hacker column, each Saturday, only on The New Stack! Contact him for consultation, speaking appearances and commissioned projects at firstname.lastname@example.org or 407-718-3274.