Saturday, October 12, 2024

Day 12: Testing the Sensors

I realized that it would be nearly impossible to test every part of the robot at once, so I removed the ROM and processor and just focused on the sensor selection from the MC14512 8-Channel Data Selector. This IC takes an address from the upper 4 bits in the ROM and selects one of the inputs during a read cycle. I was so excited to see everything work the first time that I had to share:

Friday, October 11, 2024

Day 11: NOT an Assembler

So, I am getting to the point where I really need some firmware to test out everything and get the breadboarded control system running. The instruction set on the MC14500b is delightfully simple:

It is so simple that I expected that could just write out the control program in hex machine code and I would not need any sort of assembler. In fact, I specifically wanted to avoid writing an assembler to keep the project moving. Well, looking back and forth at the manual to pick out hex codes got old quick. So then I thought I would just write a quick shell script to convert the mnemonics to hex, then, of course, I would want it to ignore comments and output in a listing format OR a binary... Pretty soon I had a useful tool that was NOT an assembler, because if it was an assembler, that would mean I got distracted from building a robot today. (There is a python script to do this in github, but my personal experience with python is that it takes longer to figure out all the dependency and pip version conflict errors than to just do something manually. There is only so much diversion I can justify.) #! /usr/bin/env bash # a145.sh # Simple mini NOT assembler for MC14500B Industrial Control Unit # Example input file contents: : ' ; MC14500B ICU code example LD 1 ;LOAD SENSOR 1 STATUS ANDC 2 ;AND /SENSOR 2 STATUS AND 3 ;AND SENSOR 3 STATUS STO 1 ;IF 1-3 ARE ACTIVE, TURN ON LIGHT NOPF F ;RETURN ' # Listing output : ' 0000: 11 ;LOAD SENSOR 1 STATUS 0001: 42 ;AND /SENSOR 2 STATUS 0002: 33 ;AND SENSOR 3 STATUS 0003: 81 ;IF 1,/2,3 ARE ACTIVE, TURN ON LIGHT 0004: FF ;RETURN ' # Hexdump (| xxd -c1) of binary results: : ' 0000: 11 42 33 81 FF ' # Process: # 1) remove comments # 2) replace mnemonic with hex nibble # 3) insert hex line/byte number # 4) use tee to view the hexdump, and .. # 5) use xxd to turn it into a binary # Set BYTES to width of the program memory in bits divided by 8 BYTES=1 LIDX=0 sed -e '/^ /!d' \ -e "s/ *NOPO */0/; s/ *LD */1/; s/ *LDC */2/; s/ *AND */3/" \ -e "s/ *ANDC */4/; s/ *OR */5/; s/ *ORC */6/; s/ *XNOR */7/" \ -e "s/ *STO */8/; s/ *STOC */9/;s/ *IEN */A/; s/ *OEN */B/" \ -e "s/ *JMP */C/; s/ *RTN */D/; s/ *SK2 */E/; s/ *NOPF */F/" \ $1 | while read n; do printf "%04X: $n\n" $LIDX; LIDX=$(($LIDX+$BYTES)); done \ | tee /dev/tty | xxd -r An array or hashtable probably would have been better for all those sed command opcodes, but this was quick and dirty.

Thursday, October 10, 2024

Day 9-10: Losing Momentum

Ok, THIS is why I don't like breadboarding. Total loss of momentum. But to be fair, it has allowed me to replace some components easily. I previously ordered the MC14099 Addressable Latch which arrived today (very quick shipping!), but I am still waiting on the MC14011 NAND gates that will be my "glue logic."

In the meantime, I wired up the switch on the robot chassis and attached the 9V battery terminal more permanently. Along with the addition of some velcro, the battery should stay put now. I am using the unused side terminals on the DPST switch as solder points for my ground and 5V... I hope that isn't a dumb decision but I can't see how they would ever short.

Tuesday, October 8, 2024

Day 8: Minimaler ICU System

While trying to wire up this breadboard, I realized that I had already made enough changes that it probably warranted another schematic. I mentioned in a recent post (Day 6) that the MC14599 addressable latch in the "Minimal ICU System" schematic in the MC14500b Handbook is only used as an output register. Well, I realized that is not true. One of them is used as register that the processor can read and write to, like RAM. Well, I don't need that part because will be connecting some lines of my data selector to the output register, giving me a couple bits of RAM for free, since I am not using all of the input or output lines. Between this change and my decision to use the more affordable MC 14099 addressable latch, I had made a lot of changes to the control logic. So, an updated schematic was in order. I didn't want to start a schematic from scratch, so I just edited the schematic in the handbook today:

Simplified ICU schematic
This simpler ICU system is my "Minimaler ICU System". It doesn't show every connection, but it will definitely help me complete my breadboard wire-up while I work out the details.

Monday, October 7, 2024

Day 7: Breadboard wires.

Breadboard wires, boring, not finished. 'Nuff said.

Sunday, October 6, 2024

Day 6: Some Switches

In trying to figure out the best way to attach this most common of switches, I found some tiny rivets that fit the small chassis holes well. But there is no way I could crush them enough to grab the large mounting holes in switch, so I would need some washers with tiny holes in them too, and I then would not be able to remove it without some grinding. Ultimately, I just decided to carefully drill out the holes to 3/32" which nicely fits a #2-56 bolt. I have plenty of hardware that size. BTW, sorry to the metric people, but these 80's mechanicals for electronics are all imperial. I am reluctant to do the conversions because I am not totally sure if hardware in the size I convert to is available or would work. Lets just say that is a bit over 2mm. Anyway, the edge of the hole is very close to the cut-out for the switch, but it works. Between the TO-3 voltage regulator and the old-school switch, the robot is getting quite a retro vibe. I am not sure that I am really feelin' the red now though.

To fix the counter-rotating wheels, I swapped one wheel onto the opposite axle for the motor, then rotated the motor in the case so that the wires come out in the right spot, and moved the motor mount to the opposite side. Once I realized that my longer motor mount screws were touching the voltage regulator case again, I had to take both motor mounts off and switch the screws around. I guess I could have just swapped the positive and negative wires, but I wasn't sure of the consequences and I didn't feel like soldering. It seems to be set-up properly now, even if the motors are not quite perfectly symmetrical.

red 2WD robot with pretty switch and voltage regulator. Prototyping breadboard in foreground with some wires.

As I was starting to wire up ICU on the breadboard, that obviously counterfeit MC14599 was really bugging me. There just aren't any reasonably priced ones available and there is not a cheap CD series equivalent. Then I noticed on the data sheet that the MC14599 is the same as the MC14099, but the former is bi-directional. That's weird because it is only used as an output register in the "Minimal ICU System" which the MC14099 is fully capable of. I can only speculate that the inverted write select input corresponds better with he MC14500B, and saves an inverter. Well, if that is the only benefit, I am going with a real MC14099, and adding an inverter. Purchased.

Busy connecting wires and looking for my breadboard power supply. I decided to use hot glue to affix the ends of the jumper wires to the breadboard and keep them in place. I think it could use this extra help, especially on a moving robot.

Saturday, October 5, 2024

Day 5: Collecting my (digital) wits

I had a lot of IC's arriving by mail over the last month to prepare to build this robot. I made a few small kits and the rest kind of spread around my work area like chaff in the wind. Having a larger project box earlier on would have been a good idea. So, after getting everything organized, I will start with a breadboard with these components:

Normally, I would just start soldering stuff as it takes a lot longer to put it in a breadboard and then lay it out again for the proto PCB. This project is complicated enough and has a suspect knock-off component, so I will take the time to put everything in a breadboard first. Ideally I would like to use a DM72LS471 PROM for the memory as it is a small dip package, but I don't have a way to program it yet. Instead, the AT28C16 EEPROM will be very easy to program and test with.

On a related subject, my experiment yesterday that resulted in a spinning robot made me realize I needed an on/off switch. Every time I worked on the robot, I wondered what the rectangular cut-out was on the front. Then yesterday, out of the blue, while doing something completely different, it dawned on me that it was for a switch! And not just any switch, one of the most common switches ever. It is a 250V 3A DPST switch that shows up on tons of old tube amp equipment from the 1950s and 60s. In fact, there are 7 of them on the stereo system I am listening to right now. Since they are so common, I had a few tucked away. It didn't dawn on me earlier because it is a huge switch compared to the robot. The fitment (like the TO-3) is a bit off too. The screw holes are so small that I really don't have any nut/screw combos that can fit. Drilling the screw holes out much more is not really possible since they are so close to the switch cut-out. Also the holes in the switch are much bigger. I'll figure something out. I have gotten really good at stripping this thing down and reassembling it...

Breadboard with 5 IC's for testing and some robot parts in the background

Note the switch taped into position. That is probably all I will do today... It is a nice day out!

Friday, October 4, 2024

Day 4: Spinning My Wheels

Spinning My Wheels... and that's a good thing! I had some time this morning before work to grind off the ends of the motor mount screws. They are still fairly close to the ground contact, but there's no way they will touch. Even if they do it's not a huge deal. I found that a 5 position Molex KK 2.54/.100 housing fits nicely across the TO-3 voltage regulator's terminals. So, I wired up a little wire harness to connect a 9V battery to the voltage regulator, then directly to the motors.

Close-up of the Molex connector and shortened screw.

It seems one of the motors needs to be connected backwards so it will go straight!

video of small wheeled spinning around with a 9V battery swinging off the side

That thing flying around the side is the 9V battery hanging on for dear life!

Day 3: Explanations

So, I started right in on this project and didn't really explain much. You can't blame me. That robot chassis had to be built immediately!

My end goal is a line following robot that uses a MC14500B 1-bit processor from 1977 to control it. Now, "1-bit" sounds absurd, but that just refers to the size of the data that it can do operations on. It still uses 4 bit wide instructions, and the address bus and program counter could really be as wide as you want as that is external to the processor.

I won't go into a huge amount of detail on the processeor as there is a lot of good reading available about it:

For my purposes, I will be using an 8-bit wide ROM of some sort. As the instructions are 4 bits wide, that leaves the other 4 bits to do fun stuff like select the input or output registers. Those 4 address bits would give us (2^4) 16 possible 1 bit inputs or outputs to choose from and process. Since I don't need that many for my simple robot, and the standard ICs I am using use 3 address bits, and I am tight on space, I will end up with 8 possible I/O registers to choose from. Four of those will probably be directly connected to each other, providing a tiny amount of memory. For the most part, I will just be copying the Minimal ICU system in the Handbook:

So nothing really revolutionary here. But, I will be adding some additional spooky sounds, and I think I will try to add a fan to make the ghost pop up like one of those inflatable wacky waving arm flailing tube man things! It sounds pretty ridiculous, but so be it!

Just working on the gopher site tonight. Didn't have time to cut off that motor mount screw before the kids went to bed.

Wednesday, October 2, 2024

Day 2: Power Diversions

Intending to start discussing and working on the MC14500B processor board, I had to change plans when I saw voltage regulators in the mailbox this afternoon. These beauties are 3Amp LM323 +5V regulators in a gorgeous TO-3 package. They scream vintage electronics! No modern switch-mode power here, just the tender warmth of a linear regulator. In a weird stroke of luck (or an odd feature), two mounting holes in the chassis and the large cutout in the middle fit the TO-3 package almost perfectly.

TO-3 package regulator resting on the robot chassis

Even if you are not familiar with the TO-3 package, you might quickly notice that there appear to be only 2 terminal pins for a transistor or regulator that typically has 3 pins. For purposes of our 9V to 5V voltage regulator, we need input voltage (9V), output voltage (5v), and common ground connection. The TO-3 package supplies each of these, but the ground is provided by the metal case of the device. As a result, unless we want the robot chassis to be at ground potential, the regulator and its screws must be isolated from the metal mounting plate by some insulators. Unfortunately, the chassis screw holes are not quite big enough for the insulators and I drilled them out to 11/64". Of course, that meant I had to disassemble everything first. So once everything is insulated from the chassis, you still need to make the connection to the case of the TO-3 component with a little eye lug terminal on one of the machine screws holding everything together. It is all delightfully mechanical.

I was so proud of myself and thinking that I might get to hook up a battery to the voltage regulator, then directly to the motors and give it a (uncontrolled full speed) test run. Not so fast... as I was putting everything backtogther, it was clear that the motor mount screws were just barely touching the voltage regulator screws. It probably would not be too big of a deal to just have everything grounded, but it took the wind out of my sails. Too late at night to use power tools to shorten the motor mount screws.

horizontal motor mount screw barely touching the grounded mounting nut

Note the flat white plastic insulator that extends through the holes in the chassis (middle to left of photo), the grey silicone(?) insulator on the other side (barely visible though some of the extra screw holes), the long and thin round terminal sticking through the insulators (extreme lower left of photo) and the metal fittings holding it all together... and of course, the horizontal motor mount screw barely touching the grounded mounting nut.

Parts list once I fix this issue.

Tuesday, October 1, 2024

Day 1.5: Temporal Fraud

After a bit of research, I realized that the QRE1113 "Reflective Object Sensor" (Digital) that I had purchased for the line sensor would not work for my 1-bit robot. Although it is advertised as "Digital" it requires a microcontroller to charge up a small capacitor and time how long it takes to discharge - "the faster that capacitor discharges, the more reflective the surface is." What, what? Timing a discharging capacitor is not "Digital". I don't even know what that is... "temporal" maybe? The advantage is that you get a gradient input, and you would test for your cut-off (on vs off the line) in software. But there is no way I can do that with my 1-bit MC14500b processor. I could rewire the sensor to be the same as the analog version, then send the signal to a comparator circuit, but I really don't wnat to get bogged down in that during the short time I have dedicated to work on this.

Fortunately, I found a standard sensor board that includes the comparator circuit and will give me a nice adjustable "1 or 0" binary output (or analog if I want). It's certainly not era-appropriate, but the LM393 comparator circuit is probably not too different from what might have been used back in the day.

TCRT5000 IR Photoelectric Reflective Sensor, front and back.

After getting new sensors ordered, I went to work on the output driver board. I basically copied a circuit I found online for driving small DC motors and duplicated it four times. I know I will need two drivers- one for each wheel, and maybe one more for the sound/light board, and I added a fourth just because it all looked so tidy that way. I still need to get a piece of metal for the heatsink, finalize the layout and get it soldered down. I used TIP110 transistors because they were cheaper and could handle more than enough current to drive the 1.5Amp max power (stalled) requirements of each motor. For a modern build, a MOSFET like the IRFZ44 would be better choice and would have an even simpler circuit. I bought some MOSFETs to test out and if I get this running I will make an interchangeable 'modern' driver board. Note the shrouded connector that will help orient the ribbon cables carrying 9V, 5V, GND and input signals. I also added some jumpers to select whether to use +5V or +9V output voltage.

Pencil drawing of the driver board layout and the assembled, but not soldered, board.

Stay Tuned for some more thorough exposition and background once I start working on the MC14500b processor circuit.

Current Part List:

Chassis
Input
  • Line Sensor Breakout - QRE1113 (Digital)
  • TCRT5000 IR Photoelectric Reflective Sensor
Output
  • 4 x TIP110 Darlington Transistors
  • 4 x 2.2K resistors
  • 2x5pin shrouded header, Murphy's Surplus
  • Single row straight pin header, cut to 4 pieces with 3 pins each

Day 1: A late night

I stayed up late to start the RetroChallenge right at midnight. I have been itching to put that robot chassis together! It assembled pretty well, but I have to admit it was a bit daunting to get it together and realize that there are no more instructions from here on.

After the chassis was assembled, I test fitted the proto PCBs that I intend to use. I hope to fit everything on three modular boards: 1) the MC14500b system; 2) medium power switching outputs; 3) sound and lights.

Unfortunately, I see that I am going to have some issues with this setup. There are a lot of mounting holes on the chassis for common 7x5cm (or 7x7cm, or 3x7cm ) PCBs, but they dont align quite right (I assume it is probably my PCBs at fault). Since most of the hardware I have (besides the robot chassis) is not metric I had to open up the holes in each of the proto PCBs a little bit to fit my standoffs. That helped the alignment with the holes in the chassis, however the holes I need to mount PCBs are directly over and blocked by the motors. My screws simply won't fit there. I will probably have to counter-sink the chassis to accept some flat-head screws in the future. Those standard "Radio Shaek 2" 5x7cm power bus proto PCBs need to be rotated 90 degrees and only fit on 2 of the chassis holes, but I don't think I will be using those.

Next I test fitted the light sensor for the line follower. I looked into the data sheet a bit more and I think I am not going to be able to use this "digital" sensor. I will post details to come once I have some time to figure this thing out.

That's it for now, maybe I will make some progress tonight.

Current Part List: