Self-contained and smoke

A day of highs and lows. Here’s Kieferbot still in teleop mode but now self contained:

The PinePhone is taking commands from a PS4 DualShock over Bluetooth using ds4drv and sending them to the IO board over serial. I experimented with a few transports:

  • UDP over Wifi was fine, but the default ESP32 Wifi power mode added random latency of up to 100 ms. Switching to ‘always on’ mode by modifying MicroPython fixed this.
  • Bluetooth Low Energy worked for one-way communication to the IO board, but there was lots of packet loss when using Bluetooth for both the joystick and IO.

Inspired by Firmata, I settled on MIDI over serial. I quite like the MIDI format for short messages. A frame starts with the command followed by a command specific payload. The command has the MSB set so it’s simple to frame.

I also compiled ROS Kinetic for Debian Buster and created an IO node that takes left and right velocity commands. There seems to be an ordering issue with either the ESP32 PWM chip or the FIT0441 controller, where going from forward to reverse and vice-versa is fine but the motor won’t start sometimes when going from zero.

So plenty of highs, but the low was releasing the smoke - I’m using a LiPo battery for the supply and something short-circuited when unplugging the battery. It seems to have taken out the regulator and the ESP32 flash.

Next step is to re-make the IO board using an ItsyBitsy M4. It also runs MicroPython so the IO software was easy to port. I’ve ordered some Seeed XIAO boards - $5 gives you a MicroPython compatible SAMD21 with 9 pins of IO which is enough for this project.

This time I’ll secure the battery socket better and 3D print a shield.

Avatar
Michael Hope
Software Engineer

Related