Construction of YAHYA: Chapter Two
Construction of YAHYA: Chapter Two
Construction Of YAHYA
2.1.Mechanic Parts
19
2.2.Motor Type Selection
Stepper motors operate in a very simple manner: a central rotor with fixed
magnetic poles is placed between electro-magnetic end-pieces, known as stators. The
stators are individually switched off and on with N or S bias in a defined order. The N
and S polarization is dependent upon the direction that the current flows through the
electromagnet. Properly sequenced switching of the stators’ polarization precisely
moves the rotor to the corresponding stator at a controlled speed. Hence, stepper motors
have both positional and speed control built into their drive mechanism. In effect, the
rotor takes a precise, defined “step” to the next position as needed. Simply put, finer
control of the rotor is possible by increasing the number of stators. Stepper motors are
simple devices. However, electronic circuitry is required to control and drive the stepper
motor because each stator must be switched on and off with a set polarity in a very
defined sequence if smooth motor motion is desired. As the circuit that controls the
stepper motor has two very convenient advantages – outstanding position and speed
control –the motor can be directly attached to a linear actuator to drive a piston in
20
precise increments. Thus, the control circuitry can be programmed to compensate for a
number of additional properties encountered in any given use.
We preferred DC motors in our project because of their easy use and no need for
extra circuitry to drive them and it is important in robotics - not to load the robot with
extra circuitry so we used two DC motors to move YAHYA and one for his arm and one
for his hand. (See Figure 2.2) We used as a driver circuitry only two integrated circuits -
L293D- for these four motors that will be dialed with details later.
2.3.Batterries
We used 4 x 1.2 V = 4.8V CPL High Current (1400mAh) Size AAA batteries to
supply the required current for motors and as will be described later in electronics part,
we also use an extra power circuitry with LM 7805 to supply +5 Volts to logic inputs.
(PIC 16F877, op-amps, L293D’s V CC1)
Our DC motors required almost 1 A to 1.15 A in application so we needed an
extra power circuitry from LM 7805. We used high current 4 X 1.2 V (1400mAh)
batteries in series for motors and a 9 V battery for LM 7805 power circuitry to overcome
this difficulty.
21
CHAPTER THREE
This is the power circuitry of YAHYA (Figure 3.1), in fact LM7805 is not an
efficient way of supplying power in robotics but we used this power circuitry in
microprocessor’s laboratory in Z-80 construction experiments and we wanted to use
same circuitry. Shortest way is the way that you know!
The LM78XX series of three terminal regulators is available with several fixed
output voltages making them useful in a wide range of applications. One of these is local
on card regulation, eliminating the distribution problems associated with single point
regulation. The voltages available allow these regulators to be used in logic systems,
instrumentation, HiFi, and other solid-state electronic equipment. Although designed
primarily as fixed voltage regulators these devices can be used with external components
to obtain adjustable voltages and currents.
The LM78XX series is available in an aluminum TO-3 pack-age which will
allow over 1.0A load current if adequate heat sinking is provided. Current limiting is
included to limit the peak output current to a safe value. Safe area protection for the
output transistor is provided to limit internal power dissipation. If internal power
dissipation becomes too high for the heat sinking provided, the thermal shutdown circuit
takes over preventing the IC from overheating. Considerable effort was expanded to
make the LM78XX series of regulators easy to use and minimize the number of external
components. It is not necessary to bypass the out filter capacitor of the power supply.
Features
- Output current in excess of 1A
- Internal thermal overload protection
- No external components required
22
- Output transistor safe area protection
- Internal short circuit current limit
3.2.Switches
We used this simple switch circuitry in our project at three position: in front of
YAHYA to detect the wall, at the arm to detect the position of the hand and at the hand
to detect if the ball is dropped or not. (See Figure 2.2)
3.3.Control Unit
My project friend Çağlar dials this part of our project with details but I want to
give some brief information about micro controllers.
A micro controller is a highly integrated chip, which includes, on one chip,
all or most of the parts needed for a controller. The micro controller could be called a
"one-chip solution".
23
It typically includes:
-CPU (central processing unit)
-RAM (Random Access Memory)
-EPROM/PROM/ROM (Erasable Programmable Read Only Memory)
-I/O (input/output) - serial and parallel
-Timers
-Interrupt controller
3.4.Motor Drives
The L293 and L293D are quadruple high-current half-H drivers. The L293 is
designed to provide bi-directional drive currents of up to 1 A at voltages from 4.5 V to
36 V. The L293D is designed to provide bi-directional drive currents of up to 600-mA at
voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as
relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-
voltage loads in positive-supply applications.
All inputs are TTL compatible. Each output is a complete totem-pole drive
circuit, with a darling ton transistor sink and a pseudo-Darlington source. Drivers are
enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by
3,4EN. When an enable input is high, the associated drivers are enabled and their
outputs are active and in phase with their inputs.
When the enable input is low, those drivers are disabled and their outputs are off
and in the high-impedance state. With the proper data inputs, each pair of drivers forms
a full-H (or bridge) reversible drive suitable for solenoid or motor applications. On the
L293, external high-speed output clamp diodes should be used for inductive transient
suppression. A V CC1 terminal, separate from V CC2, is provided for the logic inputs to
minimize device power dissipation.
24
Figure 3.3 L293D Quadruple Half-H Drivers Schematic
V CC1 is used for logic inputs of the integrated circuit and we supplied power to
the V CC1 from LM7805 power circuitry and V CC2 from external batteries.
3.5.Sensors
YAHYA had to detect the black line over a white surface so we decided to use
CNY70 Reflective Optosensor with Transistor Output.
25
3.5.1.Information About CNY70 Reflective Optosensor
The black line presence sensor uses reflective optosensor with transistor output
CNY70. The CNY70 has a compact construction where the emitting light source and the
detector are arranged in the same direction to sense the presence of an object by using
the reflective IR beam from the object. The operating wavelength is 950 nm. The
detector consists of a phototransistor.
3.5.1.1.Applications
Opto-electronic scanning and switching devices i.e., index sensing, coded disk scanning
etc. (opto-electronic encoder assemblies for transmission sensing).
3.5.1.2.Features
26
Figure 3.6 Internal Structure of CNY70
The designed forward current through the emitting LED is approx. 30 mA.
Voltage signal from output transistor goes through voltage comparator and make a
decision whether the line is black or not acoording to the voltage levels.
There is three sensors at the bottom to detect the line and one sensor also in front
of the YAHYA to detect if he is in front of the basket or not. (See Figure 3.8)
Here is the all combinations of bottom sensors:
27
And here is the a picture of YAHYA with sensors:
To detect the
basket
3.6.Comparison Circuitry
After comparison of voltage levels with LM741 integrated circuit shown in the
Figure 3.9, black line is represented with logic 1 and white line with logic 0 to be
understand with our PIC controller.
28
3.7. Complete Circuit
29
CHAPTER FOUR
Conclusion
At the beginning of the project we decided to find the place of the basket with
ultrasonic sensors – one transmitter at basket and two separate sensors at the robot – but
their sensitivity levels are very poor and we could not obtain qualified ones and
ultrasonic sensors are more suitable for obstacle detection. Then we decided to use
infrared sensors but they were also not suitable for us because of effect of daylight or
another environmental light sources on them. Then we decided to use reflective opto
sensors CNY70 with a line in the field to detect the position of the basket.
We had problems during the project with power supply of our robot. Because of
overload on our robot it requires high current, we solved this problem with using
separate batteries to feed the robot. For motors we used 1400mAh ( 4 X 1.2V ) batteries
and for logic circuits we used our LM 7805 power circuitry and we overcome this
problem.
In fact we want use LM 2940 1A low dropout regulator instead of LM 7805
because of our current problem but after solving it with high current batteries, we give
up this idea. But it will be better to use LM 2940 in robotics power supply circuitries.
30
REFERENCES
[1] DNA Sequencing Strategies, Automated and Advanced Approaches, Ed. W.
Ansorge, H. Voss, and J. Zimmerman, J. Wiley and Sons, 1996
[2] Asfahl, C. R. Robots and Manufacturing Automation. J. Wiley and Sons, 1992
[3] Engelberger, J. Robotics in Service, M.I.T. Press, Cambridge, 1989
[4] D. Kahaner, Robots and use in Japanese industry, U.S. Office of Naval Research
Asia report, 1991 (ftp://ftp.cs.arizona.edu/japan/kahaner.reports/robots)
[5] Klafter, R. D., Chmielewski, T. A., and Negin, M. Robotic Engineering: An
Integrated Approach, Prentice Hall, Englewood Cliffs, NJ, 1989
[6] Stanford DNA Sequencing and Technology Center, http://sequence-www.
stanford.edu/group/techdev/auto.html.
31
APPENDIX A
SOURCE OF CODES
;---------------------------------------------------------------
LIST P=16F877
#include <p16f877.inc>
;----------------------------------------------------------------
SAYAC1 EQU 07eH
SAYAC2 EQU 07dH
BCF STATUS,RP0 ;Select memory bank0
CLRF PORTA ;Clears portA
CLRF PORTB ;Clears portB
CLRF PORTC ;Clears portC
CLRF PORTD ;Clears portD
CLRF PORTE ;Clears portE
;----------------------------------------------------------------
BSF STATUS,RP0 ;Select memory bank1
CLRF TRISB
movlw B'00001100'
movwf TRISD
movlw B'00111111'
movwf TRISC
BCF STATUS,RP0 ;Select memory bank0
;-----------------------------------------------------------------
TEST_ELSENSOR
CLRF PORTB
BTFSC PORTD,3
GOTO TEST_SHTSTOP
GOTO KOLGERI
32
TEST_SHTSTOP
CLRF PORTB
BTFSC PORTD,2
GOTO TEST_FWSENSOR
GOTO EL
TEST_FWSENSOR
CLRF PORTB
BTFSC PORTC,2
GOTO TEST_SWITCH_1
GOTO SHOOT
TEST_SWITCH_1
CLRF PORTB
BTFSC PORTC,4
GOTO TEST_SWITCH_2
GOTO TURN
TEST_SWITCH_2
CLRF PORTB
BTFSC PORTC,5
GOTO TEST_SENSOR_2
GOTO TURN
TEST_SENSOR_2
BTFSS PORTC,0 ;If on black, go forward
GOTO TEST_SENSOR_1
GOTO FORWARD
33
TEST_SENSOR_1
BTFSS PORTC,3 ;If on black, go left
GOTO TEST_SENSOR_3
GOTO LEFT
TEST_SENSOR_3
BTFSS PORTC,1 ;If on black, go right
GOTO FORWARD ;Go forward
GOTO RIGHT
;---------------------------------------------------------
FORWARD
movlw B'10010000'
movwf PORTB
CALL GECIKME
CLRF PORTB
GOTO TEST_FWSENSOR
LEFT
BSF PORTB,4 ;Right wheel turns
BCF PORTB,5
CALL GECIKME
CLRF PORTB
GOTO TEST_FWSENSOR
RIGHT
BSF PORTB,7 ;Left wheel turns
BCF PORTB,6
CALL GECIKME
CLRF PORTB
GOTO TEST_FWSENSOR
34
TURN
BCF PORTB,7
BSF PORTB,6
CALL GECIKME
CALL GECIKME
CALL GECIKME
CALL GECIKME
CALL GECIKME
CALL GECIKME
GOTO TEST_FWSENSOR
SHOOT
CLRF PORTB
BCF PORTD,7
BSF PORTD,6
CALL GECIKME
GOTO TEST_FWSENSOR
EL
BCF PORTD,6 ;Stops arm
BCF PORTD,4 ;Starts hand
BSF PORTD,5
CALL GECIKME
GOTO TEST_ELSENSOR
KOLGERI
CLRF PORTB
BCF PORTD,5 ;Stops hand
BCF PORTD,6
BSF PORTD,7
CALL GECIKME
35
GOTO TEST_ELSENSOR
GECIKME
MOVLW h'FF'
MOVWF SAYAC1
DONGU1
MOVLW h'FF'
MOVWF SAYAC2
DONGU2
DECFSZ SAYAC2,F
GOTO DONGU2
DECFSZ SAYAC1,F
GOTO DONGU1
RETURN
DONGU
GOTO DONGU
END
36