Saturday, September 10, 2011

Mechatronmics Trainer


Mechatronics Trainer


Mechatronics Trainer
Mechatronics board is a complete robotics development platform for students. Designed inspired by lady ada’s motor shield , Mechatronics Trainer gives just an extra bit for your robotic projects.
To view complete source of this article kindly subscribe here.
Figure 1 Mechatronics Trainer

Features of the board:
1) It is capable of interfacing with PS2 Mouse/Keyboard.
2) Two H-Bridge motor drivers capable of driving 2 X Stepper motors or 4 X DC motors.
3) IR object detection for Left,Right and Forward direction mainly for robotic cars.
4) LDR Light sensor.
5) Temperature Sensor.
6) 3 X Digital Switches
7) Buzzer for audio application.
8) Expansion header for direct connection to ESAT-ISP development board (Buy Here)
9) PS2 Interface

 Do it yourself – Robotics Kit
There are only two things providing motion to an object
A controller: An object having its own sensory system which translates changes in its state like speed, direction or position to digital or analog data.
A translation system: It provides a mechanism capability to move in accordance with its controller.
While most of the Industrial automation projects use joysticks many have started using UI softwares running on touch screen panels, providing a sense of human-machine interaction which exhilarates our experience in controlling the machine.
But neither joysticks nor touch screen panels can fit into a 50$ budget of a student for creating a customizable controller for his car or a robot.
Adding a sense of motion and speed control in your Robotic Car requires some extra capabilities in your controller controlling the car.
For Speed & Direction Control - It should have two – three environment variables varying proportionally according to change in their state. As explained above the readings are given in form of digital or analog data so the output data should have high resolution which enables us to determine in which direction a car should move more accurately.
A similar motion is performed while you are scrolling and moving your mouse pointer just now.
Yeah !! We can use a PS2 mouse to control and direct a robotic car accurately. To be able to use environment variables of a PS2 mouse I have used PS2 mouse library.
Here is a Project “Controlling motion of a stepper motor using PS2 mouse”

As you move scroll button of your mouse Up/Down the MouseInfo structure declared in stepper.h header file provides present information of the state of scroll position.
If scrolled up the function returns -1.
If scrolled down the function returns 1.
If not used function returns 0.
The output of the scroll function is given to a stepper motor function which uses states (-1,0,1) to controller direction of stepper motor and moves single step in that direction.
(-1) – Anticlockwise diection
(1)  - Clockwise direction
This concept can be used in variety of application like.
Industrial Automation
Computerized Numeric Control – CNC operations
·         3 Stepper motors + 1 uart
·         3 Stepper motors + ps2 mouse
·         3 Stepper motors + ps2 Keyboard
Security Camera motion control
·         3 Axis CCTV control with Keyboard
·         3 Axis CCTV control with Mouse

Robotic & College Projects

·         Using PS2 Mouse\Keyboard as joystick in Robotic Car direction & Speed Control.
·         Live Human detection and
Home Automation
·         Automatic Curtain Control
·         Room Mood Lighting
                Addition features
o   Day/Night Detection
o   Object/Human Presence Detection

/************************Code Begin***********************************/
#include
#include

/*
 * an arduino sketch to interface with a ps/2 mouse.
 * Also uses serial protocol to talk back to the host
 * and report what it finds.
 */
/*
 * Pin 2 is the mouse data pin, pin 3 is the clock pin
 * Feel free to use whatever pins are convenient.
 */

PS2Mouse mouse(3, 2);
#define STEPS 150
Stepper stepper(STEPS, 8, 9, 10, 11);

int scroll_pos;

void setup()
{
//  Serial.begin(9600);
  pinMode(13, OUTPUT);
//PINS 12 and 13 are representation of pins PORTB.5 and POTB.4 on Arduino UNO or a compatible board in Arduino software
  pinMode(12, OUTPUT);
  stepper.setSpeed(30); 
  mouse.init();
}

/*
 * get a reading from the mouse and report it back to the
 * host via the serial line.
 */
void loop()
{
  MouseInfo mouseInfo;
  mouse.getData(&mouseInfo);//Get reading from mouse structure
   digitalWrite(13, mouseInfo.leftClick); //Use digital data to control status of an Led
  digitalWrite(12, mouseInfo.rightClick); //Use digital data to control status of an Led
  stepper.step(mouseInfo.scroll);
}
/***************************Code End************************************/
References:
Make sure you have following libraries in your libraries folder in Ardunio

Obstacle Detection using Mechatronics Trainer


/************ You may skip information in this para as its only for passerby’s ************/
Before even thinking about making a robot first thing that comes to your mind is..
If I am going to construct a robot , How much time is it going to take ??
Well if you ask me ,which you might or might not ask ,But I am telling this with due respect given to time you are devoting in reading this stuff that , when I was in my graduation I had all the time to devote to do what I wanted to do. Its the only thing that matters in the end of day\week\month\year or life.
Coming back to robotics, or hobbies that you always wanted to pursue take my advice always start development with a tested source of hardware with some software examples. I am not telling you this to promote what I have developed, just in case you find the information given in this blog useful. I just want to share with my fellow students who are in league of becoming an MBA with an engineering degree that learning embedded and doing projects on robotics is not a rocket science course. Anybody having a basic understanding of C\C++ and computer architecture can do wonders in this field.
/****************************************************************************/

(Published in Embedded For You Magazine Issue: July – August 2011)

No comments: