Thursday, June 9, 2011

nBot Balancing Robot - Dua Roda

David P. Anderson

nBot adalah sebuah robot balancing roda dua.
Robot ini tampil sebagai NASA's Cool Robot of the Week pada 19 Mei 2003. Setelah website online Scientific American's, SCI / Tech Web Awards, menghormati memberi penghargaan sebagai salah satu dari 10 rekayasa teratas dan situs web teknis untuk tahun 2003.

Ide dasar untuk sebuah robot beroda dua dinamis balancing cukup sederhana:  menggerakkan roda ke arah dimana robot akan jatuh. 

Jika roda bisa didorong sedemikian rupa untuk mempertahankan pusat gravitasi robot, maka robot tetap seimbang. 




nBOT membutuhkan 2(dua) sensor umpan balik : 
  1. sebuah sensor kemiringan atau sensor yang digunakan untuk mengukur sudut kemiringan robot berkenaan dengan gravitasi, dan
  2. rotary encoders roda untuk mengukur posisi dasar robot. 

Empat syarat cukup untuk mendefinisikan gerakan dan posisi dari "pendulum terbalik(inverted pendulum)" untuk mencapai keseimbangan robot. 
  1. sudut kemiringan 
  2. derivatif pertama, kecepatan sudut
  3. posisi platform 
  4. derivatif yang pertama, kecepatan platform. 
Keempat pengukuran dijumlahkan dan diumpan balik ke platform sebagai tegangan motor, yang sebanding dengan torsi, untuk menyeimbangkan dan menggerakkan robot.
Berikut ini adalah diagram algoithm dengan cuplikan program :
The Algorithm for two-wheel balancing robot nBot.

The balancing algorithm measures two outputs from the
robot and calculates the torque forces from the motors
needed for balance.  Here is an ascii-art block diagram:


               +---------------------+--------------+
    +--------< | Motor shaft encoder |              |
    |          +---------------------+   Motor PWM  | <-----+
    |    +---< | Angle sensor        |              |       |
    |    |     +---------------------+--------------+       |
    |    |                                                  |
    |    |     +-------+      |\ angle                      |
    |    |     |       |      | \ velocity                  |
    |    +-----| Deriv |------|K1-----+                     |
    |    |     |       |      | /      \                    |
    |    |     +-------+      |/        \                   |
    |    |                               +-----+            |
    |    |                    |\ angle   |      \           |
    |    |                    | \ pos    |       \          |
    |    +--------------------|K2--------+        \         |
    |                         | /        |         \        |
    |                         |/         |          \       |
    |                                    |  SUM      +------+
    |          +-------+      |\ wheel   |          /
    |          |       |      | \velocity|         /
    +----------| Deriv |------|K3--------+        /
    |          |       |      | /        |       /
    |          +-------+      |/         |      /
    |                                    +-----+
    |                         |\ wheel  / 
    |                         | \ pos  /
    +-------------------------|K4-----+
                              | /
                              |/


The boxes labled "Deriv" calculate the derivative of the inputs
by subtracting the last sample from the current sample.  For the
shaft encoders this gives the wheel velocity, and for the angle
sensor this gives the angle velocity.  The four triangles labeled
K1 through K4 are the "knobs" that apply gain to the four feedback
signals.  They are then summed together and fed back to the robot
as the PWM motor voltage. Here is the same thing in C code:

/* define constants.  In the demo these were set with a knob */

#define K1 20
#define K2 50
#define K3 10
#define K4 22

/* HC11 16 bit integers for tilt sensor and shaft encoder */

int angle, angle_velocity, last_angle;
int wheel, wheel_velocity, last_wheel;
int torque;

/* the code */

void balance()
{
    while(1) {  /* loop forever */

 angle = read_analog(TILT_SENSOR);
 angle_velocity = angle - last_angle;
 last_angle = angle;

 wheel = read_wheel_encoder();
 velocity = wheel - last_wheel;
 last_wheel = wheel;

 torque = (angle * K1) + (angle_velocity * K2)
   + (wheel * K3) + (wheel_velocity * K4);

 pwm(torque);

 msleep(40); /* sleep 40 milliseconds */
    }
}



This loop runs 25 times per second, measuring the wheel position and
tilt angle and updating the motor voltage to achieve balance.  The
constant for the wheel location, K3, is set equal to 0 for the
robot to travel, and to non zero (10 in this case) for the robot
to hold its location.

For driving the robot, the desired X offset is summed in with the
velocity term.  Steering is accomplished by adding an offset to
one motor and subtracting it from the other.  This does not effect
the balancing mechanism.  Obviously there is a lot left out of this
sample piece of code, but the principal is the same.

03 Aug 2001
dpa





Baca juga : Eksperiment Robot Pendulum Dua Roda - dan - Video Uji Coba   Buku Terlaris : Self Balancing Two-Wheeled Robot: A study on controlling a two-wheeled robotic vehicle Self Balancing Two-Wheeled Robot: A study on controlling a two-wheeled robotic vehicle

No comments: