In Uncategorized on December 26, 2010 by sunnyar

Segway is most commonly refers to a two-wheeled, self-balancing electric vehicle invented by Dean Kamen. It works on the principal of inverted pendulum. In simple terms, if the rider leans forward while on the segway, it would accelerate in the forward direction. Similarly, if one leans backwards, it would decelerate.

We used Arduino Mega to implement for our Segway project which does the following computations for us. Complete code is attached for reference. Following tasks are performed using Arduino which are explained later in this page.

1. Reading encoder inputs from optical encoders using interrupts.

2. Reading Accelerometer Input and Gyro Input.

3. Implemented Complementary filtering technique for Segway angle computations.

4. Implemented strong filter (smoothening) for Segway Velocity computation.

5. Implemented Simpson integrator for generating accurate turning torque.


1. IMU (Accelerometer and Gyro)

2. Optical Encoders (3 required)

 a.	Steer count

 b.	Left Motor Count

 c.	Right Motor Count

Circuit Diagram of Segway segway electrical diagram

Please click here to go through the code explanation.

Complete code can be found here.

For details refer to Mechanical design, Simulink model and control system design please refer here.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: