Drive-by-wire Crazy Cart

A very delayed write-up for a side project completed back in 2018. Published August 2024.

After having the privilege of visiting BajaBoard in Melbourne, Australia in December 2017, and riding one of their awesome boards, I was inspired to see what I could build for myself.

My goal was to spend as little money as possible on off-the-shelf parts to build an electric vehicle I could ride.

The first version of what I'd started dubbing #deathtrap was built from a converted ratty skateboard with a drive unit designed for electric scooter conversions wedged into the back of it.

Powered by 2 12V 2.2AH SLA batteries wired in series with a basic toggle switch for motor control.

I wasn't brave enough to try riding it while standing up, but here's a POV video of one of the few sitting test runs.

Next I started testing some different frame and body ideas. The drive units were never designed for this purpose in mind so finding ways to attach them to a framework was an interesting engineering challenge.

This 3 wheeled version looked cool, but wasn't practical for holding the batteries, let alone space for me to sit or stand on it.
Barely worth a mention, but the chipboard snapping as I sat down on this version gave me a surprise followed by a good laugh.

After a trip to my local hardware store for some aluminium square tube and other supplies I started work on a bigger version.

Here I used a workshop dolly with 2 casters removed and a drive unit on either side for differential speed steering via toggle switches.

The test runs were going well, with a measured top speed of 10km/h (~6mph), before the toggle switches burnt out from the rapid high current switching.

With my hopes and adrenaline running high from the test rides, I decided to get more serious and purchased 2 DC speed controllers. These controllers could not only handle higher voltages and required current draw, they could be adapted to accept PWM input from an Arduino Uno motor controller shield.

Over about a month, mostly on weekends, I taught myself how to write the Arduino firmware to first accept PWM signals from an RC plane receiver and map them into PWM signals for the speed controllers.

I essentially made a giant RC car for testing my control systems.

In the following 5 months I built and tested various frame designs, drive chains, and steering methods.

I really wanted to keep the design as close to a real go-kart design as possible, but with a limited budget and not the best engineering skills at the time this wasn't realistic.

Slightly disheartened, I left the mechanical side for a while and turned my attention back to the electronics and control systems. This was when my brother came to the rescue by gifting me his unused Logitech Racing steering wheel and pedals!

By linking the Logitech kit up to a Pi Zero running a Python script and using pygame’s joystick helper I was able to map the accelerator pedal and steering wheel positions to the equivalent speed of each drive unit for differential speed steering again.

Connecting the Pi Zero to an Arduino Uno via Serial gave me all the components required to use a drive-by-wire system to completely control and steer the final version of the #deathtrap, now a front-wheel drive twin motor crazy cart.

While the final design was robustly built, could hold my weight, and could move under its own power it did have some negatives:

  • The drive units were very underpowered (and under specced) for the job I was expecting them to do so they had very low torque.
  • The low amp hour batteries required frequent recharges.
  • The control loop for the drive-by-wire system was too slow. There was a minor but noticeable delay between turning the steering wheel and the motor speeds changing. Looking back on the old code, this delay could have been a result of either the code loop in Python or on the Arduino running slow, or simply because I was using a lower baud rate between the 2 devices.
This project was finished up and components stripped down from the crazy cart by the end of June 2018 as I was moving interstate. I did keep the drive units, speed controllers, and the seat just in case though…