Gas station without pumps

2017 December 16

Laser cutting electrode holders

Filed under: Circuits course — gasstationwithoutpumps @ 17:30
Tags: , ,

Because my applied electronics lab will have labs of 50 students (25 stations), I’ve needed to make a number of new setups. The lab will be taught in a space that is not normally a lab, so I’ll need to wheel in the equipment and set it up before the lab sessions and pack it all back up and wheel it out every Tuesday and Thursday.  Luckily, the lab is not very expensive—equipping all 25 stations, including storage tubs and the cart, cost lest than $10,000.  That is less than the cost of one station in the lab that we used in the past.

Some of the setups for the lab require me to build some equipment (pressure sensor breakout boards, stainless steel electrodes, electrode holders for silver wire electrodes, … ).  I made the stainless steel electrodes over the summer, and this week I made new electrode holders.

The electrode holders are laser cut from acrylic sheet.  Earlier this quarter I tried cutting them from 3mm acrylic from the hardware store, but that did not turn out well.  The lines that were supposed to be etched only partway through the pieces ended up cutting all the way through, even though I was using the laser cutter on its lowest setting and highest speed.

This week I used some 5.3mm thick acrylic sheet.  I cut at 8mm/s at the highest setting, and made the marking lines at 180mm/s at 20–25% power (the lowest setting).

A holder as it came from the laser cutter, with the protective paper still covering the acrylic.

The same holder with protective paper removed.

The holder with 6″ silver wire mounted so that alligator clips can attach to the wires at the top, while the bottom is immersed in salt water.

The marking worked fine, and the first few holders I cut were fine, but several of them did not get cut all the way through, which I did not notice until I had removed the acrylic from the laser cutter (so I couldn’t just cut the lines again).  I ended up having to snap several of the partially cut holders from the waste material.

One of the failed cuts—the ear broke off when I tried snapping the holder from the waste material around it.

I made enough spares that the two for which the ears broke off can be discarded, but I will have to use my rifflers to smooth some of the edges and open up notches on a few of the holders.

2017 November 28

More SolidWorks

Filed under: Robotics — gasstationwithoutpumps @ 22:24
Tags: , , , , , ,

I spent most of my day today with SolidWorks, fixing the problems noted in Bugs found in first assembly of robot and adding new layers to the robot. I’m getting a bit better at using SolidWorks, but I still find it to be an overly complicated interface with way too many modes.  I’m sure that there is a way to get it to start up with reasonable document parameters (like using mm instead of inches, or using the same settings as already open documents), but I’ve not taken the time to try to track that down.

Here is the model as it stands so far:

View from the front left of the robot. The octagon floating on top is a the beacon-detector board, which will be on standoffs that I didn’t bother to include in the model.

I cut out the three layers of the robot today, making two mistakes in the process. One mistake I caught right away, and just recut the layer after fixing the problem—there was an extra alignment circle that was not supposed to be cut that I had forgotten to erase. The other error was just as serious, but I didn’t notice it until I got home—the top layer did not have the slots cut in it for the spacers from layer 2 to layer 3. It is hard to notice this problem in looking at the SolidWorks model, as the 3D model looks the same whether the slots are cut or not. I should have noticed it when I created the dxf file for cutting the third layer, but by then I was getting pretty tired and careless. I’ll have to cut another copy on Thursday.  Luckily MDF is cheap—each layer costs me about $1, and I still have half a dozen 1-foot squares of MDF left.

Incidentally, I came up with what I think will be a cheap fix for the potential problem of the bumper springs not being stiff enough.  I added another switch front and center, just for the spring in the switch to push the bumper forward.  At 60¢ a switch, this is not a particularly expensive way to add a spring, and it saved me a lot of modeling and building time.  I could even wire up the switch if I can think of a use for it.

One other thing I made today was a “drill” test, to see what size holes were really made by the laser cutter from specifications.  I created the guide in SVG using a short Python program (so that I could tweak things easily. It took me quite a while to get the SVG just right, because of weird limitations of SVG, like that the path commands can’t take units for the coordinates. Also because I was using Inkscape to translate the SVG to the DXF format that the RDWorks laser-cutter software needs, and Inkscape assumes that the “pixels” are 90/inch for that conversion.  It is kind of messed up that SVG works in terms of “pixels”, since it is supposed to be Scalable Vector Graphics.  Inkscape only converts paths to DXF (not other shapes, like circles and text), so I wrote the program to generate paths and used Inkscape’s object-to-path conversion to convert the text.

Here is the piece I cut:

The circles were cut at 14mm/s and 100% (actually clipped at 67%) and the numbers were written at 140mm/s and 20%.

The holes were exactly the right size (to the 0.1mm limitations of my calipers), and the circular pieces that were cut out were 0.35–0.4mm smaller in diameter. That is, the kerf is about 0.19±0.02mm and it is on the inside of arcs.

Here is the code I used for generating the SVG file:

#!/usr/bin/env python

from __future__ import division, print_function

# all sizes are given in units of 0.1 mm

# Inkscape coverts pixels to real-world units in DXF at 90 pixels/in

pix_per_inch = 90
mm_per_inch = 25.4
pix_per_mm = pix_per_inch / mm_per_inch
pix_per_unit = 0.1*pix_per_mm

print('<?xml version="1.0" encoding="UTF-8" standalone="no"?>')
print('<svg width="150mm" height="150mm" xmlns="">');

y=100   # y-position of first row of circles

x_space = 60    # spacing between circles
stroke = 1       # stroke-width

xmax = None     # largest value for x

text_space =35  # space from circle to label

for diams in [range(5,50,5), range(50,80,5), range(80,105,5), range(105,130,5)]:
    x=100 # left edge of first circle
    for diam in diams:
        x += diam/2
        print ('<path stroke="red" fill="none" stroke-width="1" d="M {sx},{sy} \
a {r},{r} 0,0,0 {r},{r} \
a {r},{r} 0,0,0 {r},-{r} \
a {r},{r} 0,0,0 -{r},-{r} \
a {r},{r} 0,0,0 -{r},{r} z" />'.format(sx=(x-diam/2)*pix_per_unit, sy=y*pix_per_unit,

        print('<text x="{}" y="{}" stroke="blue" fill="blue" text-anchor="middle" font-family="Verdana" font-size="10">'.format(
        x += diam/2 + x_space
        if xmax is None or x>xmax:
                xmax = x

print('<path stroke="red" fill="none" stroke-width="1" d="M 0,0 h {} v {} h {} z" />'.format(

print ('</svg>')

2017 November 25

Bugs found in first assembly of robot

Filed under: Robotics — gasstationwithoutpumps @ 11:18
Tags: ,

I got the voltmeter panel built and photographed Thursday morning, but I spent Thursday afternoon having Thanksgiving dinner with my brother-in-law’s family, and I spent Friday doing SolidWorks, so I did not get time to blog. Here is the voltmeter, in a test setup:

The lower-left segments on the ammeter seem to be non-functional, and neither the voltmeter nor the ammeter is very accurate, but it will do as a quick-and-dirty battery check. I’m using a barrel connector to provide the power to the robot, because barrel connectors are easier to work with than Deans connectors, and more robust than Molex connectors (the two connectors used in the Mechatronics course). 

I have a Futaba-to-barrel umbilical to connect the battery to the robot. I’ll also make a Deans-to-barrel umbilical, so that I can use the batteries in the lab, but I’ve not done so yet.  I was planning to use a 12V wall wart for testing, but the wall wart seems to have a 5mm/2.5mm barrel plug, instead of 5mm/2.1mm plug, so it does not make reliable contact. It may be better to replace the connector on the wall wart, so that I can standardize on 5mm/2.1mm barrels in all my projects.

Yesterday was spent doing SolidWorks modeling: fixing a number of known problems with the mechanical design, adding another tape sensor location, modeling the microswitches used for the bumpers, and designing the bumper. I got the pieces laser cut and assembled yesterday also:

The back view shows the voltmeter and the battery in context. I’ve not shown the cat-toy ball race on top, but it just fits within the 4 threaded rods, with room above it for the (undesigned) third layer.

The bottom views shows the M10 ball-end set screws, the wheels, the velcro strap for holding the battery, and the holes for the tape sensors.

The bumper design was not really successful, because I’m not good at visualizing things.

The bumper design as it was intended, below the second layer.

On the left front, I goofed—the between-layer spacer panel blocks the bumper.

I was doing the bumper design in SolidWorks above the second layer, rather than below it, and everything looked clear there, as the spacer panel does not extend past the MDF. But mounting the bumper and the switches above the second layer doesn’t help, because I did not allow for nuts around the threaded rods—the bumper hits the nuts instead of the spacer panel. In a final design with a third layer, there would be no nuts on the second layer (the rods are just clamping the layers together from below the bottom to above the top), but I’d like to be able to debug the bumper without needing a third layer.

I will have to recut the layers, because of the following errors, found after assembling the robot:

  • The motor-mount holes don’t seem to be quite right.  I wonder whether they did not get properly updated after I fixed the motor mounts.  I can force the motor mounts on, but the alignment is not what it should be.
  • The battery-to-panel umbilical wire sticks out past the edge of the robot, probably because I made the heat-shrink strain relief too long.  Fixing this doesn’t require recutting the MDF, but may require making a new umbilical with shorter strain relief.
  • The velcro strap holding down the battery should be moved closer to the wire end, so that the charging connector and the extra (JST?) battery connector can be held back out of the way.  This would also make the velcro a little more accessible.
  • I need to move the front spacer so that it doesn’t interfere with the bumper.  This seems like a cleaner fix than redesigning the bumper to avoid the nuts on an above-layer mounting.  Another alternative I considered was using the threaded rods for the bumper support, rather than separate M3 screws as I’m currently doing.  This would mean redesigning the bumper, and may make assembly a little trickier, but not by much.
  • The bumper may extend slightly too far forward—it just fits within the 11″ maximum, even though a little of the front of the arc was cut off (I was squeezing the bumper cut into a piece of scrap MDF which was just a little too small).
  • The mounting holes for the switches match the holes in the switches nicely, but they are 2.5mm holes, and I have M2 screws. I’d get a little better mounting if I switched to 2mm holes in the MDF, rather than 2.5mm holes.  I’ll probably fix this by adding 2mm alignment circles to the switch models, and using “Convert entities” to transfer them, rather than transferring the 2.5mm holes as I currently do.
  • I’m wondering whether the springs in the switches are strong enough to restore the bumper to its rest position.  They seemed to be when I did initial checks above the first layer (without the nuts in place), but I seem to be getting more friction now.  I might need to add a small spring increase the restoring force.  (Where? what sort of spring?)  I have lots of little tension and compression springs, but not torsion springs, which would be easier to set up.
  • I forgot the screw holes for the tape sensors!!!  I put in the rectangular holes for the tape sensors to stick through the board, but forgot to transfer the hole markings to the base plate.  I can fix this by marking the holes and drilling them manually, but I should update the SolidWorks model to have the holes, because I need to recut anyway.
  • The right-hand tape sensor hole somehow ended up 8mm×8mm instead of  8mm×12mm.
  • I did not provide holes for a cable tie to attach the inductor for the track-wire sensor below the 2nd layer.  I need to decide whether I’ll have just one track-wire sensor (deciding to fire when the signal is maximized) or two at right angles to each other—looking for the zero in the one that is end-toward-wire while the one that is edge-toward-wire is high enough to indicate that the wire is there.
  • I don’t have a mount yet for the beacon detector—I should add a third layer for this, even if I don’t have anything else to mount on this layer yet.  The third layer will need support spacer boards, which can also be used to fix the cat-toy ball race in place.
  • No screw holes for the power board, mux board, or track-wire/Teensy board.  This was deliberate, as I had not yet decided on the sizes for these boards.  Laying out and soldering these boards was this weekend’s task.  I can use M2 wood screws to attach the perfboards, but I think I’d rather use machine screws and drilled holes.
  • I’m not pleased with the ball-end set screws as ball casters—the balls do not turn very freely, even with lubrication, so they act more like rounded-end skids than like ball casters.  The adjustability of the height is nice, but I’m wondering whether I would have been better off with a larger ball caster that was designed for the purpose.

2017 November 22

First test cuts and progress report

Filed under: Robotics — gasstationwithoutpumps @ 12:27
Tags: , , ,

Yesterday, I again spent most of the day struggling with SolidWorks.  My goal was to model the tape sensor boards, fix the modeling of the threaded rods to be 8-32 instead of ¼”, check the positioning of the tape sensors and ball set screws to make sure there were no conflicts with the M10 nuts for the set screws, and check the modeling of the motor mounts, tape sensor boards, barrel jack and voltmeter, to make sure that the pieces I will cut for the robot will align correctly.

To check the modeling, I laser cut test pieces in MDF.  The test pieces are much smaller than robot layers, so as not to waste MDF on pieces I’ll end up throwing away (I was sure that I would find errors in my modeling).

Here is the first test piece showing the tape sensor mounted with no problems, but the motor mount showing misalignment of the hole pattern. The corner holes are an appropriate size for 8-32 rod.

The tape-sensor board can be mounted with 12mm M3 machine screws, though if I want to double-nut them I’ll want to switch to 14mm M3 screws. For the motor mounts I’ll use 16mm M3 machine screws.

I remodeled the motor mount to have the holes correctly spaced, and even with sloppy hand alignment the holes match well enough for inserting M3 screws.

Besides the screw holes, I wanted to check the sizing for my power panel, which holds a voltmeter/ammeter and a barrel jack that will be the main input for either battery or wall-wart power input (9.9V from LiFe battery, up to 12V from wall wart).

Here is the power panel showing the voltmeter and the barrel jack. This is the second cut for the power panel—the first one had a rectangular hole barely big enough for the voltmeter. The first cut let the voltmeter slide in until it reached the snap-in locks, but then would not fit the rest of the way. I changed the size of the hole without changing the voltmeter model.
The barrel jack is too short for the thickness of the MDF—the nut barely fits on the remaining threads.
Also, the drill hole on the right for a threaded rod is too close to the power panel, not leaving room for a nut. That doesn’t matter on the test piece, but would on the final robot—I have to check the position of the rod holes carefully.

To fix the barrel-jack problem, I used a ½” Forstner bit to cut halfway through the MDF. Note that the press-fit springs on the voltmeter are gripping theMDF (though not very tightly).

After thinning the MDF, the barrel jack protrudes an appropriate amount from the panel.

I won’t have much time to work on the robot tomorrow, as I have family obligations out of town for Thanksgiving.

I checked the schedule for the course and I’m about a week and half behind schedule. Electronics and mechanical prototyping was supposed to be done by 17 Nov, and I’m still working on both. I hope to have the track-wire sensor tested and soldered today, and perhaps a crude prototype of the bumper.

I’m still trying to decide how to power the motors. I’d originally thought to use switching regulators to reduce the 9.9V battery power to 6V and then Pololu MAX14870 H-bridges to do PWM control.  I still like the H-bridges, but the regulators oscillate rather badly under high load (probably because the resistor and capacitor used for controlling the feedback loop are the wrong size for a 6V output, but replacing the surface-mount components would be a pain).

I’m now thinking of running the H-bridges directly from the battery, but using their current-limitation capability to keep from burning out my 6V motors. I’ll have to test to see how well this works.  The current limitation is set by a surface-mount sense resistor, with the max current being 0.1V/R.  I bought 100mΩ and 51mΩ resistors of the right physical size, so I can do a 1A or 2A current limit.   The 2A limit is appropriate for the beefier 300rpm motors I bought (which I have 2 of) and the 1A limit is appropriate for the wimpier, nominally 210rpm motors that I now have 6 of.  Given that the battery is a 1500mAh, 1C battery, I shouldn’t be taking more than 1.5A from it anyway, so the 1A limit on each motor is probably the best choice.  I’ll have to cut the trace on the boards and solder in the tiny 100mΩ resistors, then test the motors with the H-bridge to see whether the current control works.   The internally generated PWM for the current regulation has a fixed off-time around 15µs (7.8–22µs according to the MAX 14870 data sheet), with a variable on-time (minimum 2.5µs), so at 60% duty cycle (the equivalent of running the motor at 6V rather than 9.9V at stall current), the period would be around 26.7kHz (18–51kHz).  There is some risk that this will interfere with the 25kHz track-wire sensor.  Luckily, I don’t expect to be running the current-limitation PWM very often—generally only when starting or reversing the motors for the robot.

By 24 Nov, I’m supposed to have “Working Prototype for moving robot and ball launcher; State Machine”. If I’m lucky I may have the robot layers cut on the laser cutter that day, but I don’t even have clear plans for the ball launchers. It is unlikely that I’ll have a moving robot and state machines implemented by then. If I’m lucky, I’ll have the low-level code for all the sensors and motor control done.

My fall-back position—having a moving platform that does the detection and control but replaces the launchers with just LEDs to indicate when a launch would happen if I had time to design and build launchers—is looking more and more likely.

2017 October 26


Filed under: Robotics — gasstationwithoutpumps @ 22:32
Tags: , , ,

I can’t share most of what I’m doing for the Mechatronics course, because I don’t want to put up things that students will blindly copy in future years, but I feel that I can safely put up pictures of MockRobot, the prototype we build in Lab 2 for learning SolidWorks, laser cutting, and foamcore prototyping.  The MockRobot is not very different from many other pictures students have access to, and pictures of other prototypes is not going to save them much (if any) effort.

A perspective view showing the overall shape.

The foamcore tower is properly bent with smooth paper on the outside. The lap joint was too weak with the glue I had available, so I used painter’s blue tape to hold the cylinder together. The box also has smooth bends on the bottom edge and mitered lap joints at the corners. The crushed foam was too springy, and one of the lap joints tore the paper, so again I used painter’s tape to hope things together.

The front view, showing the motor mounts on the edges of the platform, the foamcore tower, and the front skeg.

The top view with the tower in place does not show much.

Without the tower, the mounting holes for the tower and for a perfboard are visible. The tops of the two skegs are visible front and back.

The slots for the tower were a little too thin—fitted perfectly for aligned foamcore, but with slight misalignment of the tower, it was impossible for me to get the tabs in without crushing or buckling the tabs. More clearance is needed for foamcore.

The side view should show the screw holes for mounting the motors, but they are hidden behind the 3″ diameter wheels.

A detail of the motor mounting, showing the problems I had with having to reglue the parts several times—the glue kept the pieces from fitting properly after a while.

The motor mount was constructed with tab-and-slot construction on the very edge of the board, so that the wheels did not have to pass through wells. This turned out to be a poor choice, as the hot glue joints were not very strong, and repeated regluing ended up with thick layers of glue that spoiled the alignment.

In future designs, any parts that need to support weight (especially cantilevered weight like the motors here) will have slots that surround their tabs on all 4 sides (a full mortise and tenon, rather than a finger joint) and have bracing on both sides, probably using a crosslap joint. I might also have the tenon go all the way through so that it can be secured by a pin on the other side. I won’t count on hot glue to withstand any tensile forces, and only small shear forces.

I might also design wheel wells, so that when the robot bumps into things, it won’t be with the wheels. I already had trouble with the roach robots rubbing off their wheels if they had too much side force (while sliding along a wall at an angle), so I should have been more more protective of the wheels in this design.

I spent way too much time on this lab fighting the steep learning curve for SolidWorks.  It has a very arcane interface, where buttons do very different things depending where on the screen you are and what mode you are in.  Undoing things is difficult, and I frequently had to scrap several hours work and start over, because I could not figure out how to  reverse some poor early choice I  had made.  I’ve used a lot of software with bad interfaces, but SolidWorks has one of the hardest-to-learn interfaces I’ve ever been stuck with.  Despite the numerous features that SolidWorks has, I would never pay money for it—it is an experts-only tool, and I don’t want to spend the years it would take for me to become expert enough for it to be of value to me.

Next Page »

%d bloggers like this: