DIY hoverboard bike

DIY hoverboard bike

hoverboard, bike

If you have an old hoverboard, you can make a great electric bike out of it. The gyro scooter has two brushless motors, they rarely break and have a fairly long service life. On one such engine, the author made himself an electric bike, everything turned out quite interesting. Although the design of the bicycle has changed a little, it still remains a bicycle, that is, you can ride it in the classic way if the batteries are discharged.

An interesting fact is that when the engine is running, the pedals do not rotate, you do not need to swing your legs, the drive sprocket of the bicycle now also works on a ratchet mechanism. The process of making homemade products is not complicated; of spare parts, parts from bicycles are mainly used here. If you are interested in the project, I suggest studying it in more detail.

Materials and tools that the author needed:

List of materials:. motor from a hoverboard;. bicycle;. 2 sprockets from the rear wheel (with a ratchet);. chain;. battery;. controller for brushless motor;. steel angle;. steel clamps;. bolts with nuts;. bushings from the rear wheels of the bicycle;. wires;. the engine control handle;. the drive sprocket from the bicycle.

List of tools:. angle grinder;. welding machine;. drill;. screwdriver and wrenches;. electrical tape.

Step one. We will finalize the drive sprocket of the bicycle To begin with, we will finalize the drive sprocket of the bicycle, we need to make it so that a ratchet appears here. Thanks to this refinement, the pedals will not spin when the engine is running. At the same time, we can always pedal if something breaks or the battery runs out.

For this refinement, we need a hub from the rear wheel, as well as a sprocket with a ratchet. We disassemble the cassette by drilling rivets. As a result, we will have a connecting rod with a small drive sprocket, weld the hub here from the rear wheel of the bicycle, and then cut off the drive sprocket. Further, a driven sprocket from a wheel with a ratchet can be installed on the welded sleeve. We weld the middle drive sprocket of the bicycle to this sprocket, and then fasten the largest one to the middle one with bolts and nuts. As a result, we get two stars on the ratchet mechanism.

Step two. Preparing the engine Let’s prepare the engine, for this we need to disassemble the gyro scooter, get the engine, and we will also need to disassemble the engine itself. The tire can be removed, we do not need it. We stitch the sides from the wheel body, here we will attach the drive sprocket, it will also work on the ratchet mechanism. To begin with, we need one more bushing from the rear wheel of the bicycle, we weld it to the drive sprocket of the bicycle and cut off the excess. As a result, we now have the bushing installed on a bracket, which we can screw to the motor-wheel. We drill holes and screw everything well with bolts and nuts, do not forget about the grower. The wheel can be assembled, after assembly, make sure that the bolt heads do not interfere with the rotation of the wheel.

Well, then the author found two steel clamps and fixed them on the bike frame. A corner was welded to these clamps, but our little corner, with a motor-wheel attached to it, can be welded to the corner. That’s all, now the engine is completely securely attached to the frame.

Step four. Installing the chain Install the bicycle chain, cut off the excess to get the desired tension. In the end, we try to turn on the engine, and also turn the pedals. If the chain does not fall off, everything is fine.

If you have an old hoverboard, you can make a great electric bike out of it. The gyro scooter has two brushless motors, they rarely break and have a fairly long service life. On one such engine, the author made himself an electric bike, everything turned out quite interesting. Although the design of the bicycle has changed a little, it still remains a bicycle, that is, you can ride it in the classic way if the batteries run out.

An interesting fact is that when the engine is running, the pedals do not rotate, you do not need to swing your legs, the drive sprocket of the bicycle now also works on a ratchet mechanism. The process of making homemade products is not complicated; of spare parts, parts from bicycles are mainly used here. If you are interested in the project, I suggest studying it in more detail.

Materials and tools that the author needed:

List of materials:. motor from a hoverboard;. bicycle;. 2 sprockets from the rear wheel (with a ratchet);. chain;. battery;. controller for brushless motor;. steel angle;. steel clamps;. bolts with nuts;. bushings from the rear wheels of the bicycle;. wires;. the engine control handle;. the drive sprocket from the bicycle.

List of tools:. angle grinder;. welding machine;. drill;. screwdriver and wrenches;. electrical tape.

Step one. We will finalize the drive sprocket of the bicycle To begin with, we will finalize the drive sprocket of the bicycle, it is necessary to make it so that a ratchet mechanism appears here. Thanks to this refinement, the pedals will not spin when the engine is running. At the same time, we can always pedal if something breaks or the battery runs out.

For this refinement, we need a hub from the rear wheel, as well as a sprocket with a ratchet. We disassemble the cassette by drilling out the rivets. As a result, we will have a connecting rod with a small drive sprocket, weld the hub here from the rear wheel of the bicycle, and then cut off the drive sprocket. Further, a driven sprocket from a wheel with a ratchet can be installed on the welded sleeve. We weld the middle drive sprocket of the bicycle to this sprocket, and then fasten the largest one to the middle one with bolts and nuts. As a result, we get two stars on the ratchet mechanism.

Step two. Preparing the engine Let’s prepare the engine, for this we need to disassemble the gyro scooter, get the engine, and we will also need to disassemble the engine itself. The tire can be removed, we do not need it. We stitch the sides from the wheel body, here we will attach the drive sprocket, it will also work on the ratchet mechanism. To begin with, we need one more bushing from the rear wheel of the bicycle, we weld it to the drive sprocket of the bicycle and cut off the excess. As a result, we now have the bushing installed on a bracket, which we can screw to the motor-wheel. We drill holes and screw everything well with bolts and nuts, do not forget about the grower. The wheel can be assembled, after assembly, make sure that the bolt heads do not interfere with the rotation of the wheel.

Well, then the author found two steel clamps and fixed them on the bike frame. A corner was welded to these clamps, but our little corner, with a motor-wheel attached to it, can be welded to the corner. That’s all, now the engine is completely securely attached to the frame.

Step four. Installing the chain Install the bicycle chain, cut off the excess to obtain the desired tension. In the end, we try to turn on the engine, and also turn the pedals. If the chain doesn’t fall off, everything is fine.

Hello picobach! I hope your hands are zloty and your brain is not filled with butter from chips and french fries. you will be able to understand what 90% of those who read it will not understand. how to make an electric bike from a wheel motor from a hoverboard. Indeed, in any hoverboard, even a completely broken one, the motor-wheel (at least one) will definitely be in good order.

What is the technical problem with this wheel motor? There is only one problem. it is too weak for a bicycle and does not have an integrated gearbox. Motor-wheels of a similar size (without gear) are not used in a bicycle and cannot be used. if you take a wheel from a gyroscooter, drill holes for the spokes in it and use it as a wheel, then it will not go anywhere and overheat. Of course, there is a way out of this situation, if you use two motor-wheels for one bike at once, then theoretically it should turn out!

Or, the diameter of the wheel should be very small, much smaller than a conventional bicycle wheel. for example, on the Strid, the motor-wheel from a gyro scooter works quite well:

But, if the technical task is to put the motor-wheel on an ordinary bicycle, then you will have to make a gearbox after the motor-wheel! Oddly enough, if you make a gearbox, then it’s easier to make it two-stage, and set it as low as possible in order to shift the center of gravity as close as possible to the support base, that is, to increase the overall stability of the bike. try to make a homemade “pedal” (motorized drive to pedals ):

However, three chains and a countershaft are not only difficult, but also very noisy! After all, all these chains and shafts are not weak noise. So, the most logical thing is to try to simplify the design as much as possible by reducing the number of sprockets and chains.

READ  How To Ride A Road Bike Correctly

But how, then, to achieve traction and how to switch gears? After all, if you just make one stage of the gearbox, it will go very slowly. or, it will go fast and overheat).

What remains free for us that can be used to switch speeds (change the reduction ratio)? Considering that this electric motor can be turned in any direction, it seems an ideal solution where by changing the direction of rotation it would be possible to change the reduction ratio!

Having understood this, I went to technical sources in search of such an implementation and, oddly enough, I found it pretty quickly! Only, there it was implemented on a regular bike. without a motor, but we need to apply it to a motor-wheel from a hoverboard!

This inspired me and, sitting on the couch, I thought about the following. please do not kick too much, I am doing the implementation now, but for now, a video about what I think should come out at the end. But, in fact, an explanation of the very idea of ​​switching speeds, reversing the engine:

PREPARATION AND DOWNLOADING THE FIRMWARE:

As I wrote earlier, as a software part, I chose the open source project of the enthusiast Emanuel Feru on Github: github.com/EmanuelFeru/hoverboard-firmware-hack-FOC

This project proposes to use both sinusoidal and vector (FOC) control principles of 3-phase electric motors, with the field weakening function, as a result, we obtain very soft operation of the motor-wheels, excellent smoothness of speed and torque rise, as well as plus and higher speed.

To configure, compile and load the firmware into the microcontroller, we will use what the author of the project himself recommends. PlatformIO IDE, which is installed as an extension in Visual Studio Code from Microsoft. To be honest, I have never had to use these tools before, since I am somewhat far from programming. I did all this under MacOS, but I checked it in a virtual machine on Windows 10, everything is installed and executed the same way. (The only problem was when installing PlatformIO in Visual Studio Code on Windows 10, there was a looping installation process until I installed the Python 3.7 distribution on the system)

Open the folder with the project downloaded from Github in PlatformIO (installed in Visual Studio Code), and open the platformio.ini file, in which we are given a choice of options for our firmware. There are many options for implementation and management, but we are interested in the VARIANT_HOVERCAR option, so let’s uncomment the line:

Then, go to the subfolder “Inc” and open the file “config.h”

In this file, we will edit the parameters we need before compiling.

First of all, let’s go to the section “BATTERY”, where in the line

We need to indicate the real value of the battery voltage in millivolts. And in the line

the value measured by the ADC of the controller is entered, which we will receive through the serial port a little later.

And check the selected motor control mode in the line

In the same section, you can turn off one of the wheels if only one motor-wheel is used (otherwise the firmware after turning on will swear at the break of one of the wheels)

And also turn on the field weakening mode to increase the maximum speed of our vehicle. The speed increases significantly:

I used the FIELD_WEAK_MAX value of 8, since during testing on a chair, with the FIELD_WEAK_MAX value of 10, my wheels continued to spin when the throttle was reset. True, this was before the USART2 was shunted by capacitors from pickups. We should try again the value 10:

Section “DEBUG SERIAL” tells us how to get data from the USB-SERIAL adapter by connecting to USART3 and how to interpret the received data. We will do this after the initial firmware.

Finally, go to the VARIANT_HOVERCAR SETTINGS section

says that Torque Mode is used, which gives a smooth acceleration, a uniform ride over obstacles and uphill, and most importantly. roll-off, inertia when the accelerator handle is released, without engine braking. This greatly increases the running time on the battery, since you can accelerate, and for a certain time move by inertia.

This parameter secures the system against an open power wire or GND wire from the accelerator and brake handle on the USART2. The #define ADC_PROTECT_THRESH 300 parameter sets the protection operation threshold for the minimum and maximum values.

Due to the fact that I just use a button for the brake, which has only two values: 0 and 4095 (min / mac ADC1-value while poti at minimum-position (0. 4095), then I cannot use the protection function. ADC_PROTECT_THRESH cannot be set less than 1, and for other values, after turning on the power in the firmware, protection is activated by the zero value of the brake button (like a break) and the tricycle beeps with a buzzer, and does not go anywhere. Therefore, I commented out the line #define ADC_PROTECT_ENA, disabling protection, all the more so that I already have hardware protection, in the form of installed pull-up resistors on USART2;

and the same for ADC1, you can leave it alone, since the author has implemented a mode of automatic calibration of the maximum and minimum voltage values ​​from the accelerator handle and brake when the board power button is pressed for more than 5 seconds, which we will do after the firmware.

turned out to be very useful, because when assembling the tricycle, I confused the left and right wheels, and they spun in the opposite direction. This parameter of inverting the side of rotation of the motor wheels made it possible to correct the direction of rotation without re-commutation.

must be commented out. The author of the project uses one side board of the hoverboard with his alternative firmware to indicate the battery charge with a block of LEDs. If the board is not connected, but at startup, the firmware broadcasts a buzzer that there is a problem, and refuses to move on.

it is necessary to uncomment on the contrary, as this will give us the opportunity to connect to our board using a USB-TTL adapter via USART3 and get data on the voltage of our battery actually determined by the controller, and make an adjustment.

It will help to activate the parking brake function. After a complete stop and an inactive throttle handle, our vehicle will be impossible to move, the motor-wheels will resist, naturally to the detriment of the battery charge. I do not use.

After all the changes made, you can proceed to compiling our firmware. Click on the button “PlatformIO: Build” in the lower left corner and compile our firmware according to the selected option and parameters, look at the result of the process in the lower Terminal window:

DIY Electric E Bike From Scrap Hoverboard Build Tutorial

After completing the compilation of the firmware, we are ready to load it into the microcontroller on the board.

To do this, I made a three-wire cable and connected the ST-LINK V2 USB adapter to the board as follows. I previously soldered a comb on the board for connection:

3.3V from the ST-LINK V2 adapter for powering STM32 is advised not to take everywhere, to flash only with the main battery connected to the board. Although I tried it like this, nothing burned out for me, maybe I was lucky. A colleague donBaton’s microcontroller still burned out. Better to avoid problems.

Before flashing, it may be necessary to remove the write protection of the Flash memory of the microcontroller. I had to complete this procedure on two of my boards.

I did this using the STLINK Utility program under Windows, but it can also be done on Linux and MacOS using the OpenOCD package.For details, see this link: github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/How- to-Unlock-MCU-flash (How to Unlock MCU Flash)

I will present several screenshots of the MCU Flash unlocking process:

After unlocking, we return to PlatformIO again, connect our cable, hold down the power button and press the button “PlatformIO: Upload” in a programme. The buzzer will beep happily, the Terminal window will display information about the success:

After the initial firmware, it is useful to calibrate the battery so that the microcontroller correctly detects the supply voltage. For this, a USB-TTL adapter is used. I purchased the simplest adapter for CP2102 from this link: CP2102 USB 2.0 to UART TTL 5PIN Connector Module Serial Converter

For it to work in MacOS (and most likely in Windows), you need to install a special driver: CP210x USB to UART Bridge VCP Drivers

The device was detected in the system and became available at /dev/cu.usbserial-0001

From hoverboard to E-BIKE / DiY / Uradi sam E-BIKE

We connect the adapter to the board as follows:

We start the window for reading the virtual serial port with the command in the terminal:

The following lines with data ran in the window:

We are interested in the values ​​in the line under the numbers 5 and 6. The value under the number 5 is the measured value of the ADC, and under the number 6 is the conversion to the supply voltage value. The value under the number 5 must be written.

Then turn off the tricycle with the on / off button, connect our ST-LINK V2 USB programmer again, open the file again “config.h” in PlatformIO, go to the section “BATTERY”, and in the line

We enter the current value of the battery voltage, measured by a multimeter, in millivolts, and in the line

we indicate the measured value of the ADC, which we received under the number “five” a step earlier, from the serial port.

READ  Connecting the throttle grip to the e-bike controller

Again we compile our firmware, and again load the boards into the microcontroller.

Now our firmware correctly detects the voltage of our battery, which can be checked by connecting the USB-TTL adapter again, and checking the resulting voltage value under the number “6”.

Now we need to calibrate our throttle stick and brake button. For this, the author of the firmware has provided an auto-calibration mode. It is necessary to turn off the tricycle board, and turn it on again by holding the power button for 5-8 seconds. The buzzer on the board will emit an additional signal, indicating that we have entered the calibration mode. Now we have 20 seconds, during which we need to smoothly twist the accelerator handle a couple of times from minimum to maximum, and release. Accordingly, turn on the brake button and release it several times. The order is not important. After 20 seconds, the firmware will exit the calibration mode by itself and all the parameters of our controls (minimum and maximum voltage values ​​on ADC2 and ADC1) will be saved. This must be done after each download of a new firmware, if we make changes in it and fill in a new one.

By the way, if during the auto-calibration mode you connect to the board with a USB-TTL adapter and output data from the serial port, the screen will notify us about the start of the auto-calibration mode, and will show the status after completion.

In principle, everything, you can go! On a small section of an uneven dirt road, I accelerated to 32 km / h, on the asphalt I think it will go faster. Children have more impressive dynamics.

UPD: Reverse is activated by double pressing the brake button when the tricycle is at a complete stop. The reversing buzzer comes on and you can move backwards. Then again, by double pressing the brake, turn off the reverse mode, and go forward.

ASSEMBLY:

We carry everything outside and start assembling the tricycle. We connect the frame and subframe:

The fixing bolt of the axle of attachment of the subframe in the spacer sleeve was planted on the thread lock:

I locked the M12 nut of the axle of the subframe in the old way: I drilled a 3mm through hole through the nut and the M12 bolt, inserted the nail and bent:

We put the shock absorber. For fastening, I use nuts with nylon stakes everywhere so that they do not unscrew on the go:

We assemble the seats and put them on the frame, we also fasten them to the M8 bolts:

To install the power button, battery charging socket, battery disconnect button, I decided to use a black terminal box, with rubber membranes for cable input / output:

Placed the power button and charging socket:

To attach the terminal box to the frame, I placed a metal plate on rivets, and fixed the box itself to it with bolts and nuts:

I brought the cable from the accelerator handle through the box, it will pass in transit to the subframe, as well as corrugations for laying two lines: a power cable 3×2.5 mm2 for the battery disconnect button (and in the future two batteries), a control cable 3x2x0.5 mm2 for the power button, charging sockets and 2 wires in stock. Cable 3×2.5 in one corrugation 16mm, cable 3x2x0.5, and cable from the handle. in another corrugation;

For the future switching of two batteries, and for emergency shutdown of the battery in case of inadequate behavior of the tricycle, I purchased a 30A waterproof button and installed it in the terminal box cover:

To enter the corrugations into the engine compartment, I decided to use brass cable glands. He drilled the holes with a step drill, and secured with complete nuts:

Project budget and required improvements:

The main points that must be taken into account when finalizing this tricycle design:

In haste, I came up with the following bump stop / stop for the rear subframe, from a bolt, nuts and an old bearing:

Works well, but knocks, you have to think about another implementation.

What else I would like to add to the tricycle:

  • headlight and taillights;
  • a small mesh trunk on the back of the rear seat;
  • fenders on the rear wheels (I don’t know what design and shape yet);

ACCESSORIES:

For the manufacture and assembly of the tricycle, I purchased the following components and materials:

ST-Link V2. We will use it to download the new firmware of the STM32 / GD32 microcontroller on the segway / gyroscooter board. Link: ST-Link V2 stlink mini STM8STM32 STLINK simulator download programming With Cover

A set of handlebars for a bicycle handlebar, with an accelerator handle on the Hall sensor, with an integrated voltmeter to monitor the battery voltage, and two buttons: a latching button (red) and a momentary button (green), which we will use as an electronic brake button. Link: Electric Bike Voltage Display 1 Pair Universal LED Voltage Display Twist Throttle for 12-99V Ebike Scooter Durable

For the manufacture of the shock-absorbing rear suspension, the simplest bicycle shock absorber was purchased with a declared stiffness of 850 LBS, which in the end turned out to be not enough, although the shock absorber may not correspond to the declared stiffness. Reference: Rear Shock Absorber KZ-880B, 165mm / 420030

For the manufacture of the tricycle frame, the following steel profile was purchased:

As the front end of our tricycle, a BU children’s bike was purchased. When searching, the priority was the presence of a front hand brake:

INTRODUCTION.

The idea of ​​implementing this project arose at the moment when our mini-segway called A8, which is already 4 years old, once again broke down.

The segway stopped responding to the turn of the handle, respectively, the turning function disappeared. It was necessary to deal with the Hall sensor, but honestly, there was no desire to do this anymore. Segway had already begun to show signs of inappropriate behavior, several times switched off on the move, tilted too far back when accelerating, it was already becoming dangerous to ride on it. Therefore, the idea was born to use his motor-wheels and make a tricycle as the simplest design. Going to the network for the development of the idea, I suddenly realized that everything has been happening for a long time without me, and my idea has long been worked out by a large number of people). Therefore, before the direct implementation, I got acquainted with the experience of other self-made people, and noted for myself the following main points:

In the course of a short simulation, the following tricycle design was obtained and agreed with the children:

MANUFACTURING AND PREPARATION OF MAIN COMPONENTS AND UNITS:

First of all, it was decided to start manufacturing with the preparation of the wheels and the rear axle of the tricycle.

The motor-wheel was clamped in a vice and replaced the tire and the tube. The hole for the nipple in the aluminum rim of the wheel had to be slightly reamed with a 9mm drill, since the base of the nipple was noticeably thicker in the new chamber:

We got such impressive bagels:

It was decided to use a 20x20x2 profiled tube as the rear axle. The diameter of the axle of the motor-wheel itself is 16mm, and I pre-tested on a small cut how the square profile fits on the axle. There was a slight backlash of 1mm, but given the planned tightening of the axle in the profile with two bolts, this backlash suited me. Then I bought 3 meters of a new profile, and now it fit under the axle of the motor-wheel just perfectly, even went into the tightness with difficulty, it turned out even better than I expected.

Accordingly, I cut off a piece of the profile for the future axle of the tricycle and prepared nuts and bolts for fixing the motor-wheels:

I drilled holes in the profile and figured out where the nuts were attached:

I prepared holes for the output of wires from the motor wheels, assembled the finished rear axle:

The rear subframe was made from a 40x20x2 profile, made cuts in the profile and bent the shape of the future stretcher in a vice:

I welded the inner jumper of the subframe and scalded all the joints:

I took the purchased jet rod with silent blocks, cut it in half, fastened both halves with an M12x170 bolt through the spacer sleeve, marked and welded to the subframe structure. Note: I am still the welder! Experienced people know, but I did not immediately realize that with the active laying of welded seams, the thermal expansion of the elements must be taken into account, respectively, the jumper of the stretcher, where I welded the halves of the bar, it became hot, it had nowhere to expand, and it went a bit like an arc. It did not play a special role, but the moment is not very pleasant.

The spacer sleeve turned out to have a slightly larger inner diameter than expected. 16 mm, but it was not possible to find a smaller diameter. Therefore, I did the same thing. we drill a hole, weld the nut and fix the axis in the bushing with an M8 bolt:

We place our resulting subframe and try on a square frame profile, grab and weld the sleeve to the frame profile:

We connect the frame profile and the subframe, use a bolt, washers and an M12 nut:

For attaching the subframe shock absorber, I prepared plates from a 40×4 strip and made 8mm holes. I made several holes for possible replacement of the shock absorber and changing its position:

We set the angle of inclination of the subframe to the frame and try on the plates with the shock absorber, cut the plate to the desired angle for attaching the subframe to the pipe and weld:

READ  How to lubricate the rear wheel of a bicycle

We prepare the counterpart of the shock absorber mounting, from a piece of a 20x20x2 profile and plates with an 8 mm hole:

Trying on the shock absorber response bracket to the frame, trimming and welding. I must say right away that I then had to cut it off and digest it a little further, because I laid too small an angle of the stretcher to the frame, and even with a light load, the stretcher came out flush with the axis of the frame:

Prepared and welded rear seat mounting plates, with 8 mm holes:

Correspondingly and front seat plates:

To continue the work, it was necessary to make the seats themselves, because the place of attachment of the footpegs for the driver and the passenger depended on them, well, the attachment point of the front of the bike to the tricycle frame.

From 12 mm plywood I cut out the bases of the seat and back with a jigsaw (this time not on the sawing table, since he lost his saw for working on the street):

Marked the mounting holes and hammered the M8 mustache nuts

I glued the foam rubber left over from the manufacture of the bed (40mm 10mm) to the bases:

I subsequently painted the lower part of the plywood seat base with black paint, but for the back of the back, it was decided to make a panel of 6 mm plywood, and also cover it with leather:

The seat frame was made from a 40x20x2 profile, made an incision, bent at the desired angle, scalded the joints, marked and drilled 8mm holes for attaching to the brackets on the tricycle frame:

It’s time to dock the front of the tricycle. We cut the children’s bike, put the frame on the block, shape the tubes of the bicycle frame under the tricycle frame, call the children and measure the required mounting distance from the seat, weld the parts:

We fasten the rear axle to the subframe with M8 bolts, drill holes and fasten:

The footrests for the driver and passenger were made from a 20x20x2 pipe and 40×4 plates. We fasten with M6 bolts:

I planned to place the controller board and the tricycle battery in the subframe itself, for this the height of the 40mm profile was not enough, and I increased it down to the level of the rear axle with a profile of 20x20x2, the total depth of the compartment turned out to be 60 mm:

I decided to make the top and bottom cover of the compartment out of plexiglass:

I fastened the covers to M6 bolts, cut the threads with a tap directly in the subframe profile:

We take all the parts of the tricycle and send them to prime and paint:

To close the ends of the profiles, I purchased end caps for the profile, before painting I used a primer on plastic:

The cover of the engine compartment was sanded with 120 grains, and also sent for painting:

The frame and subframe elements were painted orange, black was chosen for the seats, engine compartment covers and the transition of the front end from the bike to the frame:

While the primer, paint and varnish are drying, you can take a break again and go to the electronic part of our vehicle.

Even before starting the project, I received the ST-LINK V2 programmer and downloaded the firmware from the author of ILYANOV through the STM32 ST-LINK Utility program (https://www.st.com/en/development-tools/stsw-link004.html). Everything worked out. Following this link, you can find the author’s firmware files and his connection diagrams: link. But later I discovered an alternative firmware by another author, which will be discussed below.

For this project, only the main board of the segway / gyro scooter is used, the additional gyro boards are folded back. There is a good picture on the network with the designation of all I / O boards:

In accordance with the available components and the board, the following connection diagram was obtained:

The board is on the STM32F103 microcontroller. I took the required 3.3V voltage from the AMC1117 converter housing with a separate wire, which I connected to the common wiring harness from USART2 (on the USART2 itself there is only 15V, which cannot be used):

In order for the mowing line of the USART2 ADC not to be susceptible to pickups, as well as to protect against an inadequate response of the board to a wire break from the accelerator or brake handle, it is necessary to bypass the ADC2 and ADC1 terminals with a 0.1-0.01 μF capacitor and pull up with resistors 2.10 kΩ to GND. I didn’t have SMD parts, so I used the usual lead ones, and the smallest capacitor I had was 2200 pF, which also fit. Without capacitors, even the wheels began to spin briskly when I simply touched the casings of the motor-wheels with my fingers:

To install resistors and capacitors, you had to remove the heatsink from the board and return it back. Pay attention to the protruding red wire on the side of the board (circled in red).

This is exactly the 3.3V wire I added. During the rotation of the board when installing the radiator, this 3.3V wire hit the bare conductor on the radiator case, and a short circuit occurred. The capacitors on the board were not discharged and I short-circuited 3.3V. The result was not long in coming. the board did not work. At first I thought that the 3.3V AMC1117 power converter broke through, since it only had 1.2V when the power was applied, but after replacing it (I took it from the gyro board), nothing changed. In the course of further diagnostics, it was found that the STM32 chip is dead, short circuit. There was no limit to disappointment. I had read before that for any manipulations with the boards, it is necessary to discharge the capacities, especially since on this board this is done simply by holding down the power button, but for some reason you remember this when everything is already bad. So much work has already been done, and that’s it, there is no fee.

The next morning, a call was made to several gyro scooter repair shops, and the price for a used board from a gyroscooter was received. 2000 rubles. And a little later, a small search on Avito gave several results for used gyro scooters in the city at a similar price. By the evening, a whole hoverboard was purchased, with an inoperative battery, for 2000r.

As a result, I got a board, a non-working battery (6 pieces of cans in the battery are dead, the remaining 14 were with a voltage of 3.5-3.8V), and a set of new motor-wheels for the next project. On the old board, you need to change the microcontroller chip, but there is no soldering station-hair dryer available, only T12, and so far there is no experience.

The board was placed on the base of the engine compartment on racks of screws, nuts and M3 washers

To switch all incoming lines from control devices, power buttons and charging connector to the board, I decided to make just such a small board with screw terminal blocks. There is also a variable resistor on the board, with which I planned to regulate the strength of the electronic brake, because I use a simple button for the brake with two values ​​0% and 100%. In practice, it turned out that a variable resistor is not needed, and you use an electronic brake only when there is not enough front manual brake, and maximum brake efficiency is only welcome.

To connect the battery wires, fuse and battery disconnect button, I used small feed-through terminal blocks on a mini-DIN rail.

Placed the breakout board and DIN rail with terminal blocks on the base:

I placed the battery accordingly, fixed it with a standard clamping piece, painted the base on the back side with black paint, and connected everything:

We fasten the rear axle of the tricycle and connect the phase wires of the motor wheels and the connectors from the Hall sensors:

Tricycle from a hoverboard / mini-segway: assembly, firmware and setup.

Good afternoon everyone! In this review, we will talk, perhaps, about my most exciting DIY project, which brought such a lot of positive emotions to both children and their parents. We will make a children’s tricycle (trike) from an old Chinese mini-segway / hoverboard and a children’s bicycle. As always, in the review I will present in detail the available components and components used, the process of manufacturing and assembling the structure of a tricycle with rear suspension, preparation and installation of electrical components, setting parameters and firmware of the wheel motor controller for a comfortable ride and control. The review turned out to be quite voluminous, I tried to present all the main points and features of the implementation of the task, so I will have to allocate considerable time for detailed acquaintance with the material.

I will immediately ask you to forgive me mechanical engineers, electrical engineers and programmers for mistakes in the terminology I use, I’m just trying to understand this, please treat with condescension, as a review from a construction linguist).

Project budget:

No. Name Price, rub.)
one Gyro scooter 2’000 r.
2 Metal. profile 700 RUR.
3 Barbell 430 RUR.
four Foam rubber / glue / eco leather 800 RUR.
five Fasteners 500 RUR.
6 Tires / tube 800 RUR.
7 Knob / Button / Terminal Blocks 950 RUR.
eight Shock absorber 650 RUR.
nine Bicycle 1’500 RUR.
10 Paint / primer / varnish 960 RUR.
eleven Programmers 250 RUR.
TOTAL: 9’540 RUB.

That’s all! If you have any questions, I will try to answer. If there are suggestions for improvement and improvement, let’s discuss together, especially since this is already the second review on this topic.