Skip to content

The arduino library and default code to control the Robot Control Board

Notifications You must be signed in to change notification settings

chrisdoel/RobotControlBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

The Robot Control Board

This control board is intended for use with fighting robots, or other applications where high current brushed motors need to be driven wirelessly with a high reliability.

Features:

  • Uses Bluepad32 to allow connection to a wide varienty of wireless game controllers (PS4, PS5, XBOX, Wii, Switch, etc..).
  • Integrates two high current H bridges to control two brushed motors.
  • Has a programmable current limit to prevent burning out motors or the control board.
  • Current surge protection
  • Voltage input of 8V to 26V (2S to 6S lipo)
  • Has been extensively tested using stalled motors at 10A continuous - with some small mods it can do 20A continuous.
  • Has ports to plug in and control ESCs or servos.
  • Has ports to allow a standard RC controller receiver to be connected.
  • Integrated 5V 2A regulator.

Safety warning

  • Ensure you are familiar with lipo safety if you are using lithium batteries
  • Do not connect the battery or power supply in reverse, you will destroy your board
  • Do not exceed 26V input voltage
  • If you wish to plug in your laptop while powering the control board from a battery or PSU, I recommend de-soldering D9 to ensure that your laptop has additional isolation from the board

PCB overview

image

Setting up the hardware

You will likely have recieved a PCB with no fuses or connectors soldered. Here are the steps to get the board fully constructed and ready to be programmed.

20240301_194836

First solder the fuses

I recommend using 25A fuses, as the maximum recommended current limit is 20A. Here I have used 30A but this is all I had available at the time. You can fit regular AT0 fuses and mini fuses. If you try to power and run the board without fuses populated, the motor controller IC will report errors.

20240301_195754

20240301_195807

Solder the motor connectors

You can solder XT30 connectors for each motor. It is not essential to solder motor connectors, you can instead solder the motor wires directly to the board if you want.

20240301_200123

20240301_200131

Solder the input power connector

The input power connector size is a standard XT60

image

Beefing up the power traces

The PCB traces use a 1oz copper thickness, which means that it can handle 10A continuously. However, if you require more current than this, i would massively recommend adding a bunch of solder over all exposed power traces to thicken them up. Set the soldering iron to about 400 degrees and spread a layer of solder over the traces, try to be relatively quick to prevent overheating components on the board.

solder.traces.mp4

20240301_204222

image

Setting up the software

An arduino library and example code has been provided in this repository. There are a few initial steps to getting the Arduino IDE to support the control board.

Install the Arduino IDE 2.0

Head over to https://www.arduino.cc/en/software to download the Arduino IDE 2.0

image

Then install it on your machine.

image

Add ESP32 and Bluepad32 support via the boards manager

The chip used on this board is an ESP32, therefore we need to add support for this chip via the arduino board manager. Head to file->preferences.

image

Copy and paste the following two lines to the Additional Boards Manager URLs field. https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json https://raw.githubusercontent.com/ricardoquesada/esp32-arduino-lib-builder/master/bluepad32_files/package_esp32_bluepad32_index.json

image

Search for ESP32 and press the install button for esp32 and esp32_bluepad32. image

Download the library/code

Clone this github repository or download the repo as a zip.

image

Copy the RobotMotors folder to C:\USERNAME\Documents\Arduino\libraries. This will add the Control Board library to the Arduino IDE

image

Extract the RobotControlBoard.ino file to C:\USERNAME\Documents\Arduino (or anywhere you like) and then open it in the Arduino IDE

image

This is the code that is used to control the Control Board.

Uploading the code to the control board

Select the correct target board by going to tools->board->esp32_bluepad32->DOIT ESP32 DEVKIT V1 (you may have to scroll down a bit).

image

Plug in your board via the micro USB port. If your PC does not detect it then you will have to download the drivers from the following page: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/establish-serial-connection.html

If it is still not detected then try different USB cables.

Select the COM port that corresponds to the port of your control board image

Hit the upload button. The IDE will then compile the code and start uploading it to the board.

image

You may find that you get an error while connecting to the board. If this is the case then you will have to hold the Boot button on the top right corner of the control board during the connecting process. Release the button when you see it uploading the code.

image

image

You have now uploaded the code to the control board! Connect a controller and start driving some motors. For information on supported controllers and how to pair controllers, visit https://github.com/ricardoquesada/bluepad32/blob/main/docs/supported_gamepads.md

About

The arduino library and default code to control the Robot Control Board

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages