
Development of Mobile Robot Based on I
2
C Bus System
209
The examples of function ordering to connect a slave device through I
2
C bus to receive data
are detailed below.
5.3.1 Function ordering for encoder information reading
The encoders are mounted at motor and their information is read by motor controller
(MD25). The MD25 is designed to operate in a standard I
2
C bus system. To read encoder
information, the function ordering can follow as below.
Step 1 : I2C_START ( ),
Step 2 : I2C_SEND ( ) – Call encoder address and write mode configuration,
Step 3 : I2C_ACK ( ),
Step 4 : I2C_SEND ( ) – Write the register number,
Step 5 : I2C_ACK ( ),
Step 6 : I2C_START ( ),
Step 7 : I2C_SEND ( ) – Call encoder address again,
Step 8 : I2C_ACK ( ),
Step 9 : I2C_RECEIVE ( ),
Step 10 : I2C_ACK ( ),
Step 11 : I2C_STOP ( ).
By using the feedback information from the two encoders on the left and right wheels of
mobile robot, the position and heading angles of the mobile robot can be estimated. The
distance and heading increment can be obtained as follows. (Hye Ri Park, et. Al., 2009;
Surachai Panich, 2010a; Surachai Panich, 2010b; Surachai Panich and Nitin V. Afzulpurkar,
2011).
encoder encoder
R,k L,k
encoder
k
Δd+Δd
Δd=
2
(1)
encoder encoder
R,k L,k
encoder
k
Δd-Δd
Δψ =
B
k
(2)
Then the position can be estimated as
1,
X=X+Δd
encoder
kkxk
(3)
1,
Y=Y+Δd
encoder
kkyk
(4)
1
ψ = ψ + Δψ
encoder
kkk
(5)
where
k,
Δd=Δdcosψ
encoder encoder
xk k
k,
Δd=Δdsinψ
encoder encoder
yk k
www.intechopen.com
Komentarze do niniejszej Instrukcji