Gas station without pumps

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 18

Four tape sensors made

Filed under: Robotics — gasstationwithoutpumps @ 15:01
Tags: , ,

I decided to make the tape sensors be as simple as possible, without switching the IR emitter on and off.

The tape-sensor boards have three ports: power, ground, and voltage output. The 220Ω resistor means that about 10mA is used at 3.3V and 18mA at 5V.

I soldered up four copies of this design today (all the TCRT5000L parts I had—I’ve ordered more that should be here early next week).

The three ports are color-coded male header pins on the top of the board. The TCRT5000L is mounted on the reverse side of the board.

I drilled holes for M3 bolts in the corners (the perfboard came with M2 holes) on the corners of  a 0.5″ by 9″ rectangle. M3 may be a bit big, but I only thought of that after drilling one of the boards.  I have both M2 and M3 bolts, and I also have M2 screws, which I’ll be using for fastening servo horns to MSF—I could have used M2 screws for mounting the tape sensors also.

The initial design was a little bit smaller, as I have 22kΩ resistors that are the same size as the 220Ω resistors here, but I had to squeeze in the larger 10kΩ resistor on the first prototype I made when the 22kΩ resistors proved to have too much gain at some distances from black electrical tape, so I ended making the whole thing be longer than necessary.  The boards are about 20mm by 34mm, but I could trim them down if needed to about 14mm by 28mm (and cut off the corners that don’t have mounting holes).

I tested the boards after soldering them, and they all seem to be working.  This design is only good for robots that run very close to the floor—the working distance for sensors as digital sensors is less than about 1.4cm.  (Analog sensors with synchronous sensing could probably go to 5cm or more, using one of the designs in Tape sensors).

2016 April 28

Revised microphone pre-amp lab too long

Filed under: Circuits course — gasstationwithoutpumps @ 23:47
Tags: , , ,

How many of my posts have the theme “lab too long”? (answer: too many)

I spent 10 hours in the instructional lab on Tuesday and 11 hours today (Thursday) helping students do the microphone pre-amp lab, and my group tutor is going to have to open the lab on Sunday for several students to finish soldering and testing their boards.

This means that the lab is between 1.5–2× longer than it should be.  You’d think that I would be able to predict the length of a lab better by my fourth year of teaching this course!

What went wrong, and how can I fix it for next year?

  • The design is somewhat harder for the first op-amp lab than in previous years, because I made a decision to do all the op-amp labs this year with a single power supply, not dual supplies.  That makes for a slightly more difficult start, but students don’t have to make the transition from dual supplies (which are getting quite rare these days) to single supplies. The transition is a surprisingly hard one for students to make, as the simplification that they learned for the case when the reference voltage is zero no longer apply, and they have to learn everything over again.  Learning the more general form first will, I believe, result in less confusion in the long run, but it does make for a slightly more complex first project.
  • This year I’m having students solder their pre-amp boards, so that they can re-use them as part of their class-D power amplifier in three weeks.  This was a deliberate choice, to reduce the amount of effort in the class-D lab, which was running too long in previous years, but it roughly doubled the time it took students to finish the lab.
  • Because students had larger ceramic capacitors this year, and I had them set the high-pass cutoff frequency near their speaker resonances, some students opted to use very large capacitors and small resistors for their high-pass filters. This made a very small impedance in the passband, and attenuated the signal from the microphone and its large-impedance biasing resistor.
    I’ll have to put a warning in the book about the high-pass filter needing to have a larger impedance than the bias resistor, to avoid changing the current-to-voltage conversion.
  • Some students had the opposite problem, putting a small capacitor with a very large resistor, so that there was a very high impedance signal driving the input to the amplifier. Since we are using op amps with tiny bias currents, this is not a problem for the circuit’s functioning, but it made looking at the signals with the oscilloscope difficult—increasing the difficulty of debugging.
  • Many students were surprised to see that the output voltage was not centered at their Vref voltage.  This provided a teaching moment for looking at the MCP6004 data sheet and explaining the notion of the input offset voltage. Because they were using gains of 100×–300×, the ±4.5mV offset became an output offset of ±0.45V–1.35V, sometimes resulting in serious clipping.  I need to warn students about that imperfection of op amps before they do the design.  A better design would use a multi-stage amplifier, with high-pass filters between stages to get rid of accumulated DC offset.
  • I suggested to several students that they look at Vout vs. Vin, by recording a slow sine wave (say 300Hz) at 5kHz sampling with PteroDAQ.  This turned out to have some interesting effects when students used 32× averaging, because the time delay between the two channels was enough to get the signals far enough out of phase to open up the plot into an ellipse. Again, I’ll need to talk about that in class tomorrow.
  • Lots of students made the mistake of incorrectly applying Ohm’s Law and getting too large a bias resistor, so that their microphones were not in saturation at the power-supply voltage of 3.3V.  Luckily, increasing the voltage to 5V (as we will do in the power-amp lab) will rescue their designs.
  • Lots of students made the standard mistakes of skipping a wire or two, or putting a wire in the wrong hole while soldering, but a surprisingly large number connected both nodes for a resistor to the same end of a resistor, leaving the other end unconnected.  I’ve not seen that mistake before, so I don’t know what triggered it.
  • The lead-free solder we have to work with this year (99.3% Sn, 0.7% Cu) is a pain to work with—it doesn’t tin the soldering irons well, and it is difficult to remove from the boards in the event of a mistake.

I think that the soldering lab should not be the first op-amp lab, but I still like the idea of the students having to solder up their microphone preamps. So I’ll have to do a major reorganization of the book this summer, to move a different lab into the first position.

Currently, I’m thinking that the transimpedance amplifier and pulse monitor lab would be a good choice as the first op-amp lab.  It would be a bit unusual to start with a transimpedance amplifier rather than a standard voltage amplifier, but the transimpedance amplifier is actually conceptually simpler.  Unfortunately, the pulse monitor using a transimpedance amplifier really needs to be 2 stages, with a transimpedance amplifier to bias the phototransistor, a high-pass filter, and an AC gain stage.  (Yes, I know I’ve posted about pulse monitors without amplifiers, but a major point of the lab is to teach about transimpedance amplifiers.)

The corner frequencies for the pulse monitor are really low, requiring big resistors even with their biggest capacitors, so the “too small a resistor” problem goes away, though not the “too big a resistor” problem.

By making the microphone preamp the second, or even third, op amp lab, students will spend less time on getting a breadboarded design working, and more time on learning to lay out and solder their circuits. They’ll also be much more amenable to a 2-stage design, to reduce the output offset voltage.  I think that rearranging the labs may be worth the effort it will take to rewrite the corresponding chapters of the book, but undoubtedly something else will go wrong next year, and I’ll have to do yet another major revision.

Ah well, at least I’ve gotten the demo for tomorrow’s class (blood and breath pressure) working tonight, and I’ll be able to get to bed before midnight.

2015 March 31

First lab for Spring

Filed under: Circuits course — gasstationwithoutpumps @ 21:50
Tags: , , , , , ,

I had a very long day today (as I expect all Tuesdays and Thursdays to be this quarter).  It started out with me in a panic, because I had gotten a message late yesterday afternoon, telling me that the parts kits for the course were not ready yet, but not telling me what was available, so I didn’t know whether I’d be able to run today’s lab or not. I thought I probably would be able to do the essential parts, because the main part of the lab was soldering headers onto the KL25Z boards, and the boards and headers were ordered from Digi-key, which has very fast delivery (thanks to their almost instant packing of parts for shipping and their using the post office rather than FedEx, which has been unbelievably slow this year).

I went into work a bit early this morning to check on what parts were available (after a night of thinking about what labs I could do if the KL25Z boards were not available—pretty much only the thermistor lab scheduled for next Tuesday, and that takes about an hour of setup to prepare the lab and have hot water and ice water available).  As it turns out, the person who had informed me of the incomplete parts list had sent out a spread sheet with the information—he’d just forgotten to CC me on it. The KL25Z boards, the headers, and the USB cables were all available, so we could do the main part of the lab.  We couldn’t do the unpacking of the parts kit and identifying parts, but that can happen later, as the parts come in.

For Thursday’s lab, it would be good if they had their breadboards, resistor kits, and electrolytic capacitors—but I don’t know whether those will all be ready by then (the resistor kits haven’t all arrived yet).

Once the boards arrived, I started part of the class soldering (we only had 6 soldering stations, two of which were not very functional, despite my request 2 years ago for enough soldering irons for the 12 benches).  While some were soldering, the rest were downloading the PteroDAQ software and trying to get it to work on their machines.

The soldering went well, with one serious exception.  One student soldered in the connectors on the wrong side of the board, and neither the group tutor nor I noticed in time (and we could have, because we had looked at the board and just not noticed). We helped remove the connectors (removing a 2×10 female header from a board is a lot of work), but the student did not have enough time to get all the connectors replaced by the end of lab.  The tutor will provide some supervision at another time before Thursday’s lab to finish up.  All the solder joints looked clean—I saw neither bridges nor voids.  I did send several students back (more than once) to reheat cold-solder joints, but in the end all the students had good connections.  Since only 2 or 3 of the 32 students had ever held a soldering iron before, I think that getting each to make 64 good solder connections is a pretty positive outcome.  They’ll have 3 more labs this quarter where they will have to solder (their own designs, not just headers), but I think that they’ll approach those labs with more confidence now.

The PteroDAQ downloads were not quite as successful.  I think that everyone managed to get the MBED.ORG download software installed, and transferred the daq_kl25z.bin executables to the KL25Z boards. Most (all?) got PteroDAQ working with the lab computers. But few, it any got PteroDAQ working on their own machines.  There were three classes of problems:

  • On Windows 7 machines, I forgot how to use the mbed-usb-windows.inf files to install Windows drivers for the USB port on the KL25Z board. I looked it up after class before going home and found a page about installing Windows drivers for Arduino boards that seems to have all the right instructions (but use the .inf file in the PteroDAQ extras directory, not arduino.inf):
  • On Windows 8 machines, I don’t know whether the same approach will work, but I hope that some of the students will try. The approach given in the MBED handbook did not seem to work, but I’m not very comfortable with Windows, so I may have missed something obvious to a serious Windows user.
  • On Mac OX 10 machines, we had two problems:
    1. OS 10.10, 10.10.1, and 10.10.2 were not willing to write to the MBED device. This seems to be a known problem that the MBED user community is pretty upset about. The MBED developers have been working (slowly) on the bug since last October, with patches for only a few of their many supported boards (not, so far as I can see, the KL25Z).  There are claims on the developer forum about the bug that OS X 10.10.3 beta finally fixes the bug, but no one in their right mind would suggest that students install Apple beta code on a machine that they plan to use for anything. A student was going to enter an “issue” ticket on the PteroDAQ website, but it doesn’t seem to be there yet.
    2. If the Windows 7 machines in the lab were used to put the daq_kl25z.bin onto the boards, then OS 10.10 seemed to work ok (a student got it running), but OS 10.10.1 and 10.10.2 machines failed.  The problem seemed to be with Tkinter: the selection of the port for the KL25Z was not sticky—it deselected itself within a second of being selected. Some of the students had freshly downloaded versions of Python 3.4, so the problem doesn’t seem to be with old code, though I suppose a Tcl/Tk incompatibility with Python is possible—I didn’t have any of the students try re-installing Tcl.  I hope that a student with an OS 10.10.1 or 10.10.2 machine will post an issue ticket about this issue on the PteroDAQ website also.

    I’m now very glad that I did not “upgrade” my old OS 10.6.8 Mac to 10.10 on my 2009 MacBook Pro—it seems that I would have broken many of the things that I rely on my Mac for. Perhaps I’ll wait until I get new a new laptop before “upgrading”—and I won’t buy a new Apple as long as they don’t work with MBED, even though my current laptop has a very sick battery and is beginning to show its age. (I have no intention of buying a MacBook with only one USB-C port, either: I routinely use the power cable, the ethernet port, the firewire port, the display port, both USB ports, and the SD card port, and often use three or four of these at once.)

It would be really nice to have installation instructions with PteroDAQ—I forgot some steps of how to do the installation on Windows (the driver installation), and it would be nice to have a written description of the steps for a Mac that I could just point students to, rather than walking them through it.

I set up a mailing list for the class this evening, and I hope that students who manage to get PteroDAQ working on Windows 8 or OS 10.10.1 or 10.10.2 will share the information.

Next Page »

%d bloggers like this: