Showing posts with label robotic arm. Show all posts
Showing posts with label robotic arm. Show all posts

Sunday, September 29, 2013

Movement Detection System integrated with a robotic arm (4 degrees of freedom)

 Introduction    

Among most of the devices have to be able to identify users believe that our project is still among the least developed in Mexico, which is in some part a challenge to achieve the identification of a person using this type of verification since there are many sources on which we rely to conduct our research, which even we can make this as one of the early research in development of such devices.
In everything that you want to try find the part where we realize that it is easier to allow access for multiple people to a certain place using iris recognition, this is intended to replace or provide an alternative to the identification of users, as the process is carried out using radio frequency credentials or HandKeys that recognize patterns of user's hand, which are already used in the CIC (Computing Research Center).
The research conducted for this project includes many theoretical sources on the Internet about robotic arm mobility with the use of mathematical formulas to calculate the movement of the arm and Internet sources code which was adapted only to make it work according to our needs.
Among the objectives we seek with the development of this project has the mark a breakthrough in the development of these and achieve with this foster the development of such projects by students of the IPN, as there are some that have not been realize that they have the level to do them. 
1. Theory system architecture 
INVERSE KINEMATICS

Kinematics deals with the description of motion without regard to its causes.
The objective of the inverse kinematics is to find the gesture to be taken by different joints for the end of the linkage reaches a specific position.

Background 

Theory of devices to be used for project development.

The system will try to have the camera on one end, and at the other end we have the robot arm.
The gesture for an articulated system reaches a particular position is defined by the inverse kinematics.
For the preparation of standard servo arm will use ¼ scale servo force and effect, the reason is because they have the inverted rotation, thus both servos receive the same pulse width to be placed in the desired position.
A servo is basically an electric motor which can only be moved at an angle of about 180 degrees (not provide full turns as normal engines).
It has three wires, red is supply voltage (+5 v), black is ground (GND), and the yellow wire is the power by which they are required to accommodate servo what position (0 ° to 180 °), ie the control cable.
Inside the servo controller card tells the DC motor rotate few laps to accommodate the arrow in the position that has been asked. The variable resistor (also called "pot") is subject to the arrow, and measures to where this rotated at all times. This is how the controller card knows where to move the engine. 
 

The desired position is given to the servo by means of pulses (PWM). All time must be a pulse signal present at the control cable to the servo hold its position.
These "orders" are a series of pulses. Pulse duration indicates the rotation angle of the motor. Each servo has its operating margins, which correspond to the width of the maximum and minimum pulse the servo understand.

The following table shows some pulse widths that correspond to the angles of the servos.

 

STANDARD SERVO FORCE 

Operating Voltage: 4.8-6.0V
STD Address: Opposite to clockwise / pulse that travels 1500-1900 μ sec.
Puesto Torque: 6.0V: 3.5 kg.com (49 oz. / In), 4.8V: 3.2 kg.com (44.8 oz. / In)
Operating Speed: 6.0V: 0.19 sec / 60 ° at no charge, 4.8V: 0.23 sec / 60 ° at no charge
Weight: 39.2g (1.37 oz.)
Size: 40.6 x 20.0 x 38.9 mm 

Controlling our servos with different arm angles each q we can do this would be brought in different places detected.
 
The axes of motion are set by servo motors, which are controlled by the leading card installed called The R / C Servo Controller II. This card is based on a PIC microcontroller that connects to the serial port of the PC.In

this case we use the PIC16F628A microcontroller as compared with pic16f84 has twice USART program memory and 4 MHz internal clock, which simplifies the circuit and reduces the cost.
FLASH is a CMOS microcontroller 8-bit RISC architecture capable of operating at clock frequencies up to 20 MHz, easy to program and capsules available in DIP (Dual row of pins) and SOIC (surface mount square  shaped) 18 pin. It has an internal 4 MHz oscillator circuit Power-on reset to eliminate the need for external components and expand to 16 the number of pins that can be used as lines I / O (Input / Output, Input / Output) purpose Overall, unlike the PIC16F84 that only use 13 pins as inputs or outputs in the two ports. Additionally, not forgetting his Harvard architecture RISC instructions, the PIC16F628 provides a data memory EEPROM 128x8 (128 bytes), a program memory FLASH 2024x14 (2K with 14 bits per location), a data memory RAM general purpose of 224x8, CCP module (capture / compare / PWM) a USART, 3 analog comparators, a voltage reference and three programmable timers. These and other features make it ideal for automotive, industrial, and consumer electronics, as well as programmable tools and equipment of all kinds. The pin of the PIC16F628 is identical to the PIC16F627, except that the latter has a program memory FLASH 1024x14. It is also identical to the PIC16F84, PIC16F628 except that you can have three I / O lines additional port A (RA7, RA6, RA5, the latter can only be input) and some I / O pins are multiplexed with alternate function for the various peripheral devices that supports the chip. For example, RB1 line also functions as USART reception (RX). Generally, when a peripheral is enabled, the line can not be used as an I / O pin general purpose.  

  




Using the code

Using PICBASIC, we write some lines for PIC16F628A, this will only put a serial sign in a port for servomotor:



INCLUDE "bs2defs.bas"
symbol pos = b3
symbol servo = b4
trisa  = %11111111
trisb  = 000000
 
serpin  VAR porta.0 'serial input pin
 
start:
   serin serpin,N2400,pos 'get serial input from PC
 
move:
  
   pulsout portb.0,pos ' send data to position servos
   pause 10
 
  goto start  ' do it again


Here is a diagram that describes the phisical model of the integration between servomotor and pic.
 
After understading inverse kinematics we write some lines to resolve the formula of Kinematics:



 Here is the result of  INVERSE KINEMATICS in c#:
 



After getting the angles, we should convert this measure to Signal using RS232 protocol:


Other posibility is using Wiimote implementation, so using some characteristics of the controller we write some lines:
       
 

Points of Interest   

References
The Image Processing Handbook, John C. Russ, Fifth Edition, 2007 Publisher Taylor & Francis.
OpenCV Bookseller, http://opencvlibrary.sourceforge.net/FaceDetection
OpenCVDotNet Bookseller, http://code.google.com/p/opencvdotnet/
• AForge.NET, http://code.google.com/p/aforge/
Speech SDK 5.1
Eye Detection Cascades, by Modesto Castrillón Santana, (OpenCV Developers Community)


History   

First Draft 28/07/2013

UPDATE 29/05/2016
You could found script uploaded to github on the next link:
https://github.com/osanchezh/agenteinteligente-xiller