Do-it-yourself segway. DIY Segway

Hello everybody brainworms! In my new brain project I will be creating a self-balancing vehicle or Segway with my own hands. This project requires basic knowledge of electronics and the ability to work by hand. All mechanical components can be purchased online or at your local store.

The SEGWAY consists of a platform on which they stand in an upright position and two side electric motors powered by batteries. The controller control algorithm ensures a stable position. Segway movement is controlled by the driver by tilting his torso, and a handle to select the direction of movement to the left / right. Therefore, you will need additional components such as controller, motor drive and acceleration sensor / gyroscope. The mechanical structure is made of wood because it is lightweight, electrically insulated and easy to work with. Now let's get down to making the Segway!

Step 1: Main characteristics of the project

In this project, it is required to manufacture a device with the following characteristics:

- Sufficient power and stability for driving on the street, and even on gravel track;
- 1 hour of continuous work
- Total cost up to € 500
- Possibility wireless control
- Writing data to SD card to detect breakdowns

Step 2: design the system

The tilt sensor is mounted horizontally along the x-axis and vertically along the y-axis.

Step 5: Testing and Configuring

Please note that the motors must be of sufficient power. Test the device in a wide and safe area to avoid injury or damage. Protective shields and a helmet are recommended.

Execute step by step procedure... Start by programming the Arduino microcontroller (download), then check the connection with the sensors and the bridge control circuit.

Arduino Terminal can be used to debug program code and check if it works. For example, the gain of a PID controller needs to be adjusted as it depends on the mechanical and electrical parameters of the motor.

The gain is adjusted according to this procedure:
1. The Kp parameter is intended for balancing. Increase Kp until the balance becomes unstable, Ki and Kp remain at 0. Slightly decrease Kp to obtain a steady state.
2. Ki parameter is for acceleration / deceleration of acceleration when tilting. Increase Ki to get the correct acceleration to avoid falling when leaning forward, Kp remains at 0. Balance should now be stable.
3. The Kd parameter is used to compensate for switching on and returning to a stable position.

In the Terminal program, you can execute various “?” Commands.
? - Assistance in choosing teams
p, i, d [integer value] - Set / Get PID controller gain, value from 0 to 255
r [integer value] - forced increase of motor speed, value from -127 to 127
v - software version
With the "p" command, you gain access to the Kp parameter. The "p 10" command allows you to set Kp to a value of 10.

After powering up the Arduino, the sensors are initialized and transitioned to the standby state. When the push button is pressed, the control signal is transmitted to the SEGWAY controller, which is in a vertical position, which is ready to activate the motors for moving forward or backward, depending on the initial position. From this moment on, the button must be kept pressed constantly, otherwise the motors will turn off and the controller will enter the standby state. After reaching the vertical position, the controller waits for the “Driver in place” load limit switch signal, which is usually pressed with the foot when the driver is on the platform. After that, the balancing algorithm is started and the motors are activated forward or backward in order to remain in an upright position. Forward tilt creates forward motion and vice versa. Being in a tilted position leads to an acceleration of the movement. Tilting in the opposite direction will reduce the speed. Use the handle to move left and right.

Step 6: Demo

Watch the video of the finished device below and thank you for your attention!

Hoverboard inside

Basic details

What does a gyro scooter consist of? If you look from the side, the gyro scooter is an interesting device. The first is a work platform or board. It is on it that a person gets up and, trying to maintain balance, drives, drives or falls. On the sides of the platform there are two wheels, it is they who give us the ability to drive and move forward or backward.

Let's take a look at the platform first. The working platform is divided into two parts, right and left. Just right and left foot. This is done in order to be able to turn to the right or left, just by pressing the toe on these platforms.

How does a gyro scooter work?

Mini segway device

Wheels

There are two wheels on the sides. Usually hoverboards are of 4 types, and they differ in the class and size of the wheels. The first class of hoverboards is the kids hoverboard with 4.5-inch wheels. Small size wheels makes the hoverboard very uncomfortable and impassable in some sections of the road.

The next class is the 6.5-inch hoverboard. It already has a larger wheel diameter, but it is also intended only for driving on flat surfaces. Hoverboard 8 inches, is the golden mean among all gyroboards. He has optimal size wheels that can travel on almost any road.

And the biggest is the SUV of all mini-segways - the 10-inch hoverboard. This is a model that has interesting feature, in addition to large wheels, these wheels have a tube system. That is, the wheels are inflatable, they have a smoother ride, and such hoverboards are more wear-resistant than smaller prototypes.

Frame

The body of all hoverboards is made of different materials but with the same feature. Everywhere, the housing covers the wheels, protecting from splashes, dirt, water, snow and dust. Hoverboards with small wheels 4.5 and 6 are usually made of ordinary plastic. Since these models are designed for driving on a flat road, and do not develop such a high speed, the engineers decided not to install expensive plastic and thereby not increase the price of the hoverboard.

In a hoverboard with 8-inch wheels, the hulls are made of various materials, both in plain plastic and in carbon fiber, impact-resistant magnesium plastic. Such plastic is able to withstand almost any physical impact and shock. Carbon, for example, also light material, thereby reducing the load on the electric motors and reducing the rate of discharge of the battery.

Engines

After you remove the cover, you should see an electric motor on the sides closer to the wheel. Electric motors come in different capacities. The average of all mini-segways is 700 watts for both wheels. Or 350 watts per wheel. The fact is that electric motors of gyro scooters work independently of each other. One wheel can travel at one speed and the other at a different speed, or they can move at different sides, one back, the other forward. Thus, this system gives the hoverboard controllability.

It becomes more responsive to high speed cornering. You can also turn into places 360 degrees. The higher the engine power, the higher the load carried and the higher the speed, but not always. It must be understood that the higher the mass of the load on the platform, the lower the speed and the faster the battery is discharged. Therefore, hoverboards with powerful motors are more expensive.

Balancing system

The balancing system consists and includes quite a few components. First of all, these are two gyroscopic sensors, which are located on the right and left side of the platform. If you remove the case cover, you can see two auxiliary boards, it is to them that the gyroscopic sensors are connected. Accessory boards help process information and send it to the processor.

Further, on the right side, you can see the main board, it is there that the 32-bit processor is located and all control and computation is carried out. There is also a program that reacts to any platform change on the right or left.

If the platform tilts forward, the processor, after processing the information, sends a signal to the electric motors, which physically hold the board in a level position. But if the platform tilts more with a certain pressure, the wheel immediately starts moving forward or backward.

It must be remembered that in all current gyroscooters there must be two auxiliary boards for gyroscopic sensors and one main board, where the processor is located. In old models, there may be a two-board system, but since the fall of 2015, a change was made to the standard and now all gyro scooters, mini-segways are made with 3 boards.

V Chinese counterfeits or low-quality hoverboards, there may be one board, the main one. Unfortunately, this mini-segway has poor handling characteristics. May vibrate or tip over the driver. And later, the entire system may fail altogether.

Scheme internal device hoverboard control is not as difficult as it seems. The entire system is designed to respond as quickly as possible to any platform behavior. The calculation takes place in a fraction of a second and with amazing accuracy.

Battery

The hoverboard power supply system is carried out from two or more accumulators. In standard inexpensive models usually put a battery with a capacity of 4400 mAh. The battery is responsible for the operation of the entire system as a whole and for providing it with electricity, so the battery must be of high quality and branded. Usually, two brands of batteries are used - they are Samsung and LG.

Also, batteries differ in class. There are low-level batteries of classes 1C, 2C. These batteries are usually used on hoverboards with 4.5 and 6.5 inch wheels. All for the same reason, because these hoverboards are designed for flat roads, flat asphalt, marble or floors.

Hoverboards with 8-inch wheels usually use middle-class batteries of the 3C type, this is a more reliable battery model. It will not turn off when you stop abruptly or when you hit a curb or pit.

Large-wheeled 10-inch models usually have 5C class batteries. This hoverboard is able to ride on almost any road, ground, puddles, pits. Therefore, the battery needs to be more reliable.

The basic principle of the device of a gyro scooter is due to the maintenance of balance. With a large driver's weight, the hoverboard needs more electricity to maneuver and move.

Other

Many hoverboards also have a Bluetooth system and speakers. With it, you can listen to your favorite music and ride with your friends. But this system also makes it possible to connect your smartphone to a hoverboard and monitor the state of your vehicle. You can follow average speed, watch what distance you have covered. Adjust the maximum allowed speed and much more.

Many models also have backlighting, it illuminates your way in the dark, and can also flash brightly in time with the music. But you need to remember that music and backlighting dramatically drain the battery. Many turn off the backlight altogether to increase the range.

Output

The hoverboard is designed to be compact and lightweight, yet fast, powerful and durable. The main thing is to buy a gyro scooter from trusted suppliers who have all required documentation so that you don't have to disassemble it after an unsuccessful ride.

Chinese segway - appearance photo

Until recently, I did not know at all what it was called “well, such a gurney on two wheels, ride while standing”. I recently learned that this electric scooter on two wheels is called Segway or Segway, in English - Segway... Who still does not understand what we are talking about - the photo on the left.

You can find out more about this wonderful two-wheeled scooter on Wikipedia or on the sellers' websites, but I will describe it briefly, and move on to the main thing - the device and repair of the segway. There will be many photos as well detailed description electrical circuit segway.

This wonderful device allows a person to move easily on two wheels. At the same time, the segway control system includes a balancing system that practically excludes the possibility of falling.

The word “practically” always puts me on my guard. So this time.

But first things first.

Segway breakage

My story began with the fact that a man on a segway fell. I drove at a decent speed, and - nose into the asphalt!

I began to figure out what was the matter. It turned out that when the ignition key was turned, sparks were coming from this key, and the wheels were braked at the same time. There were no errors on the display, but this was only because the device could not actually turn on - arcing in the contacts of the lock led to the fact that the contacts were covered with carbon deposits, and the current from the battery did not flow to the circuit.

It is strange that the contacts did not burn out and did not stick together tightly, however, then the wiring would have burned out, tk. at a current of about 100 Amperes, it was not provided, and the standard fuses remained intact.

Yes, it's worth saying that this segway was a cheap fake, and bought ten days before the breakdown. Everything was written in Chinese (as far as I know Chinese), except for “Warning!” However, the build quality can be judged by the photo.

The reason for the breakdown was that the power transistors, through which the motors were powered, burned out. But more on that later.

Segway device. Disassembly

What I particularly liked were the wheels with solid treads. That is, it is assumed that this scooter can be used in harsh conditions.

However, the boards are generally not protected from moisture, there is not even any varnish. And in general, no rubber pads against moisture are provided ...

The steering wheel is screwed on, it can be unscrewed during transportation:

Steering wheel mount. Front view.

And here is the rear view:

Fuses and charging connector

You can see two 50 A fuses (the Segway circuit will be a little lower), a battery charge connector, above all of this there are “headlights” in the form of 12 V LEDs.

Top panel. On it are the main controls and indicators:

Segway top panel

Above is a display that shows the battery charge, below are warnings that must be read carefully before getting behind the wheel. If something is not clear - call)

Three LEDs indicate the state of the segway: 1 - turn left, 2 - turn right, 3 - horizontal position (the position in which a person can stand and start moving)

And what's new in the VK group SamElektrik.ru ?

Subscribe and read the article further:

We remove the wheels.

Removed the wheel

Segway with wheels removed

Remove the front panel.

Remove the top cover

It looks quite unpresentable, but this is just the beginning.

Front panel at the back. The wires are pulled back. The lock is removed.

A variable resistor is attached to the steering column of the steering wheel, which turns only to the right and left, that recognizes the tilt of the steering wheel, and gives a signal to the controller to turn.

Variable rudder tilt resistor

Resistance - 10 kOhm, linear characteristic.

I just want to say - "offal"

As I said, the build quality is lousy. Although, there are no special complaints about the mechanics.

Segway electronic filling

Now let's take a closer look at the electronics of the Segway.

Here is a photo of the control board connection.

Larger device and board connection

Power Transistors - IRF4110:

Power transistors of the control board

It was a couple of these transistors that burned out. In this case, this pair shorted the battery power to itself, forming a short circuit.

Segway electronic circuit - general form

Let's consider the elements of the scheme in more detail.

Segway electronic circuit - general view - another angle

The circuit is generally not big, let's break it into several parts - a receiver, a controller, an electronic gyroscope, transistor drivers, power transistors, a power supply.

Microcircuits IC3, IC4 is a radio channel that allows you to control the segway from the remote control. That is, configure it, calibrate, block, diagnose.

IC2 is an ATMEGA 32A controller. This is the heart of the Segway, or rather the brain. The most important thing here is the program, the algorithm of work. It is this program that controls the rotation of the wheels and prevents a person from falling.

If the controller is the brain, then the gyroscope is the senses. The gyroscope is a small microcircuit INVENSENCE MPU6050. This remarkable device is a three-channel position meter in space (tilt along three axes) and a three-channel acceleration meter. If anyone remembers from physics, acceleration is the rate of change in speed. Honestly, I don’t understand how such meters can be crammed into this chip. Until now, I knew electromechanical gyroscopes, but only electronic accelerometers. Now I learned that there are such, and are used very widely, mainly in mobile and automotive electronics.

On last photo also you can see two microcircuits of buffers CD4001 (this is 2I-NOT). This is to decouple the controller and the rest of the circuit. Next, the control signal goes to the IR2184S drivers, which supply voltages to the gates of the power field workers, the photo of which I gave above.

The XL7015 power supply is a DC-DC converter, from a floating constant voltage of about 48V, by converting at a frequency of several kilohertz, it produces a stable constant voltage of 15V. Further - the usual KRENKA 7805 gives out 5 volts. There was a yellow clumsy jumper, I had nothing to do with it. But the burned-out track at the top right is the 0V supply path for control, it had to be restored.

Low-current elements of the segway circuit are connected through a backplane:

Signals come to this board: from the steering wheel potentiometer, from the buttons for the presence of a person, to the LEDs of the control panel. And the wires go to the main board.

Here is an engine with gearboxes, on the axles of which the wheels are directly mounted. Soundly done, only no identification marks:

Gear wheel motor

The battery also does not contain any inscriptions:

Battery 48V

Includes two charging wires (thinner) and two output wires.

Do you see the twisted places? The battery is not fixed at all, it dangles in the segway, and beats against the sharp edges of the stiffeners.

In general, done on ... in short, poorly done, and one way or another, an early breakdown of the Segway was inevitable.

Another gadget - the converter, was also lying at the bottom, wrapped in a film. Since the side light LEDs are rated for 12 V and the battery is 48 V, a DC-DC 48-12 V DC voltage converter is used:

Sibway scheme

Segway repair

Repair of the sibway boiled down to replacing the power transistors, their drivers, and strapping resistors. The burned-out track was also restored, the lock with the key was replaced with ordinary toggle switches, and the scheme included circuit breaker at 63 A. I hope, if something happens, he will save the circuit from burnout.

Only in this case, someone's nose will suffer again.

So the forecast is pessimistic, buy only high-quality things, especially when it comes to safety! Now it is clear why in all the photos there are segway riders wearing a helmet ...

Riding a Segway

Driving on a similar original off-road segway (in quiet mode) is shown in the video:

Also, the video tells in detail about specifications this wonderful device.

Is it really possible to make such a complex device like a segway yourself? It turns out you can. If you put in enough diligence and take advantage of special knowledge. This is exactly what a young engineer named Petter Forsberg, who graduated from Chalmers Swedish University of Technology with a degree in Automation and Mechatronics.

In addition to knowledge and skills, he still had to need a lot of money, you say. Yes, money was needed, but not much, about 300 euros, to purchase a certain set of parts and equipment. The result of his efforts is in this video:

Mechanics

The motors, wheels, chains, gears and batteries were taken from two inexpensive Chinese electric scooters. Motors provide 24V, 300W, 2750 rpm.

The transmission is from a small gear on the motor to a large gear on the handlebars. The ratio is approximately 6: 1, this high ratio is preferable to get better torque and lower top speed. The 12-inch wheel transmission was based on a freewheel mechanism, so the necessary changes had to be made to be able to drive the wheel in both directions.

The base of the platform is a fixed axle on which both wheels must rotate. The axle is secured by three aluminum blocks that are secured with 5mm set screws.

To be able to rotate while controlling the segway by tilting the steering column to the left and right, a drawing of the required part was made in the SolidWorks software, after which it was manufactured on a CNC machine. The program for the machine was written using CAMBAM. This same method was used to manufacture the electronics box and to assemble the emergency braking unit.

The steering wheel of the future Segway is a conventional bicycle handlebar, the tube of which is attached to a 25 mm steel hollow tube. Two steel springs were used to keep the steering column centered and provide some feedback. There is also an emergency button on the steering wheel that is connected to a standard relay from the vehicle and can reduce engine power.

For power supply, two lead-acid batteries 12V 12Ah are used, which are used for 24V motors.

Electronics

Everything printed circuit boards were manufactured specifically for this development. The main board takes care of the calculations, collects data from sensors such as a gyroscope (ADXRS614), an accelerometer (ADXL203) and a trimmer potentiometer, from which it is able to determine which direction you want to turn.

Main processor AVR ATmega168. The laptop is connected via Bluetooth using the RN-41. Two H-bridges convert the control signals from the main board to power for the motors. Each H-bridge has an ATmega168, communication between the boards is via UART. All electronics are powered by a separate battery (LiPo 7.4V 900mAh).

To have easy access to battery charging, a small box was made with the necessary connectors, an electronics power switch and a trim potentiometer on the top side for programming the main board, changing the control loop parameters.

Software

Microcontroller software mainly consists of filter for gyroscope and accelerometer and PD control loop. Two filters were taken for the test: Kalman and Complemenatry. It turned out that their performance was very similar, but the Complemenatry filter requires less computation, so it was chosen for use. Also, applications were written in Java so that you can see all the values ​​of sensors and control signals, battery status, etc.

The technical side of creating a segway with your own hands in this video:

If you think that a gyro scooter or mini-segway cannot be made at home with your own hands and forces, then you are far from mistaken. Oddly enough, there are many videos on the Internet where many craftsmen make their own gyro scooter. For some, it turns out to be very homemade, but there are also those who were able to truly approach the technology of creation itself and reproduce a truly interesting and high-quality thing. So is it possible to make a gyro scooter with your own hands? Adrian Kundert, an engineer and just a good person, will tell us about this.

What is a gyro scooter?

How to make a gyro scooter with your own hands? In order to understand how to make a homemade hoverboard, you first need to understand what a hoverboard is, what it consists of and what is needed to create this interesting vehicle. A gyro scooter is a self-balanced vehicle, the principle of operation of which is based on a system of gyroscopic sensors and internal technology keeping the balance of the working platform. That is, when we turn on the gyro scooter, the balancing system turns on. When a person gets on the gyro scooter, the position of the platform begins to change, this information is read by the gyroscopic sensors.

These sensors read any change in position relative to the earth's surface or a point from which gravitational action is coming. After reading, the information is fed to the auxiliary boards, which are located on both sides of the platform. Since the sensors and the electric motors themselves work independently of each other, in the future we will need two electric motors. From the auxiliary boards, the processed information is already sent to the motherboard with a microprocessor. There, the balance retention program is already carried out with the required accuracy.

That is, if the platform tilts forward, about a few degrees, then the motors are signaled to move in the opposite direction and the platform is leveled. The tilt to the other side is also performed. If the gyro scooter tilts a greater degree, then the program immediately understands that there is a command to move forward or backward to the electric motors. If the hoverboard tilts more than 45 degrees, the motors and the hoverboard itself are turned off.

The hoverboard consists of a body, steel or metal base, on which all the electronics will be attached. Then there are two electric motors with enough power to ride under a human weight up to 80-90kg. Further goes motherboard with a processor and two auxiliary boards, on which the gyroscopic sensors are located. And of course the battery and two wheels with the same diameter. How to make a gyro scooter? To solve this issue, we need to get certain details of the construction of the gyroboard itself.

What do we need?

How to make a gyro scooter with your own hands? The first and main thing that is needed is two electric motors, with the power capable of carrying the weight of an adult. The average power of the factory models is 350 watts, so we will try to find motors of that power.

Then, of course, you need to find two identical wheels, about 10-12 inches. Better more, since we will have a lot of electronics. So that the permeability is higher and the distance between the platform and the ground is at the right level.

Two batteries, lead-acid, you need to choose a nominal capacity of at least 4400 mAh, and preferably more. Since we will not metal structure but it will weigh more than the original mini segway or hoverboard.

Manufacturing and process

How to make a hoverboard that is powerful and that it keeps balance while riding? First, we need to build a plan for what kind of vehicle we need. We need to do pretty powerful tool movement with large wheels and high cross-country ability on different roads. The minimum value of continuous driving should be 1-1.5 hours. We will spend about 500 euros. We will supply a wireless control system to our hoverboard. We put a reader for faults and errors, all information will go to the SD card.

Giro scooter diagram

In the diagram above, you can clearly see everything: electric motors, batteries, etc. First you need to choose exactly the microcontroller that will control it. Of all the Arduino microcontrollers on the market, we will choose the UnoNano, and the ATmega 328 will act as an additional information processing chip.

But how do you make a hoverboard safe? We will have two batteries connected in series, so we get the required voltage. For electric motors, just a double bridge circuit is needed. A ready button will be set, by pressing which power will be supplied to the motors. When this button is pressed, the motors and the hoverboard itself will turn off. This is necessary for the implementation of a safe ride for the driver himself and our vehicle.

The Arduino microcontroller will be at about 38400 Baud, using serial communication with the XBee circuit. We will be using two InvenSense MPU 6050 gyro sensors based on GY-521 modules. They, in turn, will read information about the position of the platform. These sensors are accurate enough to make a mini segway. These sensors will be located on two additional auxiliary boards that will carry out the primary processing.

We will use the I2C bus, it has sufficient throughput to quickly communicate with the Arduino microcontroller. The gyro sensor with the address 0x68 has a refresh rate of every 15 ms. The second address sensor 0x68 works directly from the microcontroller. We also have a load switch, it puts the gyro scooter into balance holding mode when the platform is in a level position. In this mode, the hoverboard remains in place.

Three wooden parts on which our wheels and electric motors will be located. The steering post, made from a regular wooden stick, will be attached to the front of the hoverboard itself. Here you can take any stick, even a mop handle. It is imperative to take into account the fact that accumulators and other circuits will produce pressure on the platform and thus the balancing will be slightly readjusted, precisely in the part where there will be more pressure.

Engines, however, need to be evenly distributed on the right and left sides of the platform, and the battery is maximally in the middle in a special box. We attach the steering post to regular feints and attach the ready button to the top of the stick. That is, if something went wrong and the button is released, the hoverboard will turn off. In the future, this button can be converted into a foot part or adjusted to a certain inclination of the platform itself, but we will not do this for now.

The internal circuit and the soldering of all wires is carried out according to the same circuit. Next, you need to connect two gyroscopic sensors to our microcontroller, in a bridge circuit with a motor, according to this table.

Balance sensors should be installed parallel to the ground or along the platform itself, but left and right rotation sensors should be installed perpendicular to the gyro sensors.

Configuring Sensors

Next, we configure the microcontroller, download the source code. Next, you need to check the correct relationship between gyroscopic sensors and rotation sensors. Use the Arduino Terminal program to program and configure a hoverboard. It is imperative to tune the PID balance controller. The fact is that you can choose engines with a different power and characteristics, for them the setting will be different.

There are several parameters in this program. The first most important parameter is the Kp parameter, it is responsible for balancing. First, increase this indicator in order to introduce the gyro scooter into an unstable form, and then decrease the indicator to the desired parameter.

The next parameter is the Ki parameter, it is responsible for the acceleration of the hoverboard. As the tilt angle is lowered, the speed decreases or increases with the opposite action. and the last parameter is the Kd parameter, it returns the platform itself to a level position, and drives the motors to the hold mode. In this mode, the hoverboard simply stands still.

Then you turn on the power button of the Arduino microcontroller and the hoverboard goes into standby mode. After you have stepped on the gyro board itself, you stand with your feet on the push button, so the gyro scooter goes into "in place" mode. The balancing sensors are turned on and when the inclination angle is changed, the gyro scooter goes forward or backward. In case of any breakdowns, you can easily repair the gyroscooter with your own hands.