Monday, August 5, 2019

Machine learning does exactly what you tell it to

This list of published machine learning fails is pretty entertaining. There are a few classes of errors:
  • agents exploiting bugs in physics simulations;
  • underspecified objective function results in a useless result;
  • in one terrifying case, overcoming a physical limitation: "A robot arm with a purposely disabled gripper found a way to hit the box in a way that would force the gripper open"

Monday, June 3, 2019

Project log: Smart robot car (part 2)

Over the years I've ordered many dev kits. So far I've only used my Arduinos and Raspberry Pis.

But today is the day: I'm firing up an ESP8266 mini.

This ended up being non-trivial.


End result: no success while trying to avoid curl | bash. I'll have to resort to that.

Sunday, June 2, 2019

Project log: Smart robot car (part 1)

I decided it would be fun to do some computer vision + robotics. Why not a smart car?

The first step was to get a car chassis that could be controlled by microcontroller. A quick stop at Amazon and Adafruit got me a chassis complete with motors and wheels and a motor driver.

Assembling the chassis was straightforward, but the next step was controlling the motors using a microcontroller. I'd want wireless control eventually, but first I wanted to work with a familiar MCU. So I pulled out an Elegoo Arduino Nano and wired things up with the help of Adafruit's tutorial:




I had a dual motor controller that could provide ~1A/channel; four wheels/motors, each drawing up to 1A; and a 12V battery pack that could only supply 2A. I wired the wheels on each side up in serial. That should result in the two motors on each side splitting power, so the driver isn't overloaded.

I started off stripping individual wires to size, but when I got to the actual signal wires I decided it was going to be a little messy regardless, and it was temporary anyway. Once the 12V power supply and motor wires were in (had to add in some male-to-female jumpers for those because the wires I added were too short!) it really was a mess.

It was about this time that I decided I should put in an order for a Wemos D1 motor shield, so I'd have the option for simpler wiring later on. It'll take 2-3 weeks to get here, but I've got the Adafruit breakout in the meantime.

With a bit of code stolen from The Blaster I was manually flipping bits to control motor direction in no time. To simplify things a bit for the future, I added a new header with a TB6612 class. This class provides forward(), backward(), short_brake(), and stop() methods that flip the appropriate bits. No PWM support for now.

Next, switching to an ESP8266 or ESP32 for WiFi, so the car can be controlled remotely.