Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE ....

15
Microduino-Self-balancing car kit USER GUIDE

Transcript of Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE ....

Page 1: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

Microduino-Self-balancing car kit

USER GUIDE

Page 2: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

1

Content

Outline ..................................................................................................................2

Program Download ................................................................................................2

Programming .........................................................................................................2

Buildup Steps .........................................................................................................3

Operation Description .......................................................................................... 11

Code Description.................................................................................................. 13

FAQ ..................................................................................................................... 14

Page 3: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

2

Outline

Project: Microduino Open Source Self-balance Robot

Objective: To DIY your own two-wheel self-balance robot.

Difficulty: Medium

Time-consuming: 2-Hour

Maker:

Introduction:

This two-wheel self-balance robot integrates multiple functions. It is also the study topic that combines automatic control theory, dynamics theory and technology.

It can accomplish self-balance 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.

Programm Download

Download source programs from the address below: BalanceCar_Microduino

Programming

Stack Microduino-Core+ and Microduino-USBTTL together.

Connect Microduino-USBTTL with a USB cable for program uploading after that.

Attention: 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(Microduino-Core+) and the

processor(Atmega644pa@16M,5V) and chose the corresponding 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.

Page 4: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

3

Buildup Steps

Step1:

Connect Structure-A1 and Structure-A2 as shown in Figure1-1.

Insert Structure-B1 and Structure-B2 into the two sides of Structure-A1.

After "Step 1", you just completed the buildup of Frame of the robot

Page 5: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

4

Step2:

Follow the Figure 2-1, connect the two stepping motors and Structure-C1, then fixate them with Copper columns .

Please be noted the direction of the motor interface. The interfaces of the two motors should be installed symmetrically.

You just finished the installation of Motor parts .

Page 6: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

5

Step3:

Follow the Figure 3-1, insert the Motor parts to the Frame of the robot. Please be noted the motor interface needs to correspond to the gap of the Frame of the robot.

After that, please insert the Structure-B1 into the slot gap to make sure the Motor parts are fixated firmly.

Page 7: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

6

You just finished the assembly of the Chassis of the robot

Step4:

Fixate the Axis connector on the axis of the Stepping motor as shown in the Figure 4-1.

Then fixate the Wheels on the Axis connector with Screws.

Page 8: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

7

See the result of that in Figure 4-2.

Step5:

Follow the Figure 5-1 and put the 2S battery into the slot of the Chassis of the robot .

Then, fixate Structure-C2 and Structure -C3 on the upper and lower sides of the Chassis of the robot respectively.

Page 9: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

8

Refer to the following Figure 5-2, use Structure-A3, Structure-C4 and Structure-C5 to fixate the structure of the robot.

After Step5, it is as shown in the figure 5-3 :

Page 10: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

9

Step6:

Fixate theMicroduino-Stepper with nylon screws, nylon columns and nylon nuts on the top of the Chassis of the robot.

Note: Please refer to the installation procedure strictly as shown in the picture to assemble the base board of Microduino-Stepper.

Then stack the following modules on the base of Microduino-Stepper.

Core Module: Microduino-Core+

Attitude Module: Microduino-Motion

Communication Module:

Under Joypad mode, the communication module is Microduino-nRF24

(Please firstly install 2.4G antenna)

Under BLE mode, the communication module is Microduino-BT

Page 11: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

10

Connect the Stepping motor to Microduino-Stepper with Stepper cable .

Please be noted of the interface position of the two Stepper cables.

Note: Please be noted of the installation direction when connecting the stepper cables.

Page 12: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

11

Step7:

Insert 2S battery into the battery interface of Microduino-Stepper, and the robot is powered on. Lift the robot and it'll stay stand up and keep balance.

Operation Description

If stacking nRF24 module in Step6, the robot will enter Joypad remote control

mode by default after power-on, or it'll enter BLE mode.

Joypad Remote Control Instructions

Refer to the link for the buildup: Joypad User Guide

Joypad Communication Mode Configuration*

Page 13: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

12

For the mode configuration, you can refer to: Communication Mode

Configuration

When we use Microduino-nRF24 as the Communication module, for

the Joypad, you can choose nRF mode.

Joypad Battery Use*

Battery Use Instruction

BLE Control Guide

Download the BLUE remote control (Android) here: File:MTank.rar

Make 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 self-balance robot can't

stand up. At this time, the 2S battery is under low 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 battery balance charger and

plug in the power.

Page 14: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

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

#define NRF_CHANNEL 70 //nRF channel

You can the installation direction of the Microduino-Motion with the following code.

Refer to Buildup Steps / Step6 for installation direction. Microduino-Motion module need to choose PITCH direction.

#define YAW 0

#define PITCH 1

#define ROLL 2

//Attitude sensor installation direction.

#define DIRECTION PITCH

Page 15: Microduino-Self-balancing car kit USER GUIDE … · Microduino-Self-balancing car kit USER GUIDE . 1 Content Outline ... This two-wheel self-balance robot integrates multiple functions.

14

The following code can adjust the PID parameters of the self-balance 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

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 self-balance robot can't stand up during use?

A:Please refer to the following picture to judge if the Microduino-Stepper module is installed right and the Stepper cableis connected correctly.

Q:What if you find the robot tilt to one side over the course and hear abnormal sound generated by the Stepping motor ?

A:At this time, you can toggle the robot to the other side and it'll stand up and go back to normal instantly.