Thursday, 2 April 2015

HOW TO MAKE STEERING MECHANISM OF SEGWAY.

Steering is one the most important part while making your own segway.
I'm going to explain you this concept in this article that how steering works. So at first, things that you will require are as follows :

1) Accelerometer ADXL335 (analog 3 axis)
2) Rotary potentiometer
3) Microcontroller (I've used Arduino Uno)
4) Mechanical structure of handle bar (steering)

So why these items?

Mount your accelerometer on handle bar in a suitable position so that is remains fixed on bar.
Basically Accelerometer will sense the tilting of your handle bar as that will send the analog inputs to your microcontroller  and as the controller senses these inputs the microcontroller will produce PMW signals that are being put by you in arduino (code) thus these PWM signals will go to you motor driver and thus your motors will actuate accordingly.

If you don't want to use accelerometer you can also use potentiometer beneath your steering and produce analog signals by change in resistance. This part is little complicated so I don't prefer using only potentiometer but you can also use accelerometer as well as potentiometer which will help to bring smoothness in your ride.

http://bildr.org/blog/wp-content/uploads/2011/04/adxl335.png

The accelerometer module has 5 pins, namely
  1. GND-To be connected to Arduino's GND
  2. VCC-To be connected to Arduino's 3.3V
  3. X-To be connected to Analog Pin A0
  4. Y-To be connected to Analog Pin A1
  5. Z-To be connected to Analog Pin A2
Code for ADX335L:

Released under the MIT License - Please reuse change and share
//Simple code for the ADXL335, prints calculated orientation via serial
//////////////////////////////////////////////////////////////////


//Analog read pins
const int xPin = 0;
const int yPin = 1;
const int zPin = 2;

//The minimum and maximum values that came from
//the accelerometer while standing still
//You very well may need to change these
int minVal = 265;
int maxVal = 402;


//to hold the caculated values
double x;
double y;
double z;


void setup(){
  Serial.begin(9600); 
}


void loop(){

  //read the analog values from the accelerometer
  int xRead = analogRead(xPin);
  int yRead = analogRead(yPin);
  int zRead = analogRead(zPin);

  //convert read values to degrees -90 to 90 - Needed for atan2
  int xAng = map(xRead, minVal, maxVal, -90, 90);
  int yAng = map(yRead, minVal, maxVal, -90, 90);
  int zAng = map(zRead, minVal, maxVal, -90, 90);

  //Caculate 360deg values like so: atan2(-yAng, -zAng)
  //atan2 outputs the value of -π to π (radians)
  //We are then converting the radians to degrees
  x = RAD_TO_DEG * (atan2(-yAng, -zAng) + PI);
  y = RAD_TO_DEG * (atan2(-xAng, -zAng) + PI);
  z = RAD_TO_DEG * (atan2(-yAng, -xAng) + PI);

  //Output the caculations
  Serial.print("x: ");
  Serial.print(x);
  Serial.print(" | y: ");
  Serial.print(y);
  Serial.print(" | z: ");
  Serial.println(z);

  delay(100);//just here to slow down the serial output - Easier to read
}
 
 
  For more help in details visit : ADXL335 IN DETAILS


Tuesday, 4 November 2014

How exactly segway works


The Segway personal transporter is a device that transports one person at relatively low speeds. The low-speed (limited to approximately 20 kmph) operation combined with its electric propulsion system makes the Segway a candidate for providing short-distance transportation on city streets, sidewalks, and inside buildings. When a Segway is in use, the device is driven by two wheels that are placed side-by-side, rather than the standard in-line configuration of a bicycle or a motorcycle. When the operator leans forward, the wheels turn in unison in the same direction to provide forward motion. In order to stop, the wheels must accelerate forward to get out in front of the system's centre of mass and then apply a deceleration torque to slow the system down without causing the operator to fall forward off the device. These operating principles are reversed to allow the system to move backward.
            In order to turn, the wheels rotate at unequal speeds causing the system to travel in an arc. If the system is not translating forward or backward, then the wheels can rotate in opposite directions to turn the machine in place.However,it is not possible for the human operator to balance the device, as they can with a human-powered inverted pendulum such as a unicycle. The sensors in the device must constantly be measuring the state of the machine and feeding this information to the computer controller. The controller then uses this feedback signal to adjust the wheel speed so that the forward/backward (pitch) falling motion is maintained within an acceptable envelope so that device and rider do not fall over. Note that under many operating conditions, the system is mechanically stable in the side-to-side (roll) direction. Therefore, the computer does not attempt to control the roll motion. Assuming wheel-ground rolling stiction, the system is also stable in the yaw direction.However, the computer must change the yaw rate in order to turn the machine in 10 response to the operator input. It also limits the turning rate to a maximum value.

Fig1 Segway

  A Segway is often used to transport a user across mid range distances in urban environments. It has more degrees of freedom than car/bike and is faster than pedestrian. However a navigation system designed for it has not been researched. The existing navigation systems are adapted for car drivers or pedestrians. Using such systems on the Segway can increase the driver's cognitive workload and generate safety risks.

Physics Behind Segway

The physics behind segway:
The Segway is a uniquely sophisticated machine that uses on-board computers working with multiple sensors and redundant physical systems to sense the motions of the rider, and to react to those motions. The “Stand up Scooter” requires the rider to learn how the machine will respond to the throttle and brake, while physically holding on to the machine to counter the unbalanced forces of acceleration and deceleration.
Fig1 Forces acting on segway rider


Diagram A, on the left shows person standing, with gravity and the Segway reaction force in balance. In diagram B Person has leaned forward to start moving. The purple arrow is gravity/weight.The magenta arrow is the reaction force of person against the Segway. The dashed blue line is the vector sum of the two. If the Segway doesn’t respond person will fall forward as the Segway is pushed backward. Diagram C shows the response of the Segway as it senses the tilt of the Segway platform as person leans forward. The computers order the motors to power the wheels and accelerate the Segway. The force of acceleration is the red arrow, and the reaction force of the Segway to person is the orange arrow. The dashed yellow line is the vector sum of the two. Diagram D shows that the sum of the forces in diagrams B and C are in balance. The vector sums run through each other and the rider, so there are no unbalanced forces or torque. The on-board computers adjust the power to the wheels to keep the forces balanced through the rider. This is what makes the Segway unique.
Fig 2: Segway Balances the Forces on the Rider in All Phases of Riding


Fig 2 shows how the Segway keeps the rider in balance during all phases of a ride: stationary, accelerating, cruising at 6 mph, and decelerating. This continuous balancing of forces is what makes riding the Segway possible. There are no unbalanced forces to topple the rider off the Segway, which is why many people with diseases or injuries which result in muscular weakness, such as Muscular Dystrophy or Multiple Sclerosis, can safely ride a Segway. They do not have to compensate for unbalanced forces with their own strength - the Segway does it for them.
On a Segway you initiate moving forward by leaning forward. The Segway senses your leaning and accelerates forward, balancing the forces, and you are underway. This is the process shown in Fig 2 above. The beauty of this is that the Segway is controlled by same set of reflexes and reactions that control basic human locomotion. Even if you can’t walk due to physical limitations, you retain these reflexes and reactions.

Monday, 6 October 2014

Components Required To Make a Cheap Segway


The approximated cost in INR is Rs 24,000

Environmental Benefits from Segway


The Segway  has many benefits for you and the environment.

It will reduce the impact of global warming by checking greenhouse gas output and fossil fuel consumption.

If we are able to replace 10% of 900 million car travel to 3 mile with the Segway  there would be:  
§6.2 million fewer gallons of gas consumed.
§286 million fewer pounds of CO2 emitted every day.

How segway works?? ..(Part1)

How Segway Works??

Concept Behind Segway


The Segway is a dynamic system that is commonly referred to as an inverted pendulum. The Segway and rider form a more complicated inverted pendulum that has uncertain time-varying dynamics. Non-inverted pendulums, like crane payloads and the oscillating arm inside a grandfather clock, swing back and forth in a stable manner with limited amplitude. These types of dynamic systems occur throughout the world in useful products. On the other hand, inverted pendulums do not naturally swing back and forth with a well-controlled oscillation. Rather, they fall over. The simplest form of an inverted pendulum consists of a mass attached through a massless rod to a base mass. This is commonly known as a cart-pendulum system.
INVERTED PENDULUM






      
      The cart is free to move horizontally. The rod is connected to the cart through a rotational pin joint. This system is in unstable equilibrium when the rod is standing upright. Mathematically, this equilibrium can be maintained as long as there are no input forces whatsoever on the system. However, such conditions do not exist in real systems and some means of stabilization is needed to maintain the pendulum in the upright position. A force F must be applied to the cart in order to move the cart pivot back and forth from one side of the pendulum mass centre to the other side. The pendulum is always falling over, but the cart motion tries to keep the leaning angle at a small level.
       When a Segway is in use, the device is driven by two wheels that are placed side-by-side, rather than the standard in-line configuration of a bicycle or a motorcycle. When the operator leans forward, the wheels turn in unison in the same direction to provide forward motion. In order to stop, the wheels must accelerate forward to get out in front of the system's centre of mass and then apply a deceleration torque to slow the system down without causing the operator to fall forward o_ the device. These operating principles are reversed to allow the system to move backward. In order to turn, the wheels rotate at unequal speeds causing the system to travel in an arc.
       If the system is not translating forward or backward, then the wheels can rotate in opposite directions to turn the machine in place. Given the side-by-side wheel configuration, and the elevated centre of mass, the mechanical design of the transporter is unstable. It will fall over if the computerized control system is not continuously turning the wheels. This constant adjusting of the device is similar to a person balancing an inverted broom in their hand. In order to keep the broom upright, the person must continually move their hand in the direction that the broom is falling. The hand must pass to the other side of the broom's centre of mass to generate a torque that will cause the broom to start rotating in the opposite direction. As a result, the broom is always falling, but the hand motion keeps changing the direction of the fall.
       Just like the inverted broom, the Segway and rider are always falling. However, it is not possible for the human operator to balance the device, as they can with a human-powered inverted pendulum such as a unicycle. The sensors in the device must constantly be measuring the state of the machine and feeding this information to the computer controller. The controller then uses this feedback signal to adjust the wheel speed so that the forward/backward (pitch) falling motion is maintained within an acceptable envelope so that device and rider do not fall over. Note that under many operating conditions, the system is mechanically stable in the side-to-side (roll) direction. Therefore, the computer does not attempt to control the roll motion. Assuming wheel-ground rolling friction, the system is also stable in the yaw direction. However, the computer must change the yaw rate in order to turn the machine in response to the operator input.