Segway prototype

Embed Size (px)

DESCRIPTION

balancing robot

Citation preview

Salim khan Electronic Information Engineering Super Visor Prof Bai Lin

Salim khanElectronic Information EngineeringSuper Visor Prof Bai Lin2 Wheel Balancing robot

2 Wheel Balancing robot TheSegway is atwo-wheeled, self-balancing,battery powered electric vehicleinvented byDean Kamen. It is produced by Segway IncofNew Hampshire, USA. The nameSegwayis ahomophoneof the wordsegue, meaningsmooth transition.PTis an abbreviation forpersonal transporter.Computers and motors in the base of the device keep the Segway PT upright when powered on with balancing enabled. A user commands the Segway to go forward by shifting their weight forward on the platform, and backward by shifting their weight backward. The Segway detects, as it balances, the change in its center of mass, and first establishes and then maintains a corresponding speed, forward or backward.Gyroscopic sensorsand fluid-based leveling sensors detect the weight shift. To turn, the user presses the handlebar to the left or the right.

Balancing a small platform

Working Principal.0X-XMotor pushes the other way based on the angle.

Angle measurement based off the accelerometer reading.Gain is a constant based on your setup.HardwareArduino Uno (8-bitAtmelAVR microcontroller)L298H-bridge ( motor control) Actuators (Gear Dc Motors ) 6V: 440RPM and 250mA free-ruTyres (Rc car tyres )IMU (MPU-6000/6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Devices)IMU-GY521The MPU-6000/6050 devices combine a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die together with an onboard Digital Motion Processor (DMP) capable of processing complex 9-axis MotionFusion algorithms.user-programmable gyro full-scale rangeof 250, 500, 1000, and 2000/sec(dps) and a user-programmable accelerometer full-scale range of 2g, 4g, 8g, and 16g.

IMU

Block Diagram of the System

FiltersWhy do we need filters.The raw data from the IMU has very much noise.With the time the gyro drifts and that will lead the robot to fail.

Accelerometer and Gyro The problem with accelerometersAs an accelerometer measures all forces that are working on the object, it will also see a lot more than just the gravity vector. Every small force working on the object will disturb our measurement completely. If we are working on an actuated system (like the Segway), then the forces that drive the system will be visible on the sensor as well. The accelerometer data is reliable only on the long term

Kalman Filter

The Kalman filter estimates a process by using a form of feedback control. The states of the process is estimated by the filter at a certain point and then obtains a feedback of noisy measurements. Therefore, the equations for the Kalman filter fall into two groups, the time update equations and measurement update equations

Kalman Pros and ConsTheoretically ideal filter for combining noisy sensors to get clean, accurate estimates. ConsComplex algorithmHard to implementWould kill processor time.

The complementary filter

Complementary FilterAngle = 90%*(Angle + Angular Velocity*dt) + 10%*(Non Filtered Angle)Clean AngleHigh Pass ConstantPrevious Clean AngleAngular Velocity Reading from GyroTime Rate of samplingLow Pass ConstantRaw Angle Reading from AccelerometerThis integration converts angular velocity to angle.Low PassHigh PassPros and cons of complementary filterCan help fix noise drift and horizontal acceleration dependency.Fast estimates of angle.Not very processor- intensive.

ConsNot very accurate estimate like Kalman filter.

Results Comparison of Kalman and Complementary filter(rest)

Results Comparison of Kalman and Complementary filter(moving)

Results Comparison of Kalman Complementary filter and simple ..gyro(moving)

PIDAfter implementing the filters the PID is applied to make the robot balance.

PID is The proportional term Kp * e(t) is an output value based the difference between the set point and actual point.

The integral term is the sum of all errors over time, this term allows the controller to advance the output such that all the errors are eventually cancelled out.

The derivate term, is based on the first derivative of the proportional error, it checks if the error is getting smaller as time goes by.

TuningKalman tuningThe filters performance could vary greatly if the parameters are not properly adjusted.

1. The initial covariance matrix.2. The state estimate vector.3. The Q matrix and its corresponding random noise vector w.4. The R matrix and its corresponding random noise vector v.

Kalman Values of Q_accelerometer and Q_gyroscope are set depending on how much confidence one puts on the particular sensor. A higher value indicates that the particular sensor is trusted less as compared to the other sensor. The value of the R_measurement matrix indicates the amount of noise expected from the measurement, a low value indicates that the measurement is less corrupted with noiseThe filter tuning method used on this project was done by trial and error. Once the tuning covariance matrices Qw and measurement matrix Rv constant parameters provided the desire output response, the constant values were keptThe measurement noise and the process noise covariance matrix values used are Q_angle = 0.001; Q_bias = 0.003; R_measure = 0.03;PID tuningThe PID controller use da set of tuning rules which is based on the Ziegler Nichols method.Select typical operating setting for desired speed, turnoff integral and derivative part and then increase Kp to max or until oscillation occurs. If system oscillates, divide Kp by 2.

Increase Kd and observe behavior when changing desired

speed by about5% and choose value of Kd that gives a fast

damped response.

Slowly increase Ki until oscillations tarts.ThendivideKi

by2or3.

Thanks