Robust Robotic Platform From Old Hoverboards and Used Metal

by JoKhann in Craft > Reuse

1093 Views, 9 Favorites, 0 Comments

Robust Robotic Platform From Old Hoverboards and Used Metal

image_2023-09-06_021030141.png
ezgif.com-video-to-gif.gif

Robotic platforms are very useful for new roboticists as they provide a structure for more advanced projects, such as robotic arms. However, these platforms are very expensive and can cost hundreds or thousands of dollars. However, we can make a suitable platform from a commonly found item, a hoverboard, as they contain motors and batteries, which are often the most expensive parts of a robot.

Supplies

2x Hoverboards - Any used hoverboard will work for our purposes. If you only have 1 hoverboard, it will also work, but you need to find an alternative for the front wheels.

4x Motor Controllers - Used RioRand 350W

Used metal - Any metal works, but c-channel worked well for me.

3D Printer Filament - Any filament works

Miscellaneous Nuts and Bolts

Raspberry Pi - You can also use arduino, but Raspberry Pi is more useful if you plan to include more complex things in the future such as path following.

Jumper wires - You will need an assortment of wires to connect the motor controller to raspberry pi and battery.

Disassembling the Hoverboards

image_2023-09-05_003616659.png
image_2023-09-05_010522791.png
image_2023-09-05_010707714.png

Take the screws off the bottom of the hoverboard. Inside the hoverboard you will see the motors, motor mounts, and a battery. These are the things you will need to salvage by removing the screws and latches. Everything else can be disposed of following proper recycling protocols.

Designing the Robot

image_2023-09-06_011536856.png

Now that we have the hoverboards, we are able to design a robot given the hoverboard wheel's dimensions. The main things I designed are the brackets and hoverboard mounts, which I have attached below. However, you may need to edit these files to fit your frame and hoverboard motors.

Cutting the Metal

image_2023-09-05_012101877.png

You need to cut the metal to 40cm and 43cm, respectively. However, since I designed this robot for the pieces of metal that I already had, they were already the correct length.

Printing the Brackets

image_2023-09-05_003706532.png

You will need to print out 8 copies of the bracket that I have attached in Step 2.

Printing Settings I used:

Nozzle Temperature: 215 deg Celsius

Bed Temperature: 60 Deg Celsius

Layer Height: 0.28mm

Infill: 20%

Support: No

Adhesion: Skirt (3 line thickness)

Assembling Frame

image_2023-09-05_011407599.png
image_2023-09-05_012548166.png

Connect the brackets to the metal, such that the C channel will form the shape shown above. I used a bunch of small nuts and bolts shown in the basket above, instead of dedicated M4 nuts and bolts.

Attaching Wheels

image_2023-09-05_011822473.png
image_2023-09-05_012924748.png
image_2023-09-05_102157432.png
image_2023-09-06_015410981.png

Although you could print a special motor mount and I did include one in Step 2, it is not actually necessary as the hoverboards already come with a convenient metal bracket, which is much stronger than whatever you print.


To attach the wheels you will need to enlarge some of the holes using a 1/4" drill bit. I used two bolts from my miscellaneous bolt bin for each of the motors.

Making a Electronics Box

image_2023-09-06_020335493.png
image_2023-09-06_020425974.png
image_2023-09-06_020405979.png
image_2023-09-06_020452978.png
image_2023-09-06_020257846.png

Although you do not necessarily need a box dedicated for electronics, it is convenient to separate them from the outside and it also offers limited protection against the elements. I cut a piece of plastic left over from awning to fit the bottom of the robot. This will hold the box up. The box was made from a used Swiffer Box and I made holes in the box to act as passthrough from the motors to the box. I then used double sided tape to attach this box to the plastic I cut. You can drill out holes in that plastic to attach to the chassis.

Wiring the Motors to the Controller

image_2023-09-05_012640896.png

We need to connect 8 wires from the motor to the motor controller. 5 of these are the hall effect sensor wires, which are the thinner wires and need to be soldered to the provided connector. In general the colors corespond between the wire on the connector and motor, but for some hall effect sensors light blue corresponds to white.


We will the need to connect the motor phases to the motor controller, which are the thick green, blue, and yellow wires. These represent the MA, MB, and MC phases, respectively, and can be connected in the large green screw terminal, where the labels are present on the underside of the board.

Connecting Motor Controllers to the Raspberry Pi

image_2023-09-05_011240976.png
image_2023-09-06_021605582.png
image_2023-09-06_023740563.png

Short circuit the two pins circled in the second image to enable PWM control with your Raspberry Pi. You will then need to connect the V and G pins on the motor controller to the 5V and GND pins on the Raspberry Pi. You will than need to connect the P pin on the motor controller to the 12, 13, 18, and 19 pins on the Raspberry Pi, as those are the only pins that have hardware PWM enabled, which is the one we desire.

Power Distribution

image_2023-09-06_024939479.png

The method of power distribution will depend on the type of battery you have. Although my hoverboards did come with 24V batteries, I opted against using them as I am unsure of the safety of the batteries. However, feel free to use them for your own builds. Instead of the included battery I used two 12v 3000mAH batteries for the larger storage capacity. However, I will need to wire these batteries in series to double the voltage to 24v, which is the operational voltage of the hoverboard motors, with the connector shown above. In fact it is very easy to make one yourself. All you need to do is connect the ground of the first battery to the hot side of the other battery. The outputs will be the hot side of the first battery and the ground side of the second battery.


After this, you can daisy chain the GND to the VCC on the consecutive motor controller board, which will make it require only one XT30 connector to power all of the motor controllers. In addition, you will actually not need to power the raspberry pi from the battery, as there is a 5V pin on the motor controller which powers the Raspberry Pi.

Programming the Robot

Programming this platform is not that complicated if you know which libraries to use. In this case, GPIOZERO and PYGAME will both be extremely useful. GPIOZERO will allow use to set up the PWM to signal our motors. PYGAME will allow us to use a remote controller to remotely control the movement of our bot. Provided below is some sample code that I used, but feel free to modify it to your own use.


Please note that you may need to change the code to account for differences in the GPIO pins used on the raspberry pi. Also, make sure you download both the GPIOZERO and PYGAME libraries, although they will typically be included with the Raspberry PI Operating System.


import pygame

from gpiozero import Motor


# Initialize the motors

left_motor1 = Motor(forward=x, backward=x) # Adjust GPIO pins as needed

left_motor2 = Motor(forward=x, backward=x)

right_motor1 = Motor(forward=x, backward=x)

right_motor2 = Motor(forward=x, backward=x)


# Initialize Pygame and the controller

pygame.init()

controller = pygame.joystick.Joystick(0)

controller.init()


# Define motor speed and deadzone

speed = 1.0 # Adjust as needed

deadzone = 0.1


def map_speed(value):

  # Map joystick values to motor speed with deadzone

  if abs(value) < deadzone:

    return 0

  elif value > 0:

    return (value - deadzone) / (1 - deadzone)

  else:

    return (value + deadzone) / (1 - deadzone)


try:

  while True:

    for event in pygame.event.get():

      if event.type == pygame.JOYAXISMOTION:

        if event.axis == 1: # Left stick up/down

          left_speed = map_speed(controller.get_axis(1))

          left_motor1.value = left_speed

          left_motor2.value = left_speed

        elif event.axis == 3: # Right stick up/down

          right_speed = map_speed(controller.get_axis(3))

          right_motor1.value = right_speed

          right_motor2.value = right_speed


except KeyboardInterrupt:

  # Clean up GPIO and exit

  left_motor1.stop()

  left_motor2.stop()

  right_motor1.stop()

  right_motor2.stop()

  pygame.quit()

Improvements and Future Steps

image_2023-09-06_021153598.png
image_2023-09-06_021218934.png

The robotic platform is done. The modularity of the platform will allow you to repurpose this for many tasks. Some things that come to mind are guard robots, parcel delivery, and possibly a platform to attach other robots on to, like a robotic arm. There are endless possibilities!