background image

 
 

 

 

 

 

 

2WD Self Balancing Robot 

 
 

 

SuperDroid Robots, Inc 

 

 

 

Contact 

 

224 Technology Park Lane 

 

 

 

(919) 557-9162 

 

Fuquay Varina, NC 27526 

 

 

 

SDR@SDRobots.com 

 

www.SuperDroidRobots.com 

 

 

 

  

 

 

Revised: February 8, 2019  

 

 

 

Page 5 of 6 

 

 

VNH3SP30.h 
Kalman.h 
PID_v1.h 
Timer.h 
 

To verify this step has been completed properly, you can open a blank Arduino sketch and navigate to Sketch-
>Import Library. The libraries should show up on this list. If not, go to Sketch->Import Library->Add Library 
and select the missing libraries.  

The firmware will not compile without successfully completing this step. 

4.

 

Once the code is compiling, you are ready to start tuning the PID parameters.  The parameter values are 

located in the “hardware.h” file within the Self Balancing Robot firmware package.  

These values will control 

how the motor reacts to off center angles in order to balance.  More than likely, these values will need to be 
tuned/changed to get good results.  If you are new to the PID algorithm please read through 

this article

 and 

the 

PID Wiki

This system has an inner and outer PID loop.  The outer loop parameters will affect the target angle needed 
to return to the starting position. The feedback sources here are motor encoders.  The corresponding PID 

parameters are labeled “

SpeedKp

”, “

SpeedKi

”, and “

SpeedKd

”.  

 

The inner loop uses the IMU feedback in order to calculate error between target and measured angles.  The 
result is a target speed which is sent as commands to the motor controller.  The inner loop PID parameters 

are labeled “

Angle

Kp”, “

Angle

Ki”, and “

Angle

Kd”.

  To start tuning the PID you may tune the inner loop first to 

do this you can go to line 58 and set SpeedPID.SetMode(MANUAL).  After you have a good tuning you can 
set that back to AUTOMATIC. 

While tuning these values, it’s advised to elevate the wheelbase until the robot 

seems stable.  An unstable PID loop due to erroneous parameter values can cause damage to the robot or 
its surroundings.  There are multiple methods to go about tuning a PID.  Please read through the links above 
before proceeding. 

Operation 

For testing/operation, stand the robot straight up and turn on the power.  Hold it upright for 
approximately five seconds so the robot can calibrate a zero angle and it will begin balancing. For 
charging locate the LIPO balance lead and connect to the corresponding charger. Each battery charge 
individually.  

General Terms 

1.

 

SuperDroid Robots, Inc is not responsible for special incidental or consequential damages resulting from any 
warranty or under any legal theory, including, but not limited to lost profits, downtime, goodwill, damage to, 
or replacement equipment or property, or any cost of recovering, reprogramming, or reproducing any data 
stored. ANY LIABILITY SHALL BE LIMITED TO REPLACEMENT OF DEFECTIVE PARTS. SuperDroid Robots, Inc. is 

Summary of Contents for 2WD

Page 1: ...WD self balancing robot This kit is a perfect platform for learning Arduino PID control serial communications Serial I2C SPI PWM signals IMU filtering etc Images shown may not be an exact representation of the robot s features listed in this document ...

Page 2: ... Inc Contact 224 Technology Park Lane 919 557 9162 Fuquay Varina NC 27526 SDR SDRobots com www SuperDroidRobots com Revised February 8 2019 Page 2 of 6 Contents Mechanical Assembly 3 Electrical Assembly 4 Software 4 Operation 5 General Terms 5 ...

Page 3: ...ck At this point you can mount the shafts to the motors using the provided 20 set screws It may be helpful however to leave the wheels off while you finish building and wiring the robot 4 Before mounting the middle deck mount the switch fuse block and the rest of the electronics Drill a hole to mount the switch Use the plastic spacers and hardware provided in the hardware kit to mount the fuse blo...

Page 4: ...e the tube to spin inside of the tire and damage the valve stem For this reason it is a good idea to check the tires periodically to make sure they are inflated Electrical Assembly For electrical assembly please follow the provided schematic on our website Self Balancing Robot Wiring Diagram For additional support on wiring soldering and crimping please read the following support pages Electric Mo...

Page 5: ...es the IMU feedback in order to calculate error between target and measured angles The result is a target speed which is sent as commands to the motor controller The inner loop PID parameters are labeled AngleKp AngleKi and AngleKd To start tuning the PID you may tune the inner loop first to do this you can go to line 58 and set SpeedPID SetMode MANUAL After you have a good tuning you can set that...

Page 6: ...o representations as to the fitness of its products for specific uses ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE IS HEREBY EXCLUDED 3 Agreements shall be construed in accordance with the laws of the State of North Carolina and the rights and obligations created hereby shall be governed by the laws of North Carolina 4 In the event a dispute or controversy arises suc...

Reviews: