open source selfbalance robot system · 22/06/2016 open source selfbalance robot system microduino...
TRANSCRIPT
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
1/13
Open Source Selfbalance Robot System
Contents
1 Overview2 Bill of Material
2.1 Bill of Modules (Joypad Mode)2.2 Bill of Modules (Bluetooth Mode)2.3 Other Material
3 Program Download4 Programming5 Buildup Steps6 Operation Description
6.1 Joypad Remote Control Instructions6.2 BLE Control Guide6.3 Lithium Battery Charging
7 Code Description8 FAQ9 Video
Overview
Project: Microduino Open Source Selfbalance RobotObjective: To DIY your own twowheel selfbalance robot.Difficulty: MediumTimeconsuming: 2HourMaker:Introduction:
This twowheel selfbalance robot integrates multiple functions. It is also the study topic that combines automaticcontrol theory, dynamics theory and technology.It can accomplish selfbalance and also support several ways of remote control.
Remotely controlled by Joypad.Remotely controlled by Bluetooth APP.
This project is totally achieved with Microduino. Users can experience the fun of DIY.
Bill of Material
Bill of Modules (Joypad Mode)
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
2/13
Module Number Function
MicroduinoCore+ 1 Core board
MicroduinoUSBTTL 1 Download program
MicroduinonRF24 1 Wireless communication
MicroduinoMotion 1 Attitude detection
MicroduinoStepper 1 Drive board
Bill of Modules (Bluetooth Mode)
Module Number Function
MicroduinoCore+ 1 Core board
MicroduinoUSBTTL 1 Download program
MicroduinoBT 1 Wireless communication
MicroduinoMotion 1 Attitude detection
MicroduinoStepper 1 Drive board
Other Material
Module Number Function
2.4G antenna 1 2.4G communication
Fixation board 1 For fixation and support
M2 nylon screw 4 Plate fixation
M2 nylon column 4 Plate fixation
M2 nylon nut 4 Plate fixation
Short copper column 8 Fixate the motor
M4 metal screw 2 Fixate wheels
2S Liion battery(7.4V) 1 Power supply
Lithium battery balance charger. 1 Lithium battery charger
MicroUSB cable 1 Serial communication & program download
Axis connector 2 Connect the motor axis and the wheel
Wheel 2 Structure
Stepping motor 2 Drive wheels
Stepper cable 2 Connect the motor and the drive board
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
3/13
Program Download
Download source programs from the address below: BalanceCar_Microduino(https://github.com/Microduino/BalanceCar_Microduino_PID)
Programming
Stack MicroduinoCore+ and MicroduinoUSBTTL together.Connect MicroduinoUSBTTL/zh with a USB cable for program uploading after that.Attetnion: Please upload the program before stacking all modules.
Open Arduino IDE for Microduino environment. (For the buildup, please refer to: AVR Core:Getting started)Click【Tool】, select the right board card(MicroduinoCore+) and the processor(Atmega644pa@16M,5V) and chose thecorresponding port COMX.Click 【File】>【Open】, scan to the project program address, click “BalanceCar_Microduino.ino” and open it.After all that finished, please click "→" and download programs the development board.
Buildup Steps
Step1:Connect StructureA1 and StructureA2 as shown in Figure11.
Insert StructureB1 and StructureB2 into the two sides of StructureA1.
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
4/13
After "Step 1", you just completed the buildup of Frame of the robot
Step2:Follow the Figure 21, connect the two stepping motors and StructureC1, then fixate them with Copper columns .
Please be noted the direction of the motor interface. The interfaces of the two motors should be installedsymmetrically.
You just finished the installation of Motor parts .
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
5/13
Step3:Follow the Figure 31, insert the Motor parts to the Frame of the robot. Please be noted the motor interface needs tocorrespond to the gap of the Frame of the robot.
After that, please insert the StructureB1 into the slot gap to make sure the Motor parts are fixated firmly.
You just finished the assembly of the Chassis of the robot
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
6/13
Step4:Fixate the Axis connector on the axis of the Stepping motor as shown in the Figure 41.Then fixate the Wheels on the Axis connector with Screws.
See the result of that in Figure 42.
Step5:Follow the Figure 51 and put the 2S battery into the slot of the Chassis of the robot .Then, fixate StructureC2 and Structure C3 on the upper and lower sides of the Chassis of the robot respectively.
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
7/13
Refer to the following Figure 52, use StructureA3, StructureC4 and StructureC5 to fixate the structure of the robot.
After Step5, it is as shown in the figure 53 :
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
8/13
Step6:Fixate theMicroduinoStepper with nylon screws, nylon columns and nylon nuts on the top of the Chassis of therobot.
Note: Please refer to the installation procedure strictly as shown in the picture to assemble the base board ofMicroduinoStepper.
Then stack the following modules on the base of MicroduinoStepper.Core Module: MicroduinoCore+Attitude Module: MicroduinoMotionCommunication Module:
Under Joypad mode, the communication module is MicroduinonRF24(Please firstly install 2.4G antenna)Under BLE mode, the communication module is MicroduinoBT
Connect the Stepping motor to MicroduinoStepper with Stepper cable .Please be noted of the interface position of the two Stepper cables.
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
9/13
Note: Please be noted of the installation direction when connecting the stepper cables.
Step7:Insert 2S battery into the battery interface of MicroduinoStepper, and the robot is powered on. Lift the robot and it'll stay
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
10/13
stand up and keep balance.
Operation Description
If stacking nRF24 module in Step6, the robot will enter Joypad remote control mode by default after poweron, or it'll enterBLE mode.
Joypad Remote Control Instructions
Refer to the link for the buildup: Joypad User Guide (https://www.microduino.cn/wiki/index.php/MicroduinoJoypad_Getting_start)
Joypad Communication Mode Configuration*For the mode configuration, you can refer to: Communication Mode Configuration(https://wiki.microduino.cc/index.php/MicroduinoJoypad_Getting_started#Communication_Protocol_Configuration)
When we use MicroduinonRF24 as the Communication module, for the Joypad, you can choose nRF mode.Joypad Battery Use*Battery Use Instruction (https://www.microduino.cn/wiki/index.php/MicroduinoJoypad_Getting_start/zh#Step3_.E7.94.B5.E6.B1.A0.E9.80.9A.E7.94.B5)
BLE Control Guide
Download the BLUE remote control (Android) here: File:MTank.rarMake sure the phone is Android 4.3 or higher. and the Bluetooth function is open.Search the Bluetooth device “Microduino” and connect.Then, you can control via the APP.
Lithium Battery Charging
If you find the motor rotates slowly during use or the selfbalance robot can't stand up. At this time, the 2S battery is underlow battery, which needs to use the supporting lithium battery balance charger.Follow the picture below and insert the white 3pin interface of the 2S battery into the 3pin interface of the Lithium batterybalance charger and plug in the power.
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
https://wiki.microduino.cc/index.php?title=Open_Source_Selfbalance_Robot_System 11/13
You can judge the charging state by the indicator of the Lithium battery balance charger as follows:
Indicator state Charging state
Green light blinks No battery connected
Red light goes on constantly The battery is charging.
Red light goes on constantly Complete charging.
Code Description
"userDef.h" is the config. file.The code below can configure the channel under the nRF mode, which needs to be consistent with the Joypad controller.For the nRF mode channel of the Joypad, you can refer to: nRF Mode Channel Configuration(https://www.microduino.cn/wiki/index.php/MicroduinoJoypad_Getting_start/zh#nRF.E6.A8.A1.E5.BC.8F.E9.80.9A.E9.81.93.E9.85.8D.E7.BD.AE)
#define NRF_CHANNEL 70 //nRF channel
You can the installation direction of the MicroduinoMotion with the following code.Refer to Buildup Steps / Step6 for installation direction. MicroduinoMotion module need to choose PITCHdirection.
#define YAW 0#define PITCH 1#define ROLL 2//Attitude sensor installation direction. #define DIRECTION PITCH
The following code can adjust the PID parameters of the selfbalance robot's angle ring and speed ring.Angle ring parameter setup:
#define KP_CON 0.2 // 0.25#define KI_CON 0 #define KD_CON 28 // 30 28 26
22/06/2016 Open Source Selfbalance Robot System Microduino Wikipedia
Speed ring parameter setup:
#define KP_THR 0.065 //0.08//0.065#define KI_THR 0.0005//0.05#define KD_THR 0
FAQ
Q:What if the selfbalance robot can't stand up during use?A:Please refer to the following picture to judge if the MicroduinoStepper module is installed right and the Steppercable is connected correctly.
Q:What if you find the robot tilt to one side over the course and hear abnormal sound generated by the Steppingmotor ?
A:At this time, you can toggle the robot to the other side and it'll stand up and go back to normal instantly.
13/13