Gas station without pumps

2017 November 29

Our new kitten, Marcus

Filed under: Uncategorized — gasstationwithoutpumps @ 14:54
Tags: , ,

On Black Friday, my wife went shopping for a new kitten, to replace the cat that died about a year ago. We ended up with Marcus, who was being offered for adoption by volunteers at the local PetSmart (they weren’t sure which shelter he was coming from—probably not the closest one).

He’s been inspected by the vet and is being treated for ear mites. He also has a minor virus infection, so we are keeping him away from our older cat for a while, and being careful to wash hands between petting the cats.

It was hard to photograph Marcus, because he would not stay in one place long enough for me to frame and snap the photo.

I did manage to get one shot of Marcus in an uncharacteristic resting position.  You can just see the smudge of lighter fur on his throat.

Marcus reminds me a bit of Freya, a kitten we had 10 years ago—I just hope that Marcus is healthier and lives longer than Freya did.

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 27

Power board soldered

Filed under: Robotics — gasstationwithoutpumps @ 13:26
Tags: , ,

This morning I managed to fix the problems that I had created for myself by my mistakes in soldering yesterday.  The power board is  now soldered and passes continuity tests (no adjacent pins shorted, all header pins connected where they are supposed to be.

Finished board, with annotation for the header pins. The whole board is 5cm×7cm.

The power board has several functions:

  • The pair of H-bridges for the motors, powered directly from battery power input at the lower left, and controlled by PWM and DIR signals from the Teensy board (header pins at the top). The motor output wires are red and white header pins on the left side of the board, to match the red and white wires on the motors.  The two motors have red and white with opposite M1/M2 connections, so that matching DIR signal drives the motors in opposite directions.  Because the motors are mounted with shafts in opposite directions, this should result in the wheels turning the same way.
    There is a row of header pins on the right (input side) of each H-bridge, for hooking up oscilloscopes or other test equipment.  The EN– signal could be shorted to GND with a shorting plug, but the documentation claims that there is a pull-down resistor internally, so floating should be fine.
    The VM pins of the H-bridges have 220µF electrolytic capacitors as bypass, to reduce PWM noise from propagating back through the battery.  I was planning to add 10µF ceramic capacitors at the Vin pins, to reduce high-frequency noise, but I ran out of room.  If the high-frequency noise is a problem, I can try to squeeze in some bypass capacitors.
  • NCP7805 5V 1A regulator (bottom center).  All the red and black pair to the right of the motor control are 5V and GND.  The GND pin of the regulator is the only place where the 5V and battery power systems are connected.
  • The multiplexer connects one of the 8 white pins on the top right to the “out” pin, controlled by S2, S1, and S0. Up to 8 tape sensors can be connected with standard 3-wire servo cables.
  • The 8 yellow pins are not connected to anything—they are there just to provide alignment for servo cables sending 5V power to other boards.  I may not need any of these connections, as the Teensy board can be powered from the 5V and Gnd connections adjacent to the motor signals and tape-sensor signals.
  • There are also 4 pairs of yellow pins just above and to the right of the regulator.  These are intended for gathering the encoder wires from the two motors and transferring them to a single cable up to the Teensy board.  The power and ground connections there can also be used for the encoders.

This board will have a mass of connectors to it:

  • battery (3-wire servo cable)
  • motor connections (4 separate wires)
  • motor encoder connections  (8 separate wires: +5V, GND, ENC1, and ENC2 for each motor)
  • motor cable from Teensy (4 wires or 6 wires, depending whether 5V and GND included)
  • tape-sensor cable to Teensy (4 wires or 6 wires, depending whether 5V and GND included)
  • encoder cable to Teensy (4 wires)
  • tape-wire sensors (3-wire servo cable to each sensor)

I still have to lay out and solder the carrier board for the Teensy, but that should be relatively easy, as I don’t have nearly so many wires and I only need to populate a few of the connectors.

2017 November 26

Soldering failure

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

I am in a really bad mood—I’ve wasted an entire day soldering today, with nothing to show for it at the end.

I’ve been putting off soldering up some of my circuits, because I really hate perfboard soldering.  I don’t mind soldering PC boards (though I have a lot of difficulty with surface-mount components, so generally only use through-hole parts), but the need to make solder bridges and add extra wires makes perfboard soldering slow and frustrating.

I finally laid out my power board and started soldering it up today. It was going slowly, but not too badly, and I was 4 wires from the end of the job (after many hours work) when I saw that there were 5 posts left for the 4 wires—something was badly wrong.  I checked carefully, and found that I had put an 18-pin socket in where I needed a 16-pin socket.  I had two choices—leave the 18-pin socket in place and just put the chip in the end of it (with some risk of putting the chip in wrong), or replace the 18-pin socket with a 16-pin one.

I made the mistake of trying to unsolder the 18-pin socket to replace it with a 16-pin one. As I should have expected, I could not get the 18-pin socket out of the perfboard, and my attempt to do so made it nearly impossible to use the perfboard (some rings delaminated without releasing the pins, some of the pins of the socket are now too short to connect wires to, …).

My plan for today was to solder up two boards: the power board and the processor board, so that tomorrow I could start debugging my motor-control code. I’ve come to the end of the day and I have made essentially no progress (possibly negative progress, as I may not have enough spares to make the power board from scratch tomorrow).  I’m not going to try to do anything more tonight (except sleep, which will be a bit difficult given how frustrated I’m feeling).  In the morning, I’ll see if I can resolder the board to use the 18-pin socket, or whether I have to scrap it entirely.

If I take up making robots as a hobby (which I’ve considered), I’m going to do things at a somewhat slower pace, so that I can design PC boards rather than deal with the f***ing perfboard soldering.  I don’t care if it would add three weeks to a project to do a PC board—perfboard soldering is so frustrating that I would never finish a project if I had to do a lot of it. There are other prototyping possibilities besides PC boards and perfboards—for example, Adafruit’s Perma-protoboards or stripboard.  I’ve used the Perma-protoboards, and they are much easier to work with than perfboard, but I don’t have the space in my robot for a full size one (even if I had one at home to build on).

There are only two weeks left of the quarter, and I’m going to have to make a decision soon whether to finish a part of the project (I’ve already given up on the ball launchers) or to drop the whole project and go back to work on my book, which is now several weeks behind schedule.  I had hoped to build a reusable base that I could use for other robotics projects, even if I had nothing that could compete in the mechatronics competition, but even that is beginning to look like it will take more time than I can afford to spend.

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.
Next Page »

%d bloggers like this: