Sigway on arduino with your own hands. How to make a segway with your own hands

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 her 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 deal with 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 parts of the road.

The next class is a 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 featurebesides large wheels, these wheels have a tube system. That is, the wheels are inflatable, they have a smoother ride, and such gyro scooters are more durable than smaller prototypes.

Housing

The body of all gyro scooters is made of different materialsbut with the same feature. Everywhere the housing covers the wheels, protecting them 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 bodies 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 materialthereby reducing the load on the electric motors and reducing the rate of battery discharge.

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 on both wheels. Or 350 watts per wheel. The fact is that electric motors in 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 to 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 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 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 there is a 32-bit processor 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, then 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 older models, there may be a two-board system, but since the fall of 2015, a change has been made to the standard and now all gyro scooters, mini-segways are made with 3 boards.

IN 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 split 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. Such 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.

Gyro scooters 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 hitting a curb or pit.

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

The basic principle of the device of a gyroscooter is due to maintaining balance. With a large driver 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 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 allowable 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 keep in mind that music and lighting will drain your 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 documentationso that you don't have to disassemble it after a bad ride.

Is it possible to make a segway with your own hands? How difficult is it, and what details are required for this? Will it homemade apparatus perform all the same functions as a factory-made one? A bunch of similar questions arise in the head of a person who decides to build with his own hands. The answer to the first question will be simple and clear: anyone who knows a little about electronics, physics and mechanics can make an "electric scooter" himself. Moreover, the device will work no worse than that produced on a factory machine.

How to make a segway with your own hands?

If you look closely at the hoverboard, you can see a rather simple structure in it: it is just a scooter equipped with an automatic balancing system. On both sides of the platform there are 2 wheels. For effective balancing, the Segway structures are equipped with an indicator stabilization system. The pulses from the tilt sensors are transported to microprocessors, which in turn generate electrical signals. As a result, the gyro scooter moves in a given direction.

In order to make a segway with your own hands, you will need the following elements:

  • 2 wheels;
  • 2 motors;
  • steering wheel;
  • aluminum blocks;
  • support steel or aluminum tube;
  • 2 lead acid batteries;
  • aluminum plate;
  • resistors;
  • emergency brake;
  • steel axis 1.2 cm;
  • printed circuit board;
  • capacitors;
  • LiPo battery;
  • Gate drivers;
  • led indicators;
  • 3 x ATmtga168;
  • voltage regulator;
  • ADXRS614;
  • 8 Mosfets;
  • two Springs;
  • and ADXL203.

Among the listed items are both mechanical parts and electronic elements, and other equipment.

Segway assembly procedure

Assembling a segway with your own hands is not as difficult as it seems at first glance. With all the necessary components, the process takes very little time.

Collection of mechanical parts

  1. Motors, wheels, gears and batteries can be borrowed from Chinese scooters, but finding an engine is not a problem at all.
  2. The large gear located on the steering wheel is transmitted from the small gear on the engine.
  3. The gear on a wheel (12 ") is free-wheeling - this requires some modifications necessary to operate the rotating elements in both directions.
  4. The fixed axle, secured by three aluminum blocks (can be fixed with 5mm set screws), is the base of the platform.
  5. Using the SolidWorks software, you need to draw a drawing of a part that will allow the gyro scooter to rotate to the sides while tilting the body. After that, the part must be turned on a CNC machine. The machine used the CAMBAM program, which was also used in the manufacture of the box for the emergency brake unit.
  6. The handlebars are attached to a 2.5 cm empty steel tube.
  7. To ensure that the steering column is always centered and reverse thrust was more intense, you can use a pair of steel springs.
  8. The steering wheel is equipped with a special emergency button connected to a relay - this allows you to reduce the engine power.
  9. The power sources for the motors are 24 V.

Collection of electronic parts

In order to assemble a segway with your own hands, it is not enough just to fasten the mechanical parts. Electronic control it is no less important in a gyro scooter, because it is a rather important component of the unit.

  1. The printed circuit board, which has a computational function, collects information from sensors - gyroscope, accelerometer, potentiometer, and then sets the direction of rotation.
  2. Without an ATmtga168 processor, the "scooter" will not be able to work normally. The computer is connected via Bluetooth and RN-41.
  3. With the help of two H-bridges, the control pulses from the base board are converted to the force of the motors. Each bridge is equipped with ATmtga168, the boards communicate with each other via UART.
  4. All electronics are powered by a separate battery.
  5. In order to quickly get to the batteries, as well as program the base board and change the parameters of the control loops, you need to make a small box with connectors, equip its body with a trimming potentiometer on top, and also equip the electronics power switch.

Segway software

How to make a segway with your own hands so that it probably works? Correct - Install the software (or software). Here are the necessary steps to complete this task:

  1. The microcontroller software includes a filter for the accelerometer and gyroscope and the PD control loop.
  2. The Kalman and Complemenatry filters do a great job.
  3. Write applications using the Java programming language - this will allow you to see the battery charge level, all sensor readings and control parameters.

That, perhaps, is all that is required of a person who decided to make a segway on his own. An understanding of the topic and process, and necessary components will allow you to build an excellent gyro scooter at home.

Hello to all 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 manual skills. 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 lateral 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 the 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: system design

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

Step 5: testing and tuning

Please note that the motors must be of sufficient power. Check the device in a wide and safe area to avoid injury or damage. It is recommended to wear face shields and a helmet.

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. The Ki parameter is for acceleration / deceleration when tilting. Increase Ki to get the correct acceleration to avoid falling when leaning forward, Kp stays 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 in motor speed, value from -127 to 127
v - software version
With the "p" command, you access 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, a 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 upright 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 speed. Use the handle to move left and right.

Step 6: Demo

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

Chinese segway - appearance photo

Until recently, I didn’t know at all what was called “well, such a gurney on two wheels, ride standing up”. 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 slowed down. There were no errors on the display, but this was only because the device could not actually turn on - sparking 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 is 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 burned out through which the motors were powered. 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 difficult 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 displays:

Segway top panel

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

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 very 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 to the left, which 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 - a different 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 the person from falling.

If the controller is the brain, then the gyroscope is the senses. The gyroscope is a small microcircuit called INVENSENCE MPU6050. This remarkable device is a three-channel position meter (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. I still 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 the last photo you can also see two CD4001 buffer chips (this is 2I-NOT). This is to decouple the controller and the rest of the circuit. Then 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 cross-board:

Signals come to this board: from the steering wheel potentiometer, from the human presence buttons, to the control panel LEDs. 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 breakage 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

The repair of the sibway was reduced 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 is a segway rider with a helmet on ...

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.


This article will cover the creation of a self-balancing vehicle, or simply "Segway". Almost all materials for creating this device easy to get.

The device itself is a platform on which the driver stands. By tilting the torso, two electric motors are controlled by a circuit of circuitry and microcontrollers responsible for balancing.

Materials:


-Wireless XBee control module.
- Arduino microcontroller
-accumulators
- InvenSense MPU-6050 sensor on the “GY-521” module,
-wood blocks
-button
-two wheels
and others indicated in the article and in the photographs.

Step one: Determine the required performance and design the system.

When creating this device, the author tried to fit it into such parameters as:
- cross-country ability and power required for free movement even on gravel
- accumulators of sufficient capacity to provide at least one hour of continuous operation of the device
-provide the possibility of wireless control, as well as recording data on the operation of the device on the SD card for troubleshooting.

In addition, it is desirable that the cost of creating such a device be less than the order of the original off-road gyroscope.

According to the diagram below, you can see the electrical circuit diagram of a self-balancing vehicle.


The following picture shows the operating system of the hoverboard drive.


The choice of a microcontroller to control Segway systems is diverse, by arduino system most preferable because of its price categories. Controllers like Arduino Uno, Arduino Nano or ATmega 328 can be used as a standalone chip.

A 24 V supply voltage is required to power the dual bridge motor control circuit, this voltage is easily achieved by daisy chaining 12 V car batteries.

The system is designed so that power is supplied to the motors only while the start button is pressed, so for a quick stop, simply release it. At the same time, the Arduino platform must support serial communication, both with a bridge motor control circuit and with a wireless control module.

The tilt parameters are measured using the InvenSense MPU-6050 sensor on the “GY-521” module, which processes acceleration and carries the functions of a gyroscope. The sensor was located on two separate expansion boards. The l2c bus supports communication with the Arduino microcontroller. Moreover, the tilt sensor with the address 0x68 was programmed in such a way as to perform a poll every 20 ms and to interrupt the Arduino microcontroller. Another sensor has address 0x69 and is pulled directly to the Arduino.

When the user steps on the platform of the scooter, the load limit switch is activated, which activates the algorithm mode for balancing the Segway.

Step two: Create a gyro scooter body and install the main elements.


After defining the basic concept of the gyro scooter's operation, the author proceeded to the direct assembly of its body and the installation of the main parts. The main material was wooden planks and bars. The wood is lightweight, which will have a positive effect on the duration of the battery charge, in addition, wood is easily processed and is an insulator. A box was made from these boards, into which batteries, motors and microcircuits will be installed. Thus, it turned out to be U-shaped wooden detailon which wheels and motors are bolted.

The transmission of engine power to the wheels will be driven by a gear train. When placing the main components in the Segway's body, it is very important to ensure that the weight is distributed evenly when the Segway is brought into an upright working position. Therefore, if you do not take into account the distribution of weight from heavy batteries, then balancing the device will be difficult.

In this case, the author placed the batteries at the back, so as to compensate for the weight of the engine, which is located in the center of the device body. The electronic components of the device were stowed between the engine and the batteries. For further testing, a temporary start button was also attached to the Segway handle.

Step three: Electrical diagram.



According to the above diagram, all the wires in the Segway case were carried out. Also, in accordance with the table below, all the pins of the Arduino microcontroller were connected to the motor control bridge circuit, as well as to the balancing sensors.


The following diagram shows a tilt sensor installed horizontally, while the control sensor was installed vertically along the Y-axis.



Step four: Testing and configuring the device.


After completing the previous steps, the author received a Segway model for testing.

When conducting testing, it is important to take into account factors such as the safety of the testing area, as well as protective equipment such as face shields and a helmet for the driver.