Golf and go-karting would appear to be at opposite ends of the sporting spectrum, but when Mark Cantrill swung by an ageing electric golf trolley, it set the wheels in motion for a rather unique idea.
This article first appeared in The MagPi 84 and was written by David Crookes
Having originally considered using Raspberry Pi to control the trolley and eventually turn it into a Dalek or a rough-terrain garden explorer fitted with a camera, he began to ponder how it could make his life a bit easier.
“I thought I’d use it to power a go-kart and save my back from dragging my kids around the garden,” he laughs. But first he had to figure how to get Raspberry Pi to control the trolley, so, after fitting a new 12 V car battery, he began to look at the device’s radio-controlled mode with a view to reverse-engineering it.
Go, go-kart
“The trolley could be made to go forwards, backwards, left, and right using a five-button remote control, and the fifth button would bring it to a stop,” Mark explains. He soon noted that the radio receiver was a plug-in option, with a seven-pin connector joining it to the main speed-controller micro.
“I thought it would be possible to remove the radio receiver and replace it with Raspberry Pi,” he says. “Since the motor controller on the golf trolley was 5 V, the 3.3 V outputs from Raspberry Pi needed level-shifting, which I achieved by using a 2N2222 NPN transistor. Five transistor-based inverting level shifters were quickly assembled onto a ProtoZero board.”
At this point, Mark began to write the software and he was able to call upon his experience of running MicroPiNoon robots at the Cotswold Raspberry Jam. “The golf trolley had two motors, two wheels, and a front stabiliser, so it was essentially very similar to the MicroPiNoon robots, just a bit bigger.
“All I needed to do was replace the functions that usually control the EduKit 3-compatible PiZ-Moto pHAT with functions to drive the 5-bit output that goes to the golf trolley’s motor controller via the level shifter. I was able to reuse my existing code to do this.”
Be in control
Mark took the enhanced prototype golf trolley to Raspberry Fields last year and allowed people to play around with it. At this point, the trolley wasn’t attached to a go-kart, but it highlighted a particular problem: the PlayStation 3 controller Mark was using – a model made by Rock Candy – would shut down after a few minutes of no activity.
“It would then search for something to communicate with, but this wouldn’t necessarily be the last thing it was talking to,” Mark says. “It meant that it would sometimes find another robot – on one occasion it hooked up with a device called X-Bot, sending it crashing off a table.”
The controller problem remains unresolved and Mark says he also needs to work on better acceleration controls. “I’m also working out how to get the controller to slow down gradually instead of stopping abruptly,” he adds. But when everything is working well, Marvin is a joy. The robot can whizz around the garden with a go-kart in tow, to the great excitement of his daughters. “They love it,” Mark concludes.