In Log #4 I described the process of getting the HUGS protocol running on the hoverboard. Once I had that under control I needed to think about what my first Human Machine Interface (HMI) was going to look like.
My first test platform was going to be a Jenx Multi-Stander, which is basically a complex collection of framework and padding on wheels, designed to provide support and mobility to a young child with minimal muscle strength or control.
I considered different input options, and finally decided on an arcade joystick with limit switches. I chose this in lieu of an analog joystick because a child with reduced fine motor control will not gain much benefit from a proportional controller, and a switch based joystick will be very robust. My ultimate goal is to generate some smart motion profiling based on observed control behavior.
The next question to resolve was should the input device be wired to the hoverboard, or should it be wireless.
Since we live in a wireless world, so I thought I'd run down this road until I hit a roadblock.
The ESP32 supports WiFi and Bluetooth. Bluetooth is cool for low power devices, but once I started looking at the software required to get point-point working, I was a bit discouraged. Then I discovered that Espressif (make of the ESP family) has a pre-built WiFi protocol for interconnecting their chips.
It's called ESPNow, and there is a sample project in the IDF to show how it works. I implemented espnow on two ESP32 dev kits, to see how well I could transmit joystick information wirelessly. The implementation went pretty well, but I ran into other problems.
So far I had been using the 5V supply that the motor controller board was providing to run my embedded HMI processor. This power was convenient because it was one of the pins on the UART cable. Unfortunately whenever the ESP32 started using WiFi, this supply got squirrely (a very technical term). It seems that the ESP was pulling too much current to be supplied from a single motor controller. As long as both of them were powered up, everything worked fine, but during startup or shutdown when only one might be providing power, the ESP got erratic and it would not always recover... This left the hoverboard in a bad state where it would not power up or down properly.
So, in the end I decided that I didn't need wireless that badly, and I decided to go down the tethered joystick road. Although I did not end up using espnow, if you want to see how it works, there is a espnow branch in my ESP HUGS repository.
Ultimately I prefer the tethered approach. This way there are no "pairing" issues or loss of control due to interference or low batteries.... and no batteries. You also can't lose the joystick because it's connected. I was able to pull the power switch out of the hoverboard case, and replace it with a rubber grommet that protected the robust 6 conductor cable that I ordered.
I also decided on a smaller switch-based joystick. I mounted it in a small plastic box, along with the relocated on/off switch. Now I finally had all the controls I needed. Next up is refining the motion controls.