Thứ Hai, 10 tháng 12, 2018

DIY Smartphone Controlled Mobile Robot

Introduction

Mobile Robots have the capability of moving from one place to another, just like us. We can move from one place to another using our senses, thinking, and muscles. But yes! we are very complex and making a robot like us will take a lot of knowledge and efforts. What we will be learning here will give you a very good feel for robotics.
In this project, we will first go through basic concepts for designing and making a robotic car, then we will move forward and make a simple robot which will go forward, backward, right and left. The robot will be controlled with Smartphone app connected to the robot using Bluetooth Communication.
Given below is the final assembly of the robot.Joystick Controlled robot

Components Required

IMAGECOMPONENTQUANTITYAVAILABLE IN KIT
evive1
Acrylic Part: Base Plate1
BO Motor Mount2
M3 bolts of 8 mm Length7
M3 bolts of 25mm Length4
M3 bolts of 12mm Length5
M3 Nuts8
BO Wheel2
Caster Wheel1
HC05 Bluetooth Module1

Building Guide

Step 1: Understanding the basic concepts of Mobile Robot

Wheels

Just like real cars, a robotic car also has wheels which are actuated using motors. For a moving object to be stable, you need at least 3 contact points with the surface on which it is moving. For e.g. in a car, you have four wheels, but on a bicycle, there are only two wheels. A cyclist can control the bicycle only when he is cycling, but if he stops he can’t balance the cycle without resting one of his foot on the ground.
In our mobile robot, we will have 2 wheels and one caster wheel touching the ground. A caster wheel has a small round sphere, which rolls on the ground. It is passive and can move in any direction.

Differential Drive

A differential wheeled robot is a mobile robot whose movement is based on two separately driven wheels placed on either side of the robot body. Thus, it can change its direction by varying the relative speed of its wheels and hence does not require an additional steering motion.
If both the wheels are driven in the same direction and speed, the robot will go in a straight line. If both wheels are rotated with equal speeds in opposite directions with respect to each other, the robot will rotate. Otherwise, depending on the speed of rotation and its direction, the center of rotation may fall anywhere on the line defined by the two contact points of the tires. While the robot is traveling in a straight line, the center of rotation is an infinite distance from the robot.
Pure Translation Motion Mobile RobotPure Rotational Motion Mobile Robot
Our robot has a configuration similar to that of a three-wheeled differential drive robot.

Chassis

Chassis is the base frame of any robot, on which driving motors and caster wheels are mounted.

Step 2: Assembly

The annotated base is shown on right. This is the bottom side. There is an evive logo on the top side for your reference. So be careful while using the base.chassis_base
  • Fix the motor mounting brackets to the chassis using M3 bolts of 8mm length and M3 nuts.motor mounting brackets
evive Alert
The motor wires should be inside, otherwise, they will collide with the wheel. Also, while assembling the robot, be careful about the holes you are using. Also, fasten all the nuts and bolts tightly for smooth functionality.
  • Attach the two motors, one to each bracket, side by side and fasten using M3 bolts of 25mm length and M3 nuts.attaching_motor
  • Now, fit the wheels into the protruding motor shafts.attaching_wheels
  • We’ll attach the Castor wheel now. First, we will mount the M3 standoffs (20 mm) on which the Castor will be attached. Fasten the standoffs to the chassis using M3 bolts of 8mm length.
  • Place the Castor on top of the standoffs in the configuration shown and fasten using M3 bolts of 12 mm length.attaching_castor
evive Notes Icon
Keep in mind, that what we have assembled so far (motors and castor) will be pointing downwards.
  • Flip the assembly and place evive on the top of the chassis.placing_evive
  • Using the holes on the back of evive fasten it to the chassis using M3 bolts of 12mm length.Fastening evive
evive Notes Icon
Your basic mobile robot is now ready. This is the framework for almost every robot that we’ll work with. Modify it according to your need to use it as a line following, obstacle avoiding, light-tracking robot etc.

Step 3: Circuitry of the Robot

For this robot, we have to connect the Bluetooth module (HC05). In the following
figure you can observe where the Bluetooth module’s 6 pin connectors are plugged on evive.
SmartphoneControlledBluetooth module
evive Alert
Bluetooth module’s RX pin will go to TX3V3 pin on evive and others correspondingly. Note that on powering evive, a red LED will start blinking on the module. If you do not connect the module correctly, it may get damaged.

Step 4: Logic and Flowchart

In this case, we are communicating wirelessly. The user gives instructions by pressing the buttons on the gamepad in the evive app. The robot takes actions according to the button pressed. For example, if Down is pressed the robot will move backward; if none of the buttons are pressed, the robot will stop. Below is the complete flowchart:MobileRobotLogic
evive Gamepad App

Step 5: A quick recap of Scratch

Scratch is a visual programming language that helps kids and budding programmers, to learn how to code, i.e. how to write a program in a fun, educational, and easy way using pieces known as blocks. This makes learning coding nothing but a jigsaw game that helps develop problem-solving and decomposition skills.
We will be using mBlock, a software based on Scratch for making our game. If you don’t have mBlock installed in your laptop/PC, visit here for detailed instructions on how to install it.
There are four basic elements for programming in mBlock:
  1. Stage
  2. Sprites
  3. Script
  4. Blocks
There are two modes in Scratch using which you can work:
  1. Scratch Mode
  2. Arduino Mode

Scratch Mode

In Scratch mode, which is the default mode in mBlock, you can run the script and control evive as long as it is connected to your laptop/PC; the moment you remove the USB you cannot use the script to work with evive anymore.

Arduino Mode

In Arduino mode, the blocks are transferred to Arduino C++ in Arduino IDE, and then you can modify the code in Arduino IDE. Another important aspect of Arduino mode is that you can upload the code to evive using this mode only.
To know more, please visit here.
We are going to program this robot in Scratch Mode.

Step 6: Scratch Script

Now we are going to create Scratch Scripts to generate code for the robot.
evive Notes Icon
We will be using Arduino, evive TFT Display, evive App and evive inbuilt functions extension from Robot palette. So, make sure you have added these extensions in mBlock.
Let us follow the following steps:
  1. Drag-drop evive Program hat block into the scripting area.
  2. Set the TFT background to Black.
  3. Whatever comes after the Fill screen with () color block must repeat forever.
  4. Drag and drop the if-else block. Next, drag and drop the Is () pressed ? block inside the diamond-shaped space in the if arm of the if-else block.
  5. Then, drag and drop the Write () block below the if arm to display the result.
  6. We will now test our code.
  7. Upload the script to your evive.
  8. After uploading, pair HC05 Bluetooth module in your Smartphone (Android only). The default password is “1234”. Download and install evive Gamepad App by going to https://thestempedia.com/resources. Go to evive App and click on SCAN. You will find the paired devices here. Select the appropriate device. After a successful connection, it will show connected. Go to GamePad and select normal Gamepad as the control.GamePad
  9. Touch the buttons, and you will observe the corresponding values printed on the TFT Screen. This means your communication is working and we are good to go.
  10. Now, we have to assign action according to the button pressed.
  11. To make the robot move, create blocks GoStraightGoBackwardTurnRight, TurnLeft and Brake.GoStraightGoBackwardTurnLeftBrake
  12. Complete the remaining programme using the multiple if-else and Is () pressed ? blocks.
  13. After completing the main script, upload the Arduino code generated into evive and run the robot.
evive Notes Icon
You can add extra batteries to speed up your robot.

Step 7: Debugging the Robot

At times, your robot will refuse to behave the way you are commanding it to. Let’s fix this. If upon pressing forward, your robot starts moving backward or starts turning, that means at least one motor is rotating in the wrong direction. You can fix this by reversing the direction of that motor.
Exchanging Wiring
Your forward-backward controls shall now work perfectly. If the robot turns left upon pressing left and right upon pressing right, your robot is good to go. If it turns right upon pressing left, you can fix this by exchanging wires of both the motors. Ask an elder for help, if you need.
Exchanging Motor Wiring

Step 8: Explore Starter Kit Courses

A series of exciting online courses through the world of STEM that cover not only the ‘whys’ but also the ‘hows’. They introduce you to the wonders of electronics, programming, science, latest technologies such as robotics, the Internet of Things, 3D printing, and many more!

Không có nhận xét nào:

Đăng nhận xét

Bài đăng mới nhất

ALEPH-M CLASS A ANFİ DEVRESİ N KANAL MOSFET

Aleph-M çıkış gücü yaplaşık olarak 35w Class A sınıfı anfi için oldukca iyi bir değer çıkış modfetleri n kanal 2 adet irfp240 kullanılmış be...

Bài đăng phổ biến