Saturday 15 July 2017

Low cost window cleaning robot: Final Model

Hello readers! In last article Low cost window cleaning robot we explained the first prototype we designed. We also explained the short comings and failures of the design. But this was not the end! We did further literature survey and came across the video of this wall climbing robot on YouTube.
 It became our inspiration and we began to develop a robot using high speed brushless dc motor as seen in the video for creating vacuum between the surfaces.

As learned by previous experience the important parameter while designing the robot is the weight of body. It is important that the mass must lie at single point and by physics we commonly recall the concept as centre of gravity(COG).
The mass must be distributed in such manner that the entire system can be replaced by single point mass.
COG helps in reducing the recursive steps needed to calculate the force exerted by gravity on each component on the robot.
We designed the chassis on CAD and went for lazer cutting as shown in the article Sneak Peek.
The weight of the robot according to the new design had to be lower than or equal to 500 g. Our first design of the chassis was heavy and so we removed more acrylic in order to reduce the weight.
Finally when the chassis was designed, we placed our components as shown in the figure below.
Figure 1 Top View
 As you can see we have placed the brushless dc motor in the middle of the chassis and rest components like Arduino development board, motor driver and ESC around the motor. The motor driver we have used is to control the two gear bo motors for robot's motion along the wall.
Figure 2 Bottom View
  
But unfortunately as we proceeded to test our prototype we faced some problem with our ESC(Electronic Speed Controller). We had bought 30A ESC whose rating was lesser than the maximum current rating of the brushless motor.
Please keep in note that use ESC whose current rating is greater or equal to 30%-40% of the maximum current rating of the motor.It ensures that your ESC will not get short if the motor drives high load.
Since we were using our motor to create vacuum to support the weight of the robot, it was driving large current from the battery.In every test runs the ESC would get really hot and soon the motor stopped working properly.We solved this problem by replacing the old ESC with larger current capacity of 40A.
Next we faced the problem with the BO motors.The motors had 1.5 kgf torque which is not enough to push the robot upwards.The motors with high torque are heavy and could not be placed on the robot. We did some research and found out about mini geared high torque motors.Due to budget constraint we could not implement it in our project. 
But in the end, we were able to fulfill two out of four major objectives.

Saturday 8 April 2017

A Star Algorithm


Path planning is considered as elementary task in autonomous mobile robot that allows the robot to find the shortest path from starting point to destination point.  Path planning has evolved with different types of algorithm and has moved from shortest to optimal paths.

Assumptions:
1.We are going to discuss the algorithms on the basis of grid graph, which has identical square shaped blocks.
2. Each block is denoted as node, moreover there is only single starting node and single destination node.
3. The location of starting and destination node is known.

Grassfire algorithm, as by its name, it begins from destination point, assigning each grid a value equivalent to the distance from the destination point spreading like fire in every direction.
It assigns the value '0' to the destination point, and value '1' to all the immediate surrounding neighbors.  
This step is repeated till starting point is assigned a value. Now the path is formed from the starting point to the destination point, according to the reducing value of distance. 
For example: if the starting point is assigned value '10' , then the path is formed in such a manner '10'-'9'-'8'...so on till '0'. 

Grassfire Algorithm is effective for small dimension grid graphs.
But as we increase the number of dimensions the complexity increases and thus we need a smarter algorithm which can find the shorter distance by visiting few and relevant nodes. 


A* algorithm also known as best first search algorithm  is one such algorithm which not only finds the shortest path but does it with less computational time. 

A* algorithm finds Heuristic function. It determines distance between a given node/current node to the goal node.

This information plays a vital role in the A* algorithm to search nodes which are nearer to the goal. 

A* algorithm computes function f , which is:
                                        
                                          f = g + h
where: g: the distance between current node and start node
            h: the heuristic cost  of current node

In every iteration it chooses nodes with the smallest f value or a node which is likely to be on shortest path.
Once node is chosen , f and g value is updated. This process is repeated until we encounter destination node or run out of nodes to consider.

A* is quicker than Dijkstra and Grassfire, due to its consideration of the heuristic distance. 
It might be wrong, but in many cases we can come up with informative heuristics that cause the algorithm to explore more efficiently.

We have coded the algorithm on MATLAB and its video is available on our YouTube channel 'Electro-Bugs'. 
Here is the link:

References:
'Robotics:Computational Motion Planning' course by University of Pennsylvania





Wednesday 22 March 2017

Dijkstra Algorithm

Hello readers!
When one wants to reach a place (destination) from it's starting point, it's quite obvious that he/she would like to trace a shorter path, and not a longer one eluding the neighboring obstacles. So, here we are discussing an algorithm which finds the shortest path between the starting point and the destination node in a given graph.

Typically, F=lia, where, lia is the shortest distance from the node i to the node a in the given network, and F is the sum between the distance start node and end node, and estimate as to how much distance is left to reach the goal location.

So, in this algorithm the nodes visits all the adjacent nodes, that it, it expands in all directions and the distance which is traversed from the initial node to the next node is compared with the previous parent node, and then the shortest distance is decided, this is the biggest disadvantage of Dijkstra Algorithm, that it does blind search, as it has to check all the nodes and compare the newly calculated tentative distance value to the current assigned value, and chose the smallest value. That is why it grows comparatively slow than to Astar algorithm. And other disadvantage is that, it can't work for negative edges.

As, it can be seen from the video that the colour map is as follows:
  1. White - clear cell
  2.  Black - obstacle
  3. Red = visited
  4. Blue  - on list
  5. Green - startY
  6. Yellow - destination


This was a course on CourseraComputational Planning, the coding had to be done by oneself. We have done the coding on MATLAB.

Video of path planning algorithm: https://youtu.be/_V6-HSh5vDc


Sunday 19 March 2017

GAP,GATT & Beacon

In the previous article Exploring BLE through nRF51 DK development board, we mentioned briefly about BLE and nRF51-dk. In this article we will be explaining two important concepts which are required to code a bluetooth application.

Before that you should know that bluetooth network model is based on 'proximity networking'  which implies that when two devices come into range of each other, they are capable of establishing a connection.
The advertising takes place in following ways:
1. GAP:

GAP is an acronym of Generic Access Profile, it is used to control the advertising and defines various roles of the devices.It is responsible for your device to be visible to the outer world.

Devices can be divided in the following two roles:
1. Peripheral : These devices are small and are restricted to lesser resources. They are used to connect to much more powerful central devices. eg: heart rate monitoring watches, beacons.
2. Central: These devices are with greater processing power and memory. eg: phones, tablets etc.

There are two ways to send advertising out with GAP. The Advertising Data payload and the Scan Response payload.

Peripheral Devices sets an advertising interval , and sends the advertising data in that duration. The Advertising Data is essential for peripheral device , as it signifies its existence to any nearby listening devices.
Scan Response is sent out by central device , if required for additional information from the peripheral.

During advertising process, a single peripheral advertising data can be scanned by two or more central devices as shown in the figure below.This is known as broadcasting.

                                                              Figure 1 Broadcast Topology

In our project we are using beacons. Please visit the first link to know what are beacons and how do they work.
Beacons advertise themselves by sending  advertising data, which can be of 47 bytes in length and consist of :
1 byte preamble
4 byte access address
2-39 bytes advertising channel PDU
3 bytes CRC

                                                                    Figure 2 Advertised Data

As shown in the figure above PDU contains header, MAC and Data upto 31 bytes.
The Data of 31 bytes contains Beacon prefix, Proximity UUID , Major , Minor and TX power as shown in the figure.
                                                               Figure 3 Inside the Data Bytes

Our task was to scan the beacons using nRF51-dk. We used the example code BLE_Observer , which scans the beacons and returns the values of MAC address, RSSI, Scan response , Advertising type,Proximity UUID , Major , Minor and TX power .

The main purpose of peripheral to advertise is to establish a connection with the central device.
Once the connection occurs advertising process ends and we use GATT services and characteristics to communicate in both directions.

BLE devices can operate in a non-connectable advertisement-only mode (where all the information is contained in the advertisement), but they can also allow connections (and usually do).
In our project , we are using only GAP and we have used it in our scanner.

2. GATT:

GATT is an acronym for the Generic Attribute Profile, and it defines the way that two Bluetooth Low Energy devices transfer data back and forth using concepts called Services and Characteristics.
As mentioned above, GATT comes into play once a connection is established.
Now comes the interesting part, as said peripheral device can be scanned by two or more central devices. But once a connection is established , peripheral cannot advertise anymore and communicates with a single central device.
But a central device is capable of establishing connection with two or more peripheral devices. This kind of topology is called Connected Network Topology.
Figure 4 Connected Topology
An important concept which comes into play in GATT is server/client relationship.
We would recommend you to visit the second link  mentioned below to understand the concept.

Useful/ Recommended Links:
http://www.pointrlabs.com/blog/beacons-everything-you-need-to-know/
https://learn.adafruit.com/introduction-to-bluetooth-low-energy/gatt