Correctly configure the 3g modem. Correct configuration of the megaphone modem. Installing the TELE2 Internet gadget

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

What is a hoverboard?

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

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

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

The hoverboard consists of a body, a steel or metal base, on which all the electronics will be attached. Then there are two electric motors with enough power to be able to drive under a person’s weight of up to 80-90 kg. Next comes the motherboard with a processor and two auxiliary boards, on which there are gyroscopic sensors. And of course, a battery and two wheels with the same diameter. How to make a hoverboard? To solve this issue, we will need to obtain certain design details of the hoverboard itself.

What do we need?

How to make a hoverboard with your own hands? The first and main thing you will need are two electric motors with the power to carry the weight of an adult. The average power of factory models is 350 Watts, so we will try to find engines of this power.

Next, of course, you need to find two identical wheels, approximately 10-12 inches. It’s better to have more, since we will have a lot of electronics. So that the cross-country ability is higher and the distance between the platform and the ground is at the required level.

Two batteries, lead-acid, you need to choose a rated power of at least 4400 mAh, and preferably more. Since we will not be making a metal structure, it will weigh more than the original mini-Segway or hoverboard.

Production and process

How to make a hoverboard that is powerful and so that it can keep its balance while riding? First we need to make a plan for what kind of vehicle we will need. We need to make a fairly powerful vehicle with large wheels and great maneuverability on different roads. The minimum value of continuous driving should be 1-1.5 hours. We will spend approximately 500 euros. Let's install a wireless control system for our hoverboard. We will install a reading device for problems and errors, all information will go to the SD card.

Hoverboard diagram

In the diagram above you can clearly see everything: electric motors, batteries, etc. First you need to select exactly the microcontroller that will carry out the control. 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 to make a hoverboard safe? We will have two batteries connected in series, so we will get the required voltage. For electric motors, a double bridge circuit is precisely what is needed. A ready button will be installed, when pressed, power will be supplied to the engines. When you press this button, the motors and the hoverboard itself will turn off. This is necessary for the safe driving of the driver himself and our vehicle.

The Arduino microcontroller will run at about 38400 baud, using serial communication with the XBee circuit. We will use 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 perform the primary processing.

We will use the I2C bus, it has sufficient throughput to quickly communicate with an Arduino microcontroller. The gyroscopic sensor with address 0x68 has an information update rate of once every 15 ms. The second address sensor 0x68 works directly from the microcontroller. We also have a load switch; it puts the hoverboard into balance 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 column is made from an ordinary wooden stick and will be attached to the front of the hoverboard itself. Here you can take any stick, even a mop handle. It is necessary to take into account the fact that batteries and other circuits will produce pressure on the platform and thus the balancing will be slightly reconfigured, precisely in the part where there will be more pressure.

The engines need to be evenly distributed on the right and left sides of the platform, and the battery should be maximally in the middle in a special box. We attach the steering post to the usual feints and attach the ready button to the top of the stick. That is, if something goes wrong and the button is pressed, 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 soldering of all wires is carried out according to the same scheme. Next we need to connect two gyroscopic sensors to our microcontroller, using a bridge circuit with a motor, according to this table.

The balancing sensors should be installed parallel to the ground or along the platform itself, but the right and left turn sensors should be installed perpendicular to the gyroscopic sensors.

Configuring sensors

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

There are several options in this program. The first most important parameter is the Kp parameter, it is responsible for balancing. First, increase this indicator in order to make the hoverboard unstable, and then reduce the indicator to the desired parameter.

The next parameter is the Ki parameter, it is responsible for the acceleration of the hoverboard. As the angle of inclination decreases, the speed decreases or increases with reverse action. and the last parameter is the Kd parameter, it returns the platform itself to a level position, and puts the engines in hold mode. In this mode, the hoverboard simply stands still.

Next, you turn on the power button of the Arduino microcontroller and the hoverboard goes into standby mode. After you stand on the hoverboard itself, you stand with your feet on the push button, so the hoverboard goes into “stationary” mode. Balancing sensors turn on and when the angle of inclination changes, the hoverboard moves forward or backward. In case of any breakdowns, you can easily repair the hoverboard yourself.

Let's talk about how you can use Arduino to create a robot that balances like a Segway.

Segway from English. Segway is a two-wheeled standing vehicle equipped with an electric drive. They are also called hoverboards or electric scooters.

Have you ever wondered how a Segway works? In this tutorial we will try to show you how to make an Arduino robot that balances itself just like a Segway.

To balance the robot, the motors must resist the robot falling. This action requires feedback and corrective elements. Feedback element - which provides both acceleration and rotation in all three axes (). Arduino uses this to know the current orientation of the robot. The corrective element is the combination of engine and wheel.

The end result should be something like this:

Robot diagram

L298N Motor Driver Module:

DC gear motor with wheel:

A self-balancing robot is essentially an inverted pendulum. It may be better balanced if the center of mass is higher relative to the wheel axles. A higher center of mass means a higher moment of inertia of the mass, which corresponds to a lower angular acceleration (slower fall). That's why we put the battery pack on top. However, the height of the robot was chosen based on the availability of materials :)

The completed version of the self-balancing robot can be seen in the figure above. At the top there are six Ni-Cd batteries for power printed circuit board. In between the motors, a 9-volt battery is used for the motor driver.

Theory

In control theory, holding some variable (in this case the robot's position) requires a special controller called PID (proportional integral derivative). Each of these parameters has a "gain", usually called Kp, Ki and Kd. The PID provides correction between the desired value (or input) and the actual value (or output). The difference between input and output is called "error".

The PID controller reduces the error to the smallest possible value by continuously adjusting the output. In our Arduino self-balancing robot, the input (which is the desired tilt in degrees) is set by software. The MPU6050 reads the robot's current tilt and feeds it to the PID algorithm, which performs calculations to control the motor and keep the robot upright.

The PID requires the Kp, Ki and Kd values ​​to be adjusted to optimal values. Engineers use software, such as MATLAB, to automatically calculate these values. Unfortunately, we cannot use MATLAB in our case because it will complicate the project even more. Instead, we will adjust the PID values. Here's how to do it:

  1. Make Kp, Ki and Kd equal to zero.
  2. Adjust Kp. Too small a Kp will cause the robot to fall because the correction is not enough. Too much Kp causes the robot to go wildly back and forth. A good Kp will make the robot move back and forth quite a bit (or oscillate a little).
  3. Once Kp is set, adjust Kd. Good value Kd will reduce the oscillations until the robot is almost stable. In addition, the correct Kd will hold the robot even if it is pushed.
  4. Finally, install Ki. When turned on, the robot will oscillate even if Kp and Kd are set, but will stabilize over time. The correct Ki value will reduce the time required to stabilize the robot.

The robot's behavior can be seen in the video below:

Arduino code for self-balancing robot

We needed four external libraries to create our robot. The PID library simplifies the calculation of P, I and D values. The LMotorController library is used to control two motors with the L298N module. The I2Cdev library and the MPU6050_6_Axis_MotionApps20 library are designed to read data from the MPU6050. You can download the code, including libraries, in this repository.

#include #include #include "I2Cdev.h" #include "MPU6050_6Axis_MotionApps20.h" #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE #include "Wire.h" #endif #define MIN_ABS_SPEED 20 MPU6050 mpu; // MPU control/status vars bool dmpReady = false; // set true if DMP init was successful uint8_t mpuIntStatus; // holds actual interrupt status byte from MPU uint8_t devStatus; // return status after each device operation (0 = success, !0 = error) uint16_t packetSize; // expected DMP packet size (default is 42 bytes) uint16_t fifoCount; // count of all bytes currently in FIFO uint8_t fifoBuffer; // FIFO storage buffer // orientation/motion vars Quaternion q; // quaternion container VectorFloat gravity; // gravity vector float ypr; //yaw/pitch/roll container and gravity vector //PID double originalSetpoint = 173; double setpoint = originalSetpoint; double movingAngleOffset = 0.1; double input, output; //adjust these values ​​to fit your own design double Kp = 50; double Kd = 1.4; double Ki = 60; PID pid(&input, &output, &setpoint, Kp, Ki, Kd, ​​DIRECT); double motorSpeedFactorLeft = 0.6; double motorSpeedFactorRight = 0.5; //MOTOR CONTROLLER int ENA = 5; int IN1 = 6; int IN2 = 7; int IN3 = 8; int IN4 = 9; int ENB = 10; LMotorController motorController(ENA, IN1, IN2, ENB, IN3, IN4, motorSpeedFactorLeft, motorSpeedFactorRight); volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high void dmpDataReady() ( mpuInterrupt = true; ) void setup() ( // join I2C bus (I2Cdev library doesn't do this automatically) #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE Wire.begin( ); TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz) #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE Fastwire::setup(400, true); #endif mpu.initialize(); // supply your own gyro offsets here, scaled for min sensitivity mpu.setXGyroOffset(220); mpu.setYGyroOffset(-85); mpu.setZAccelOffset(1788); chip // make sure it worked (returns 0 if so) if (devStatus == 0) ( // turn on the DMP, now that it"s ready mpu.setDMPEnabled(true); // enable Arduino interrupt detectionInterrupt(0 , dmpDataReady, RISING); mpuIntStatus = mpu.getIntStatus(); // set our DMP Ready flag so the main loop() function knows it"s okay to use it dmpReady = true; // get expected DMP packet size for later comparison packetSize = mpu.dmpGetFIFOPacketSize(); //setup PID pid.SetMode(AUTOMATIC); pid.SetSampleTime(10); pid. SetOutputLimits(-255, 255); ) else ( // ERROR! // 1 = initial memory load failed // 2 = DMP configuration updates failed // (if it"s going to break, usually the code will be 1) Serial.print(F("DMP Initialization failed (code ")); Serial.print(devStatus); Serial.println(F()")); ) ) void loop() ( // if programming failed, don't try to do anything if (!dmpReady ) return; // wait for MPU interrupt or extra packet(s) available while (!mpuInterrupt && fifoCount< packetSize) { //no mpu data - performing PID calculations and output to motors pid.Compute(); motorController.move(output, MIN_ABS_SPEED); } // reset interrupt flag and get INT_STATUS byte mpuInterrupt = false; mpuIntStatus = mpu.getIntStatus(); // get current FIFO count fifoCount = mpu.getFIFOCount(); // check for overflow (this should never happen unless our code is too inefficient) if ((mpuIntStatus & 0x10) || fifoCount == 1024) { // reset so we can continue cleanly mpu.resetFIFO(); Serial.println(F("FIFO overflow!")); // otherwise, check for DMP data ready interrupt (this should happen frequently) } else if (mpuIntStatus & 0x02) { // wait for correct available data length, should be a VERY short wait while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount(); // read a packet from FIFO mpu.getFIFOBytes(fifoBuffer, packetSize); // track FIFO count here in case there is >1 packet available // (this lets us immediately read more without waiting for an interrupt) fifoCount -= packetSize; mpu.dmpGetQuaternion(&q, fifoBuffer); mpu.dmpGetGravity(&gravity, &q); mpu.dmpGetYawPitchRoll(ypr, &q, &gravity); input = ypr * 180/M_PI + 180; ) )

The Kp, Ki, Kd values ​​may or may not work. If they don't, follow the steps above. Note that the tilt in the code is set to 173 degrees. You can change this value if you wish, but note that this is the tilt angle that the robot must maintain. Also, if your motors are too fast, you can adjust the motorSpeedFactorLeft and motorSpeedFactorRight values.

That's all for now. See you.

Hoverboard inside

Main details

What does a hoverboard consist of? If you look from the outside, the hoverboard is an interesting device. The first is a working platform or board. It is on this that a person stands and, trying to maintain balance, steers, rides or falls. There are two wheels on the sides of the platform, they are what give us the opportunity to ride and move forward or backward.

First, let's look at the platform. The working platform is divided into two parts, the right and left parts. Just right for right and left feet. This was done so that it was possible to turn right or left, just by pressing the toe on these platforms.

How does a hoverboard work?

Mini Segway device

Wheels

There are two wheels on the sides. Typically, hoverboards come in 4 types, and they differ in class and wheel size. The first class of hoverboards is a children's hoverboard with wheels with a diameter of 4.5 inches. Small size wheels makes the hoverboard very inconvenient and impassable in some sections of the road.

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

AND biggest is the SUV of all mini Segways - hoverboard 10 inches. This is a model that has interesting feature, in addition to large wheels, these wheels have a chamber 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 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 high speed, then the engineers decided not to install expensive plastic and thereby not increase the price of the hoverboard.

U hoverboard with 8 inch wheels, the hulls are made from various materials as from simple plastic, and from carbon, impact-resistant magnesium plastic. Such plastic can withstand almost any physical impact and shock. Carbon, for example, is also a lightweight material, thereby reducing the load on electric motors and reducing the rate of battery discharge.

Engines

Once 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 among all mini-Segways is 700 watts on both wheels. Or 350 watts per wheel. The fact is that the electric motors of hoverboards operate independently of each other. One wheel can move at one speed, and the other at another, or they can move in different directions, one back, the other forward. Thus, this system gives the hoverboard controllability.

It becomes more sensitive to turns high speed. You can also turn around 360 degrees. The higher the engine power, the higher the load carried and the higher the speed, but not always. You must understand that the higher the mass of the load on the platform, the lower the speed and the faster the battery discharges. Therefore, hoverboards with powerful engines are more expensive.

Balancing system

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

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

If the platform tilts forward, the processor, having processed the information, sends a signal to electric motors that physically hold the board in a level position. But if the platform tilts more with a certain pressure, the wheel immediately begins to move forward or backward.

It is imperative to remember that all current hoverboards must have two auxiliary boards for gyroscopic sensors and one main board where the processor is located. Older models may have a two-board system, but since the fall of 2015, a change was made to the standard and now all hoverboards and mini-Segways are made with 3 boards.

In Chinese fakes 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 subsequently the entire system may fail altogether.

The internal control circuit of a hoverboard is not as complicated as it seems. The entire system is designed to respond as quickly as possible to any behavior of the platform. The calculation takes place in a split second and with amazing accuracy.

Battery

The hoverboard's power supply system is powered by two or more batteries. Standard inexpensive models usually have a battery with a capacity of 4400 mAh. The battery is responsible for the operation of the entire system as a whole and providing it with electricity, so the battery must be of high quality and branded. Usually two brands of batteries are used - Samsung and LG.

Batteries also differ by class. There are low-level batteries of classes 1C, 2C. Such batteries are usually installed on hoverboards with 4.5 and 6.5 inch wheels. All for the same reason, because these hoverboards are designed for smooth roads, smooth asphalt, marble or floors.

Hoverboards with 8-inch wheels usually use middle-class 3C batteries; this is a more reliable battery model. It will not turn off during a sudden stop or when hitting a curb or a hole.

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

The basic principle of the hoverboard is to maintain balance. If the driver weighs a lot, the hoverboard needs more electricity for maneuvers and movement.

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 the hoverboard and monitor the condition of your vehicle. You can monitor your average speed and see how far you have covered. Set the maximum allowed speed and much more.

Many more models have a backlight, it illuminates your path in the dark, and can also flash brightly in time with the music. But you need to remember that music and lighting drain the battery a lot. Many people turn off the backlight altogether to increase the power reserve.

Conclusion

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