Friday, December 26, 2014

Introduction to robotics -3(Writing the program)

In the previous post I pointed out some of the key things about the hardware components and software techniques that I used to construct the robot. I this post I hope to give more insight into the software perspective of the design.(I assume you have read the previous article and the links I provided . )

In this project my main concern was on to the software side since most of the hardware I used was either simple or they are already on a working phase (like Arduino and the chassis.)Anyway before you write your software it’s important to realise what sort of functionality you are expecting from the robot and break it down to simpler objectives. In my case the functionality of the robot can be brake down into several steps.

  1. Moving the robot to forward, backward, left and right.
  2. Detect an obstacle in the path.
  3. React to the obstacle by turning to a different direction.
  4. Continuing moving along the new direction until it encounters another obstacle.

To achieve the above tasks I used a simple program which is written using Arduino IDE. Here is a simple flowchart which summaries what the program does. The 15cm boundary is an arbitrary value, you can use any value which is in the sensor’s detection range. but I recommend  small values since the sensor is not very accurate in long distances. Initialise is the process of feeding the program and the controller about the necessary settings like the I/O pins used the constants, Interrupts etc.. I’ll explain this when I get to the actual program. The delay function which I used in the program does very important task and I would like to explain the importance of that. It’s a fact that mechanical systems are always slower than electronic systems when responding. So there will be a delay when you send an electrical signal to a mechanical system to do something and actually starting to do that thing. It won’t complete that command instantly .So a delay is needed between two commands to complete each. Otherwise your system will act in unpredictable ways. You should keep this in mind when programming since it’s not straightforward. It’s one of the most important thing s I learned in my uni. You can use any amount of delay time .with some trial and error you can easily find the most suitable delay time.

Initialise

As I mentioned above initialisations prepares the system and the program for the execution. It basically consists of declaring the I/O pins, variables  and interrupts. there is a separate function called Setup() to initialise the system. Outside this you can declare the functions you are going use and any #define statements. I have used timer interrupts to trigger the sensor every 50ms and take a distance measurement. So I strongly recommend you to read the article about the interrupts or you can just copy the code of mine. It’s a must to know how to tackle interrupts in embedded systems , otherwise your programs are not going to be function efficiently. If you want to change the trigger time all you have to do is to change the value of OCR1A to a value you desire within it’s range. Besides this you have to include two libraries which handle interrupts in setup().

Figure1-Flow chart



 Moving the robot

Moving the robot in a particular direction is one of the primary task in any robotic project .So first of all I wrote a simple program to check the movement of the robot and to verify my hardware is working as I expected, especially the H-bridge control circuit. To achieve this I used 5 functions that each set the pins connected to the DC motors in a particular configuration. ( by setting these pins high or low you can control the direction and rotation of the motors.). I declared them as void since we don’t need that function to return anything .
Figure2-An example for control function 

 









This pin configuration can be unique or not but play with your motors to figure it out. But keep in mind not to put all the pins in HIGH since it will damage the IC. It’s always encouraged to use separate functions to carry out different tasks and not to do everything in the main() function. This practice is important when the program gets complex and branched. The functionality of the main() is like the functionality of a leader in a team. A leader is not there to do everything by himself but rather to coordinate others to do what they are capable of. Like that by separating different functions it gets easy when debugging and finding  errors.
Besides that there are two other functions to measure the distance and to trigger the sensor every 50 ms . When using interrupts there is a common practice to declare the variables used in ISR to be declared as volatile. The reason for this is to indicate to the compiler that variable can be changed a synchronically to main since it gets updated by the ISR. if you don’t declare the variable as a volatile type the variable might not get updated correctly .So it’s an important aspect to remember.



Figure3-Distance measure function













Distance value is in cm and you can change this by changing the constant 29.1 but I think cm is a reasonable range for the robot. I used a delay  of 1ms to get some time for the sound wave to spread out and reflect back into the sensor. I used unsinged int as the return type of the function since a distance can only be a positive value but recently I came to know that it’s recommended to not to use unsigned number types in practice since it might causes some troubles if you try to do arithmetic with that. Since  I don’t do any mathematical operation to  it seems legit to use it.    

Figure4-ISR function                      











This ISR function is a defined function. So all I did was to write the content of the ISR. So when the timer interrupt is triggered it will execute the Measure _distance() function and update the variable x which holds the distance value.

Figure5-Configuring Timer 1                                












I highly recommend to read this article to understand the above configuration settings .It’s really important to understand how interrupts works in order to create good designs. If you would like to use that configuration without any change it’s ok but if you want a different time (this is set to trigger every 50ms) you can change the value in 0CR1A register. For example if you double the value (780*2=1560) interrupt will trigger every 100ms.
Although this was a simple design I learned lot of things...and above all I had a chance to put the knowledge I gained in my studies to build something really works. That’s was a great experience for me.
There are some cons in the design that I would like to discuss in here.

  • Sometimes the robot’s behaviour gets unpredictable and it fails to spot an obstacle and gets hit. My primary suspicion was it was due to a fault in sensor since it only happened few times. and sometimes it stopped moving  for no apparent reason. As s solution I changed the location of the sensor to a centre position and it improved the performance of the robot.
  • According to the Figure1, when the robot detects an obstacle it only turn to right side. It’s not a very intelligent behaviour .Therefore I wrote another sketch to improve the ability to decide a direction to go when it encountered an obstacle. I’ll give you that in the next post.

You can download the complete sketch  for the project and play with that around .but I highly encourage you to write your own sketches since it will improve your programming skills .I will give a detailed information about the improvements I have done to the design in the next post.

Below are few photos of my robot Walt...








Saturday, December 13, 2014

An Introduction to robotics-2

In previous post I talked about some background information about what kind of things you have to consider when planning to build a robot. In this post I’m going to extend that to another prospective. I’m going  to give you some very simple but useful information about several things you want to know about basic electronics and programming in general. and also I assume the reader has at least some basic knowledge in C programming and how to use Arduino IDE and other associated softwares.

As I told earlier it’s easy to design a robot(or any other design) if we breakdown the whole thing into several pieces and designing each one carefully. There are few advantages of this approach.

  • You will have a good understanding about each section and how they all fit together in a much larger system and the functionality of each section.


  • When something goes wrong (believe me it will) you don’t have to check each and every part, just the part associated with the fault, it will narrow down your scope and saves some time.

  • You can reuse what you have done in a project in another project if it’s suits with the requirements. It will save your effort since you don’t need to do everything from scratch .  Ex: if you wrote a function to compare two input values and send the result to main function rather than doing everything in the main, you will be able to use that function in some other instance with fewer or no changes.


  • Take your time to design and think about what you are going to do before you are actually going to do it. Thinking is one of the most important things in building something. It will help you to save your time, money and effort.



Some thoughts on embedded system programming 

There is no huge difference between writing a program to a PC and for a microcontroller .but there are few yet very important aspects that you have to remember when writing programs to a microcontroller.

  • Microcontrollers have very limited amount  of resources(memory and processing power)to work with. Therefore you have to be very careful about the size of your program and the memory it’s going to use during the execution.


  • Most of the time you will be using C or a derivation of C to program. Therefore it’s a good thing that you are comfortable with using C as a language. C is wildly use in embedded systems because it’s a well structured and easy to learn language. If you are a working most of your time in high level languages you might feel C is very low level language but that’s the thing what makes C is very suitable for system programming.

 
In this first project I didn't use much complicated things but I think there is a concept that you have to be familiar with, Interrupts. Interrupts are one of the fundamental things in embedded   environment. An interrupt is simply an asynchronous process with respect to a main program which is used to get information to the microcontroller from outside world or within the system. There are 2 types of interrupts.

  • Hardware interrupts
  • Timer interrupts


A signal from a push button press is an example for a Hardware interrupts and sending a pulse to the system using a clock provided to indicate something to the system is an example for a time interrupt. As I said interrupt is a technique used to get inputs into a system. There is another way to do this .It’s called polling. Checking for an input within the main program constantly is called polling. Using interrupts have a significant advantage over polling in embedded system because interrupts are asynchronous .Interrupts can happen anywhere within your main and you don’t need to worry about that once you set up an ISR (Interrupt Service Routine) to handle that interrupt. I’ll provide some links where the reader can get more information about interrupts . It’s very important to understand the role of interrupts and how to use them effectively in programming.

Electronics  used in the project

Since I’m using Arduino as my control system(Brain) to the robot it made lot of things easy for me. Although I didn’t want to worry about building a system from scratch there was a big constrain . Arduino is a good platform for robotics but it cannot provide enough current to drive heavy loads like DC motors. It’s maximum output current is 40mA and voltage is +5V.So I had to think about a way to drive 2 DC motors without destroying my Uno board. In electronics it’s done by using a H-bridge circuit. A H- bridge consists of MOSFET transistors that can control both speed and direction of the motors. I used a L293D chip to control the motors.   There are motor driver shield that can drive upto 4 DC motors but the price was too high for me and also I needed only one  since an IC can control 2 DC motors and it costs me only 3.95 AUD. You can easily purchase these type of  IC in web cheaper.




L293D IC



Pin configuration of the IC














  • Voltage range : According to the datasheet L293D can output   4.5V to 36V.My motors working voltage is around 7.2V.there for it’s ok to use this chip.

  • Output current is 600mA and maximum output current is 1.2A. My motors draw 450mA(each) in normal operation and the stall current is about 1.17A.So The IC can drive these 2 motors without much trouble.


This is a great video I followed to get this thing work. I’ll explain more about the chip when required. 

 Pin description of the IC

Enable 1,2 – These pins control the motors. If they are  high motors work ,if they are low motors are   disabled. Connect these pins to +5V pin in the Uno  board for this project.

GND – Simply connect these 4 pins to ground of the Uno .

Vss  - Power supply to the chip.(+5V).  
             
Vs  -  Power input to the motors. You can connect your battery output to this pin.                                                       
Input 1,2 – These are used to control the motor1.by setting pins like High, Low or Low, High you can change the rotation direction of the motor. Never set both pins in High as it will damage the chip. Setting both pins low will turn off the motor.

Input 3,4 – These are used to control motor2.Same functionality as Input 1,2.

Output 1,2 and 3,4 – These 4 pins connects to the motor 1 and 2.


Sensors

HC-SR04 Sensor-Pins from left-VCC,Trig,Echo and GND

 I used a conventional HC-SR04 ultrasonic sensor as my sensor to detect the obstacles and send that measured value to the microcontroller. All you have to know is that this module sends out an HF wave and by detecting a reflected wave t can calculate the distance. Obviously You have to write a program to do so. In my experience these are good to detect things that are away up to 80cm after that it might give you wrong readings but since it’s very cheap  it’s very good sensor for a simple robot project.

Pin description of the sensor


VCC – power input to the pin (+5V)

GND – connects to the ground pin of the Uno.

Trig -  Setting this pin high will emit a HF wave from the sensor.

Echo – When the sensor detects an HF wave it sets this pin to high and by using a function called pulseIn() we can find out the time taken by a wave to return to the sensor. This value is in milliseconds and it has to be divided by 2 in order to get the value for the time taken by the wave to reach to the obstacle from sensor.

So these are some things that I believe you have to be familiar in order to build a simple robot. I’m not going give you every detail about how I built my robot since it’s inappropriate and you can use these guidelines to design your own robot. In the next 2 posts I hope to discuss more on the structure of the programs I wrote for the robot. 

Picture of my robot-Walt


Further Readings

Please refer to these websites and documents to improve your knowledge.


















Tuesday, December 9, 2014

An introduction to robotics

It’s a pleasure to be here after a while. I’m having my summer vacation after a long, stressful but exciting semester and I’m hoping to spend my vacation studying robotics and microcontrollers with my knowledge I gained throughout the semester. So I thought to share some of my experiences about planning and building simple yet very exciting robotic projects I've done so far.

Building a robot by your self could be a challenge. It depends on how complex your robot project is. But it’s rewarding. You’ll get to know a lot about electronics and programming and it’s a great chance to use your knowledge to building something cool if you already have some academic background in electronics and programming. I’m expecting to write few blog articles about how I carried out my projects and in this article I’m hoping to present some basic ideas about robotics and design. Please use the links I’m providing throughout the article to expand your knowledge. 


First thing first

When we are  planning to build a robot we need to have an idea about what sort of robot  we need or the requirements .In my case I wanted to build an obstacle avoiding robot which is capable of detecting obstacles ,avoid them as much as possible and wander around in a given area. Next step would be searching for different examples in web and have an idea about how those types of robot functions, what sort of materials they have use to build the robot  and what is it capable of. There are lots of  very good websites in the web which were very helpful in my case. As well as these ,you need to be aware of your budget .If you are a student like me you won’t be able afford much to building a robot but it’s good to have at least few hundred dollars if you wish to buy some materials for your robot.




Modelling your robot

Every robot can be simplified into four simpler sections.
  • Sensors, Inputs and outputs
  • Control system
  • A Power Source for robot
  • mechanical parts

The combination of all these sections makes pretty much every robot we see. So when planning it’s much easier and efficient to break your model into these categories and find the most suitable parts for your application.

Power source

The main power source for  a robot will be batteries .Things like solar panel will be a good idea if your robot will spend much of it’s time out door but even in that case batteries will be there as a backup power source. So it’s good to do some research about types of batteries used in robotics before you start. The article in here is a good article about different types of batteries and what are the pros and cons of them.  Rechargeable batteries are a good option if you can afford them since they are a bit expensive and you might need a purchase a specially designed battery charger along with them but if you are hoping to continue your robotics consider it as a good investment. In general you may be able to find good deals in E Bay or Amazon  if you search them a bit. Currently I’m using 6 conventional AA size batteries (1.5V) and a 9V battery as the power source for my robot  and I’m ok with them since I’m not extensively using my design.

Sensors ,Inputs and outputs


Sensors are another important part of any robot since they are the only way your robot can get to know it’s surroundings. There can be many types but some simple common sensors would be IR sensors, ultra sound distance sensor , photo resistors and thermal sensitive transistors etc. By  utilizing these you can give the robot an idea about it’s surroundings and to respond to them accordingly. In here I used an ultrasound distance sensor (HC-SR04) to measure the distance and navigate the robot. Your outputs would be LEDs, Speakers or even LCD displays which are capable of inform something to you about the status of your robot.
Image retrieved by http://blog.oscarliang.net/how-to-use-ultra-sonic-sensor-arduino-hc-sr04/

A Control system


For most of us this would be the first thing comes in to mind when we talk about robots .Controls system acts like the brain of the robot. It takes the inputs from sensors ,process them according to the instructions given  by the program and decide what do according to the results and sends the control signals to the required hardware.There are lots of microcontrollers you can choose to program your robot .Arduino is one of the most popular platform for robotic applications and I’m using that an Arduino Uno board to control my robot .It’s considered as one of the best platforms for the beginners and it’s a pretty decent and sufficient board for most of the robots applications. It is capable of many functionalities that you can use to control a robot and there are lots of support for Arduino projects out there in web and it’s very helpful when you got a problem or trying out new things and you need some support. I highly recommend official Arduino web site as a reference.

Image retrieved by http://store.arduino.cc

All other mechanical and electrical components


This categorises all other moving and non moving parts like the chassis , electrical motors connectors wheels etc. I’m not going to this section in detail about these as my primary concern is electronic and software section of the robot and I don’t have much knowledge about the mechanical parts or how they work. So my solution to this was to buy an assembled chassis from web and all I have to do was design electronics (both hardware and software)to control the motors . I used a tank type chassis (RP5-CH02) as the base of my robot because it got all the motors and gear systems that otherwise I have to build. So it’s completely up to you to make a decision but if you can build a chassis ,then you will have more freedom to customize your design.  
 
Image retrieved by http://static.rapidonline.com


So in my next post I’m hoping to talk about some of the things you may need to know about  electronics and software fields to make a robot.    

Thursday, September 4, 2014

Parallel Computing



“Parallel computing is a method of computation in which multiple calculations are carried out simultaneously” (Wikipedia). Although parallel computing was initially restricted to high performance computing, physical constraints like heat dissipation has meant that the interest in parallel computing is now across all computing disciplines including personal and mobile computing.



By parallelizing the computation, it is expected that the workload on any given processing unit is smaller thus avoiding hitting physical constraints in processors architectures. Also by employing multiple processors for the same job, it is also expected that the job gets completed quicker. However the benefit of parallel execution on execution speed is constraints by Amdhals law. Amdhals law states that the “Speedup of a program using multiple processors is limited by the time needed for the sequential fraction of the programme” (Wikipedia). This law is quite important for the industry to realise that not all the problems are benefited by solving them under parallel computations.


(Amdhals law, Image retrieved: Wikipedia - http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/AmdahlsLaw.svg/300px-AmdahlsLaw.svg.png)




Computing parallelism is achieved at different levels starting at bit level and going on to instruction level, processor core level and machine level. Bit level parallelism is easily identifiable by the existence of 32 bit and 64 bit operating systems. Increase in bit level parallelism enables the processor to complete computations with less number of instructions.

On the other hand instruction level parallelism enables the processor to have a larger instruction pipeline. A larger instruction pipeline will mean that at any given moment the processor can process multiple instructions that require different kinds of operations.

When computer processors reached speeds closed to 3GHz, it started getting close to physical limitations, specially respect to unmanageable heat dissipation. Rather than trying to increase the frequency of a single processor the industry came up with the multi-core processor design where each processor runs close to 2.5GHz. There are designs that also treat the graphical processing unit (GPU) as an additional processor thus increasing the internal computer parallelism even more. These innovations have begun to reach mobile devices as well (Most new smart phones have multi-core processors)

There is also multiple method of parallel computing achieved by combining large number of computing units (machines, processors etc…) together. Distributed computing, cluster computing, massively parallel computing (MPP) or grid computing are some of these where each one differs from the other based on their architectural differences.


Google is a great example of huge commercial cluster computing unit. Although its details are not publicly available information it’s one of the largest ISPs in the world. The beauty of its cluster is the usage of general purpose Linux computers to cater for ~60k search queries Google gets each second (http://www.statisticbrain.com/google-searches/). Most of the large social computing platforms like Facebook and Twitter are using the same technique to cater increasingly large amount of computation they have to perform.

Parallel computing challenges computers scientists with a different set of problems like state management, race conditions and orchestration. It’s also generally accepted the programming for parallelism is harder and less efficient than sequential programmes, although this could well be due to the fact that current programming landscape is built on years of development in sequential thinking. Programming languages like Scala, F# and Haskell are working hard to make programming for parallelism more intuitive and productive.

Parallel computing may well have more innovation in the pipeline and holds a huge promise towards the evolution of computing in general. It has contributed immensely to both hardware engineering (Processor manufacturing, networks) and software engineering practices.

Sunday, July 27, 2014

Mobile Computing

If you haven’t read my previous article about internet and Pc, please read it here.

(Image retrieved from: http://www.globalgrind.com)

Wikipedia defines Mobile Computing as “Human Computer Interaction by which the computer is expected to be transported during normal usage”. While the PC started taking computing machines to everyday consumer, mobile computing has really infiltrated average consumer market and revolutionized computing as a whole. Mobile computing is spreading faster than any other consumer technology in history. It has opened up new possibilities for human interaction by enabling the continuation of the computing experience regardless of geographical location. Smart phones have revolutionized not just computing but society as a whole since it’s ability to connect people in a very convenient and personal way.

Mobile computing is mainly delivered at present via smart phones and tablets; however it applies equally to PDAs, in vehicle computers, electronic readers, wearable computers etc...At present the mobile computing market is divided in to 3 main platforms namely Apple iOS, Google Android and Microsoft Windows.

Innovation in mobile computing can be categorised in to hardware, software and process. Hardware innovations can be seen around areas such as device power management, touch screens, material design for portability etc… An everyday smart watch at present is deemed to packs more computing power than the super computers that took Apollo 11 to the moon. This feat is mainly due to innovations in engineering practices such as materials, electronics and design powered by sheer competitive nature of the market. Devices on the brink of mass scale usage such as Google Glass and Agent smart watch will continue to expand the boundaries of mobile hardware technologies.




Although initial focus on mobile computing was mainly around its hardware, an increasing amount of attention is give to Software. Whole new software areas like mobile apps, location aware programming, and inter-device communication are developing every day thanks to the population of mobile computing. The open nature of the platforms enabling anyone with right skills to build and distribute software for mobile devices has feed the exponential adaptation of mobile computing among general public. 

Another aspect of mobile computing is its contributions to engineering and management practices such as industrial design, supply chain management and mass scale production/distribution. Global companies like Apple or Samsung are heavily dependent on a highly optimized and synchronized set of engineering and management processes to churn out quality devices in millions each day.

 Mobile computing posses its own engineering and social challenges like security, privacy, inconsistent connectivity, potential health hazards and quality of interaction. Regardless of these challenges mobile computing is expected to play a major role in the future of computing.


















Sunday, July 20, 2014

Internet and age of PC

Personal computers have been around here for almost 40 years and have changed the way people live in many different ways. Now we live in a society where a PC is a very common, affordable and very useful instrument that we use to carry out day to day tasks. Before 1950 the computer was considered as an instrument which can only used by highly educated people like scientists and engineers. Then computers were used for commercial purposes too. By 1955, there were only 250 computers throughout the world and in mid 1980’s 1 million personal computers had been sold.
The following graph illustrates the growth of personal computer sales from 1980 to 1984.It clearly shows the popularity of PC usage has been increased.
There were  handful of reasons for this,

·         The size of the computer was reduced due to the use of transistors and IC (semiconductors).
·         The performance and capabilities of the pc increased dramatically.
·         With the capabilities of PCs getting increased, the reliability of the machine and the data it outputs were increased too.
·         With all these improvements one of the main reason for the popularity of computers among general public was the decrease in its price. With new semiconductor technology manufacturers were able to make more powerful computers for a much lower price. 


As the computers become an essential part of peoples’ lives, manufactures started to invest more and more in research for better technologies. As a result things like microprocessors were invented and these inventions created new pathways to other technologies like mobile phones, PDAs, embedded systems. In 2008 worlds first processor consisting of 1 billion transistors (Intel Itanium) was introduced and this is considered as a milestone of microprocessor manufacturing because it indicates an upper boundary for the development of microprocessors using conventional technologies. Please read the post in the following link to know more about the latest trends in








(Image retrieved from http://upload.wikimedia.org)
There are other areas that was heavily influenced by PCs. Entertainment is an industry which was changed exponentially due to the use of PC. Before the emergence of PC people had very different ways of spending their leisure time. But nowadays people spend most of their free time using PCs or other technology related instruments. Computer games are one of the main uses of computers nowadays and consoles are the newest trend in gaming. And also it is estimated that the total worth of gaming industry in the world was about $105 billion dollars in 2010.It gives us a picture about how computers have changed  human lives in just few decades.

Internet and World Wide Web

Today we all are living in a world where over a billion of people in the world are connected  to each other. The Internet or the World Wide Web is a result of years of research and commitment of thousands of people. It can be considered as triumph for the whole mankind. Nowadays it’s almost impossible to carry out most of the tasks without the help of World Wide Web. Social networking, Online banking and purchasing, entertainment, communication and online education are some of the benefits of the Internet.
The predecessor of the Internet was a network called Arpanet. It was the first of its kind to use packet switching technology to transfer data. It was designed in 1969 and used 2 computers in Stanford and UCLA universities as hosts. As with this initial step, others who were interested with networking of computers began to construct other facilities like email, eBooks and web forums. But most of these activities were limited only to scientists and engineers and they weren’t used by general public until the World Wide Web emerges. In 1983 TCP/IP protocol was introduced to the Arpanet and this expanded the amount of devices that can be connected to the network. In 1984 DNS (Domain name system) was created. It’s the system that converts the numerical address of a webpage to a more human friendly humanoid phase. The importance of the IP address is that it’slike the name given to the device which is connected to the network and this helps the device to identify itself and communicate with other devices. In 1990, Tim burners Lee who proposed the World Wide Web and designed it created the World Wide Web .He introduced the current standards that used in internet like the HTTP (Hyper Text Transfer Protocol), HTML (Hyper Text Mark up Language) and URL (Universal Resource Locator).The first webpage was created in 1991 and It consists of an introduction for the world wide web.  
Nowadays the internet is immensely large and no one knows how much information is out there and the location of the information that someone needs. So there are Softwares like Google, Internet Explorer to help people to find out what they want in Web. The first web browser which public could access was Mosaic which was introduced in 1993.Netscape was its competitor which was introduced in 1994.And also It was the web browser which was laid foundation for the browsers like Firefox and Safari. One of the major uses of Internet is online transactions and security related to financial transactions. In 1995 Netscape Navigator created SSL (Secure Socket Layer) and this allowed to user to do online transactions safely. Later this led to concern of online security because people found methods to steal information transmitted through internet and use them in illegal actions. Several attempts were taken to minimize this and the most efficient method was to encrypt the data, nowadays RSA encryption is wildly used to encrypt transaction details .The algorithm which is used to decrypt data was developed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. 




















(Image retrieved from http://www.cohn-family.com/encryption.htm)
In 1998 Google come into web as a search engine. Soon it becomes famous among general public because the success of its search results and it’s simple yet very effective interface. Nowadays Google is the most preferred web browser and the service provider in Internet because of the large amount facilities they are providing for the user such as Gmail, Google maps and Google drive. Google search engine is categorised as a crawler –based engine. It uses programs called crawlers to gather information about websites. The most interesting feature of the Google search engine is that it can track users and use this information to provide customized search results. Although this is a very innovative way to personalize the web experience, it has become a highly controversial topic since some people interpret this as spying on its users.
File sharing is another benefit of the internet .In 1998 the first file sharing software Napster launched. Users were able to share audio files over internet. Nowadays people can downloadmultimedia or other files directly by the host or using a torrent. With rapid advancement of modern telecommunication facilities general public have access to very high internet speed and size of the files are no longer a constraint for the users .A torrent is a way to download files through internet. It was created by a programmer called Bram Cohen in 2001.A torrents file is a small file which contains the details of various hosts that the file can be downloaded. Programs like Bit Torrent can read these files and download the same file from several sources simultaneously. But file sharing facility is a very controversial one because it directly affects the copyrights of a production. Nowadays almost any software, movie, song and other multimedia can be easily downloaded and the owners of those things won’t get any benefit for this. This is illegal by law in many countries but the file sharing keep popularising among youths.
In the first couple of decades, Internet (including Arpanet) was a place to share scientific, business and other professional ideas, knowledge and resources. Most websites were dedicated to these purposes. After 2000, things changed rapidly and the web has transformed into a more complex and diverse place. Social networking is a major component in web and the most popularized portion in the web. Social network websites like Facebook, Myspace and Google+ give opportunity for people to build relationships like never before. The impact of this new phase of the web is huge over general public when comparing to earlier stages of internet in both social and technological way. These websites are called the second generation of the websites (web2.0) because these are highly interactive and user friendly. For example, Blogs are way to represent any individual’s ideas and thoughts and to have arguments and to have conversations in cyber space. In websites like Flickr users are given space to upload their photographs and share with other people. These new technologies define the way people interact with each other.
In the next article I hope to write about a fresh trend in computing, mobile computing and the next version of the internet ,The internet of things. 

Thursday, July 10, 2014

Digital era of computers(the saga of computers,part 2)

If you haven't read my previous post about the inception of computer.Please read it from here.
Before the digital computers, all computers were mechanical computers .that means the computer were built using mechanical components likes gears and wheels. They were simple machines that were capable of doing computations.
replica of the first electro-mechanical computer, Image retrieved by www.wikipedia.org
World’s first electro- mechanical was Z1 which was designed by Konrad  Zuse. These were built using Vacuum tubes that can act as a switch in electrical circuits. Z1 is the first computer that used Boolean logic for problem solving. Besides that it was the first computer to use floating point numbers in calculations. Although Z1 used many mechanical components, its design had all the components of a modern digital computer like a control unit, memory unit, and input output devices. Although its outputs weren’t highly reliable .These computer series (Z1, Z2 and Z3) helped to develop most of the theories about computing that are used nowadays. The reason for the unreliability of output data was due to the huge number of mechanical components it had. These mechanical parts mostly consist of metal plates and due to the stresses that occur inside these when in operation, the machine wasn't able to carry out given calculations precisely.

During World War 1 and 2 technological advances was increased like never before because scientists were encouraged to invent new technologies which helped some nations to win war and rise against other nations. Lots of technologies we are familiar nowadays were developed during that period including computer technology. Alan Turing, the famous mathematician who is considered as the father of modern computing laid the mathematical foundations for the digital computers. He theorized a theoretical machine called “Turing machine” which is the grandfather of modern computers, mobile phones embedded systems and almost any digital device you can think of.

During this period scientists were able to design and construct special purpose computers. They were huge machines which consumed lots of power and human effort to operate but this simpler machines were the grandfathers of modern computers. They were called special purpose since they were only built to carry out a special task. Colossus computer is an example for this type of computers. It was built by British military to decode the secret “Enigma” code  which was used in their communications. It was considered as unbreakable but with the help of his machine British army was able to read all German messages and this machine helped to end the 2nd world war quickly saving many valuable lives.





Picture of the Colossus computer.
 These computers architecture was different to computers now a days. There wasn’t any internal memory for the computer and everything was programmed and programming this computer meant configuring it’s hardware according to the programme they are executing. This was very tedious and time consuming task. As you can see single computer needed a team of operators and only highly trained professionals like engineers or scientists were able to operate it.  

In this time computers were expensive machines due to the high price of it’s hardware ,the transistors were not available and everything was done by using vacuum tubes. As new technologies emerges scientists realised the potential of computer and they built more general purpose machines which could be programmed using softwares and carry out variety of programs .A computer called SSEM was the world’s 1st stored program computer which was built in 1948.It was a milestone in history of computer science. ENIAC was the 1st general purpose computer. UNIVAC 1 became the 1st commercial computer which can be programmed according to the requirements of it’s client.(You can view more details about UNIVAC from here.)

In this time people were more focused on the hardware of the computer since they weren’t cheap and only limited number of manufacturer were there to buy them. With the progress of system design people begun to pay attention to software as well. In the beginning programming was done by using machine language and it was a very difficult task .then people began to use word phrases (mnemonics )to represent a piece of machine code and assembly language was introduced. it made programming much easier but it was still platform dependent and programmers had to programme different types of computers using different assembly languages due to this. They were called low level programming languages because they were just a more human readable version of machine language. So to solve this scientists invented more advanced and abstract programming languages like Fortran , COBOL  and C. They were platform independent and gave much freedom to the programmer to write programs to a computer without knowing it’s architecture. They are called high level languages. These languages made programming a computer much easier but still assembly is very useful since it gives more control of a computer to the programmer and no high level language can directly access hardware of a computer. These high level languages use a special program called compilers to translate the program a programmer wrote to machine code that a computer understand.



In the next post I’m hoping to write the internet era of the computers. Reading the evolution of computers is fun and enjoyable. It may sound like rubbish but there are lots of things to learn from past and we can imagine how the future generation will think about the computers that we use today and I think it won’t be very different from the picture we have in our minds towards the technology about 50 or 60 years ago.  




Tuesday, July 1, 2014

From stones and sticks to bits and bytes,the saga of computers


                                                                     
                                                                The above images represent the journey of humans of finding the first number systems up to the modern world of computers.You might wonder if such simple ideas have evolved up to so complex things which are the building blocks for the prosperity    of  our era.I enjoyed studying this history of how the evolution of computation happened and I am going to share some of the key milestones of that period with you as well as how might our future will be shaped by the future trends in computing.

1.1 Early history of computing


The history of computation goes back thousands of years in human history. People began counting before inventing any number system. It was crucial part of their lives. The purpose of computing was to keep records of various activities that were important for their survival. For example, a shepherd would count his sheep by matching each sheep with a stone when he take them to feed and this helped him to count them back when they return home. Gradually various civilizations came up with their own number systems and counting mechanisms. Evidence for number systems could be found in very early civilizations such as Babylonian, Egyptian and Mayans. After different societies started dealing with each other (mainly for trade purposes) each number system began enriching and gradually Hindu-Arabic number system as we know it today became the most accepted. It took a few more centuries to evolve this simple number system to a knowledge system known as mathematics today. Various mathematicians discovered and invented rules, processes and limitations in place to enhance the breath, accuracy and speed of computing power. However with the industrial revolution and the progress of technology, the demand for faster and more accurate computing came to the forefront like never before. In a period spanning not even a century, humans have achieved exponential growth in computing power and along with it grew an enormous spectrum of data. With the rapid development of computer technology, computing and manipulation of data has become the back bone of our civilization. without the aid of calculating machines or rather computers, world can’t survive for a day since almost every machine need instructions to operate and the only language they can understood is machine language consists of ones and zeros. People began counting even before they form societies or cities. The techniques were simple but sufficient for their needs. Early people only needed numbers to keep track of their resources like number of their cows, cattle, sheep etc. They simply used their fingers of their hands to match each of the units they wanted to count and if the fingers weren’t enough, they used pebbles or other similar objects to count. These methods were efficient when the number of things to count is small in quantity. But as the things get more complex, people needed faster and more reliable methods for calculation.

1.2   Invention of Abacus

(Figure1.2-Image retrieved from www.computerworld.com)

The use of Abacus spread quite rapidly among people because of it’s capability to do arithmetic far better than any other means used beforehand. The modern version of Abacus was invented in China around 1200 A.D. (A brief history of the abacus, 2013).Russia, Japan, Greece and Aztecs are the other countries and tribes that used abacus (different methods than China) for the calculations. Its ability to handle more numbers, efficiency in counting and keeping records and also the ability to use it for simple arithmetic like addition, subtraction, multiplication and division were some of the advantages of using abacus. Although it’s a mechanical device, it couldn’t do calculations by itself like calculators or computers these days, all calculations had to be done by the operator and it helped him to visualize the ongoing calculation in his mind. So the accuracy of the calculation was completely depended on the human factor.

1.3 The Pascal machine(Pascaline)


(Figure 1.3 Image retrieved from http://www.sciencemuseum.org.uk)

Pascal machine was invented by famous French mathematician Blasé Pascal .It was the first successful mechanical calculating machine in 17th century. (Dave, 2007).It was a machine capable of only addition but it could perform subtraction, multiplication and division when considered subtraction as the complement of addition and multiplication as a repeated addition and division as repeated subtraction. Pascaline was consisting of rotating wheels, gears and dials and wood parts.
The purpose of the machine was to be used in tax collection. Pascal had to solve many problems due to the nature of the currency of France. Above all, the Pascaline wasn’t a very successful invention .The mechanism of the machine was a good one but to get considerable amount of accuracy, it had to be handled with great care. So eventually the reliability of the results was depend on the operator.


1.4 The Analytical machine


(Figure 3.2.1,Image retrieved from www.pcmag.com)

The analytical engine is considered as the first model of the modern electronic computer. This machine was an improvement of a previous invention called difference engine of Charles Babbage who is considered as the father of modern computing because of his innovative ideas on computing. Babbage designed this machine to be used as a programmable machine that can be customized according to the requirement rather than building machines that could only execute a specific set of instructions. Another similarity of this with digital computer was that there were separated areas for different tasks like executing commands, processing data and storing outputs and intermediate results. A punch card system was used to feed the data into it and results were displayed as plots. (The machines were intended to use for calculations of polynomials). Ada Lovelace got the chance to be the first computer programmer in history by programming the analytical engine. Besides her contribution to program the machine she had a vision that one day the machines like these can be programmed to do much more things other than mire mathematical calculations. These machines all were completely mechanical devices which weren’t even close to modern electronic computers. But the new concepts discovered along with these machines like the logical structure of a computer, separate storing of data from processing unit and the input and output methods still are accepted and valuable in computing. These machines provided the basic foundations for the early computing devices. There were some other important milestones in mechanical devices history. In 1890 the census office of America used a mechanical tabulator for the census purposes which was designed by Herman Hollerith. They were able to complete the census only in one year otherwise would take about 7 years to complete. This showed the power of artificial devices in computing and the advantages of using them in complex calculations.

I’m hoping to continue the next era of computer age ,The inception and evolution of digital computers by the next post.