And things were going so well.
I spent yesterday printing off and installing the battery mount. It’s the same design as the one I put onto old Spot X, but modified to fit the new battery packs I’m using. It’s not a fantastic design but it works.
I also finished a little bracket to mount the OLED display. I needed to get the battery mount installed before figuring out where I could fit the display. The bracket is made of a couple of pieces of acrylic glued together at an angle with the OLED mounted between them. Maybe there’s a picture.
Once the battery and display were installed I connected up all the other cables to the main board, except the cable to the motor driver. When I switched the robot on, only one bumper LED lit up. That shouldn’t have happened. So I reversed the cable to the wrong position and all the LEDs lit up, except for the one that had lit up before.
Clearly I’d gotten the polarity wrong (or right) on one of the LEDs. The orientation of the connector to the sensor breakout board is easy to remember at the main board because positive goes to the rear, but I wasn’t sure which way round the connector should be at the breakout board.
It’s hard to make out the details of the circuit because the plastic sheet is covered in tiny dots. So I hunted round for a spare PCB that I haven’t made up because the traces are broken and when I couldn’t find that I opened the design file. Sure enough, the cable had been plugged in the right way round the first time when only one LED lit up, except that that wasn’t the problem.
In laying out the tracks for the breakout board and the bumper PCBs, I had reversed ground and +5v by getting pin 1 wrong on the modular connectors. So it’s because the wiring to the connectors is wrong that none of the LEDs worked, except for the one that was, in fact, soldered in incorrectly.
I marked the orientation of the connector now, in the reverse of what I’d intended. That’s actually really important, because getting it wrong will apply 5v to the inputs of the Pico when the bump switches are activated. So far so manageable.
Except that I’d also noticed that the Pic chip was running hot when I applied power to it. I mean, I should have realised straight away, but instead I was like “hmm very interesting, maybe it will cool down in a bit.”
By this time I had pulled out the main board, intending to examine it for faults. When I returned to it after figuring out the problem with the sensor breakout board I immediately noticed that the chip was in the wrong way round.
I checked it out in icprog, but it was non responsive, so scratch one PIC chip.
It was at some point in all of this that I heard a little ‘snap!’ from the robot and, yep, there was smoke. I’d left the power on and the motor controller was burning itself out. The reason is a known issue. When the motor controller is powered on with the motors connected, but no connection to the control lines, the FETs can be stuck high and that’s bad, really bad.
One of the FETs is cracked, discoloured and all the glue has melted out of it. I don’t think any of other FETs were damaged – well, they don’t look damaged. I thought to myself, I should add pulldown resistors to the design so that if the inputs are left unconnected, the FETs won’t stick on high.
I hunted around for the design and, no, it’s nowhere to be found. It must have slipped between the cracks somehow and got lost. So I checked my transparencies and located the design. And the design I found has the pulldown resistors! I hunted in my box of PCBs and found a spare board with the same design that I’d etched but not constructed. I knew there must be at least 2 of the boards because there were 2 on the transparency, so I checked old Spot X and sure enough, it has the safety resistors.
I remember making a change to the PCB years ago. I must have built a couple of unsafe modules and then built a safe version.
Anyway. I’ll build the spare PCB and install that in the robot.
Then I started organising my thoughts around software for the different modules on the robot and came to the sudden realisation that I couldn’t use CircuitPython because I need multi threading to run the web server on one core while the roboty bits are run on the other core.
That led to several hours of hunting down MicroPython libraries for the OLED, the HCSR04 and the Servo. There are rangefinder and servo functions in the Picozero library and a few options for the SSD1306. I’ve got the display working fine under MicroPython, except for image display.
So there we have it. The robot is in bits, the software is up in the air, I have more soldering to do and sometimes I think this is why I would not have been a good engineer.