You are on page 1of 50

# | 

  
  
 

R  
   
      
]   
Introduction to Carotte
 R 
î  
  

 


 



 

!
 
   "
#
Introduction to Carotte
  R\$%&%\$%


  
    
  

   

  
 
 


  !     
"#
    

   #
  
  \$

  
&3. 
\$
Introduction to Carotte
   

s ouldn¶t exceed 18cm x 18cm .
© ere is no limit on eig t.

##  ©ry to put a color tag (minimum

8cm x 8cm) on top of t e robot so
t at you ave idea about t e
position of t e robot.
Introduction to Carotte
   è
© e arena will ave 12 similar objects aving same
color .
 © e robot as to detect t e object, find a s ortest pat to
t e object and put t en put it t e large box.
 W en one object is in old of t e robot , t en t e robot
s ouldn¶t interfere wit any ot er object in it¶s pat .
 © e team wit maximum objects in t e box wit in a
time interval of 20 min will be qualified for t e next
round.
 © e arena for round one is s own in t e next page.
Introduction to Carotte
6
Introduction to Carotte
   ¦
COLORED IN RBG IN EQUAL NUMBER
BOX
Introduction to Carotte
8
ÿ  
x Controlled rotation required --
--------

| 

 are preferred
| 



## xMeasured rotation and can be eld at a

particular position

| 



## xMeasured rotation and can be eld at a

particular position

## xAlignation is muc better in differential drive

| 



 
º
 | 


mmmmmmmm  
    
         
 
 


## x      

          

## x ©        

    

## x          

    
a. |ingle-Coil Excitation ±
Eac successive coil is energized in turn.
|ingle coil excitation continue««

ÔÔ Ô

Ô ÔÔ

ÔÔÔ

ÔÔÔ
b. ©wo-Coil Excitation ± Eac successive
pair of adjacent coils is energized in turn.
0011 0110 1100 1001

À 
     
  
  
     
  
  
         
  
1000 1100 0100 0110 0010 0011 0001 1001

ÔÔÔ ÔÔ

ÔÔÔ
ÔÔ

ÔÔÔ ÔÔ

ÔÔ ÔÔÔ
|   

##             

 
|

! " #   \$ %
! "& #   \$ % &
! "' #   \$ % (
! "( #   \$ % )
|
 &
! " #   \$ % *
! "& #   \$ % '&
! "' #   \$ % *(
! "( #   \$ % &)
+,  

##          

 
|

! " -& #   \$%'
! "& -' #   \$%*
! "' -( #   \$%&
! "( - #   \$%.
|
&
! " -& #   \$%()
! "& -' #   \$%.*
! "' -( #   \$%.&
! "( - #   \$%((
ÿ ,  

##          

 
|

! "#  \$%
! "-&#  \$%'
! "&#  \$%&
! "&-'#  \$%*
! "'#  \$%(
! "( -'#  \$%&
! "(#  \$%)
! "-( #  \$%.
|/0#       /  1112
Comparison

##  d    ÿ 

    
   

 !    
 !   
PC parallel Port

##  © e PC's Parallel Printer Port ad a total of

12 digital outputs and 5 digital inputs accessed via 3
consecutive 8-bit ports in t e processor's I/O space.
 8 output pins accessed via t e Ñ  

 5 input pins (one inverted) accessed via t e | º|


 å output pins (t ree inverted) accessed via t e
6  

 © e remaining 8 pins are grounded
Circuit Requirements«««««««

Ñ
: ©akes n inputs and gives 2 outputs .
«..«t e n inputs from t e parallel ports could
be used to generate 2 combination of outputs
to excite t e coils of stepper motors.
An introductory talk on Matlab

R         

   
         
  
 
 u 12333

##  ,## //-   2

  4/"2/ \$2

##  | / 5 # 2

 | 6666
 

    ! 7
44 
# #
 /482
    " 9  0\$/ #
# /4  /   :4   
 4//444 2
     #   /    
0    /# / 0  5
     4//4
44 # ;<<;= 2
O  
 

## |ome points we s ould remember w ile start learning matlab««

x No need to define variables data type.
x One Variable can ave more t en two data types.
x By default matlab create ³!  as Most recent answer if expressions
! 
are not assigned to anyt ing else.
x Variable names can contain up to 63 c aracters (as of MA©LAB 6.5 and
x Variable names must start wit a letter followed by letters, digits, and
underscores.
x If a statement is terminated wit a semicolon ( ; ), no results will be
displayed. Ot erwise results will appear before t e next prompt.
x By default matlab use å digits rounding after decimal.
ÈÈ a = 12 x Basic operator : ³ +  ,  -  ,  * 
,/
a=
x ³clc : Clear command window.
12
CLC clears t e command
ÈÈ a = 12;
window and omes t e cursor.
ÈÈ a = 23.23å2å;
x ³ ome :|end t e cursor ome.
ÈÈ a OME moves t e cursor to t e
a= upper left corner of t e
23.23å2 window.
ÈÈ a = 'swe' x ³w o :List current variables.
a= x ³w os: WO| is a long form
swe of WO. It lists all t e
ÈÈ a variables in t e current
=23å872387å 813 732 21 å2; workspace, toget er wit
ÈÈ a information about t eir size,
a= bytes, class, etc.
2.3å87e+02å x ³clear :Clear variables and
functions from memory.
CLEAR delete all t e variable
w ic are present in
|ome special variables«.!!!


Mat ematical and logical Operators

##  Power : a^b , a.^b

 Multiplication : a*b , a.*b
 Division : a/b , a./b
 \ or .\ are used w ile calculating solution of t e equation
A*x = b ; x = A\b = b/A;
  : Element-wise logical AND
 | : Element-wise logical OR
  : | ort-circuit logical AND
 || : | ort-circuit logical OR
 È= , <= , == ,~= , È , < t ese are relational operators.
for more detail : type elp ~
.m Files in matlab

## © ere are two kinds of M-files:

 |  , w ic do not accept input arguments or
return output arguments. © ey operate on data in
t e workspace.
 M 
 , w ic can accept input arguments and
return output arguments. Internal variables are local
to t e function.

6 
   
.m Files in matlab

 M 
 : click on ³create new .m file
 function [output] = <function nameÈ(input)
 like function [a,b,c,«..] = multi(A,B,C)
Matrices in matlab
ÈÈ a = [1 2 3 å 5] Any floating point number is a
a=
matrix of size(1x1).
1 2 3 å 5
For writing a matrix we ave
ÈÈ a = [1,2,3,å,5] to use ³[³ ].
a=
A vector is also a matrix , can
1 2 3 å 5
ÈÈ a = [1;2;3;å;5] be a row matrix or a column
matrix.
a=

## 1 We can write a vector in 2

2
3 different ways
å
5
Matrices in matlab
 Operations and functions for matrices(suppose ³a is a matrix)
1. transpose(a) = a¶;
2. identity matrix of size n = eye(n);
3. inverse(a) = inv(a) = eye(n)/a ((solution of a*b = eye(n));
å. size of a matrix = size(a);
5. A matrix wit only zeros(of size nxm) = zeros(n,m);
6. A matrix wit only ones(of size nxm) = ones(n,m);
7. Determinant of a matrix = det(a);
8. RREF of a matrix = rref(a);
. |quare root of a matrix = sqrtm(a);
10. rank of a matrix = rank(a);
11. If a is a vector t en maximum element is = max(a)  minimum element = min(a);
12. Diagonal of a matrix = diag(a);
13. norm of a matrix = norm(a);
1å. random matrix = rand(n,m) or randn(n,m);
15. Eigenvalues and eigenvectors of a matrix = [eigval , eigvec] = eig(a);
|ome known functions in Matlab.

##  factorial(n) : factorial of number µn¶;

 diff(f,<orderÈ) : differentiation of a function;
 int(f) : integration of a function µf¶;
 magic(n) : Magic square of size nxn;
 sort(x) : |ort in ascending or descending order;
 power(a,b) : .^ Array power;
 trace(a) : |um of diagonal elements;
 gcd(a,b) : Greatest common divisor(lcm(a,b));
 roots(c) : Find polynomial roots;
 save : save workspace variable to file(.mat format);
Plot/Figure/|urface
Plot/Figure/|urface
 plot(X,Y) : plots vector Y versus vector X;

##  ezplot(FUN) : plots t e function FUN(X) over t e default

domain -2*PI < X < 2*PI;
 ezsurf(f) : plots a grap of t e function f(x,y) using surf;
|olving
 solve(eq1,eq2,..) : |ymbolic solution of algebraic
equations.
 dsolve(eq1,eq2,..) : |ymbolic solution of ordinary
differential equations.
 And muc more««««.
For any elp type
elp<spaceÈ<function nameÈ

## like elp rref

For finding t e functions related to some
keyword type
lookfor<spaceÈ<functions properties È
like lookfor plot
x 

|
  x 
  x   

x 
 !!"!
  x #
  x  \$\$% & '(

x 
  '
O   x )
O  x  &&&&%