SainSmart Balance Robot

SainSmart Balance Robot

Connection Type
USB
Audio Support
No
Camera Support
No

The Sain Smart v3 balance robot is an inverted pendulum. Technically, you can use the hardware from this robot, combined with EZ-Builder to balance any robot - with enough patience to configure PID values. The kit includes an Arduino Mega with a shield for the MPU6050 IMU. The custom firmware below allows EZ-Builder to connect to this robot and control it via the Inverted Pendulum movement panel.


Setup

  1. Download EZ-Mega v1 Balance Robot Sourcecode (Feb 4, 2019)
  2. Tutorial to compile the source code and upload the firmware to the SainSmart Mega Arduino
  3. Add the Inverted Pendulum EZ-Builder Behavior Control to EZ-Builder project

Connection Types

The firmware can use either USB or Bluetooth, depending on the configuration. The top of the firmware has a configuration section that can specify both the communication port and communication baud rate.

Example of configuration for USB

This configuration example is for USB at 115,200 baud.

// The communication baud rate
#define _BAUD_RATE 115200

// The primary communication interface between EZ-Builder and this controller
// Serial  - USB (recommended 115200 baud)
// Serial1 - 19(RX), 18(TX) <- do not use because pin 18 is used by wheel encoder
// Serial2 - 16(RX), 17(TX) <- recommended for bluetooth dongle
// Serial3 - 15(RX), 14(TX)
#define COMMUNICATION_PORT Serial

Example of configuration for BlueTooth add-on

This configuration example is for a bluetooth module connected to Serial port #2 at 9600 baud. In this case, the respective RX & TX wires would be connected from the MEGA to the Bluetooth module. Of course, the TX on MEGA would be connected to RX on Bluetooth. The same applies for the RX on MEGA connecting to TX on Bluetooth.

// The communication baud rate
#define _BAUD_RATE 9600

// The primary communication interface between EZ-Builder and this controller
// Serial  - USB (recommended 115200 baud)
// Serial1 - 19(RX), 18(TX) <- do not use because pin 18 is used by wheel encoder
// Serial2 - 16(RX), 17(TX) <- recommended for bluetooth dongle
// Serial3 - 15(RX), 14(TX)
#define COMMUNICATION_PORT Serial2
#1   — Edited
I assume the communication is going through a ESP8266 on the bot?
Contacted the company to purchase one of the shields (to build myself) but was told it was discontinued:(
You must have to buy the whole bot from them now.

Thanks in advance.
Synthiam
#2  
Yeah - we should be able to recreate the same build with DIY parts. The shield is merely an HBridge, but you can use any hbridge (specifically the EZ-Robot one). The IMU it uses is the MPU6050.

As for wireless... I'm actually using a Bluetooth <-> UART module. The same ones that were on the EZ-B v3.