I want an electric bicycle!

L.L.
9 min read

I want to share my experiences and knowledge in the fields of engineering, electronics, and mechanics. As a passionate engineer, I am fascinated by the interplay of different disciplines and the diverse range of applications that arise from it. And what better project to bring all these disciplines together than a homemade electric bicycle?

I embarked on this project back in 2014. At that time, the legislation regarding electric bicycles in Germany was largely unregulated, allowing for the use of such bicycles on public roads. This provided me with the opportunity to design and test my electric bicycle according to my vision.

My goal is to share technical knowledge and inspire fellow engineers, hobbyists, and technology enthusiasts. I want to showcase how various disciplines intersect and how one can explore new horizons through personal projects.

But why? You can buy this stuff ready!

I kept hearing this statement throughout my whole life. If you also went through the same problem, leave a Kudo in this posting now!

Ever since I was a small child, I've been captivated by "stuff" and the inner workings of things. Breaking objects apart to understand how they functioned became a regular pastime for me, even if occasionally I struggled to put them back together again! This innate curiosity and passion for exploring the mechanics of objects has stayed with me throughout my life.

When I began researching the world of electric bicycles for my project, I stumbled upon a wealth of incredible do-it-yourself (DIY) designs available on the internet. One particular source of inspiration was the YouTube channel of Knoxieman, where I discovered innovative and creative approaches to building electric bicycles. Additionally, I delved into technical articles and resources that provided valuable insights and guidance.

During the time of my project, there were limited options in the market for reliable electric bicycle systems. Many of the available systems had to be imported from China, which didn't align with my goal of truly comprehending and mastering the intricacies of building an electric bicycle. I was determined to gain a deep understanding of the technology and embrace a hands-on approach, which is why I chose to build the system from scratch.

By embarking on this journey of creating my electric bicycle, I aimed to push the boundaries of my technical knowledge and skills. I yearned to comprehend every aspect of the system, from the mechanical components to the electrical circuitry and programming. This hands-on experience allowed me to troubleshoot, fine-tune, and customize every element according to my preferences.

Building a self-made electric bicycle became more than just a project; it was an opportunity to dive into the realm of engineering and electronics, to truly grasp the nuances of integrating various systems, and to cultivate a deep appreciation for the interconnectedness of these disciplines.

Requirements are always needed

As I began designing my self-made electric bicycle, I established key requirements to guide the process:

  • Maximum speed of 50 km/h for security reasons.

  • The minimum range of 20 km on half throttle.

  • Adaptable power output and speed configuration.

  • Emphasis on low gravity mass for stability.

During the design process, I considered different propulsion systems, specifically the mid-drive and wheel-driven systems. Evaluating their advantages, I decided to opt for a mid-drive system. This choice allowed me to leverage the bicycle's existing gearing, providing enhanced flexibility and efficiency in the driving system.

Incorporating a mid-drive system meant that power was delivered directly to the crankshaft, utilizing the bicycle's gears to optimize performance. This design allowed for better utilization of the available power and provided a more natural riding experience. The flexibility of the mid-drive system also enabled me to fine-tune the power output and speed configuration to suit various riding conditions.

Throughout the integration and testing phases, I paid close attention to the compatibility and alignment of the mid-drive system. By carefully aligning the motor and the bicycle's existing gears, I achieved seamless integration, allowing for smooth power transfer and efficient energy utilization.

The design and planning process took into account the benefits of using a mid-drive system, leveraging the bicycle's gearing to enhance flexibility and optimize the driving system's performance. This decision played a crucial role in achieving the desired speed, range, and adaptability of my self-made electric bicycle.

Planning the development process

To avoid unnecessary delays, I established a critical path for ordering parts from different countries, including the USA, UK, Germany, and China.

It's important to note that this plan was partially modified during the development. If you notice any incorrect information, you're likely correct!

Planning the system

By visually planning the system, I was able to identify additional requirements related to the control board.

Integrating a self-developed control board allowed me to implement a nearly closed-loop power/speed control and create a specific and adaptable electronic system for different use cases.

Must-RequirementsAchievement path
-Speed ControlIntegration of a speed sensor (hall-sensor) on the rear wheel.
-Temperature ControlIntegration of temperature sensors into the ESC (Electronic Speed Controller) and motor.
-Wide input voltage rangeInitially planned to be achieved through a Buck converter, later resolved by VESC integration.
-Undervoltage protection and alarmMeasurement through a voltage divider and integrated 10-bit ADC.
Can-Requirements
-Anti-Theft AlarmIntegration of an accelerometer sensor into the control board.
-Power Output ManagementInitially planned to be integrated into the control board but later limited by the VESC.
-Optimal Gear shifting panelCross-analysis of speed and current values measured through the shunt. Allows for determining the best moment for gear shifting.

After the initial requirement analysis, I specified the necessary inputs from the control board. This helped me determine the appropriate microcontroller to use later on.

Calculate, calculate and calculate

When designing the adaptable power output and speed configuration, I considered various parameters to ensure optimal performance.

By incorporating these parameters into calculations and simulations using Excel, I evaluated the impact of each variable on power requirements and speed ranges. This comprehensive approach allowed me to fine-tune the design and optimize the adaptable power output for different riding conditions.

Through iterative calculations and simulations, I considered the interplay between weight, wheel radius, rolling resistance, aerodynamic factors, and hill gradients to determine an optimal power output and speed configuration. This holistic approach ensured that the electric bicycle could efficiently and effectively perform across different terrains and scenarios.

On a 12S system (44.4V and 10Ah) and in second gear, I projected a maximum range of 72.9 km! If you wish to get the Excel file I used during the development process like this post and write me up. Please note that it has not been optimized or cleaned up before publishing. If you wish the file make sure you like this blog post. It will provide valuable insights into designing an electric bicycle.

3D-Modelling and iterations

Just like in life, I started with small steps during the 3D modelling process.

I put a lot of thought into the mechanical system, including considerations for part strength, system clearance, bearing press-fit calculations, and stress testing. The system had to be flexible enough to be implemented in other applications, so I took into account a certain degree of system flexibility for future improvements, including different mounting systems.

Some of the calculations can be found on the second sheet of the Excel file mentioned earlier.

In the end, the system can be considered slightly over-dimensioned. It's better to have a bit too much than too little when dealing with a system capable of delivering 7 kW of power! All the parts were specified and documented, allowing them to be ordered from different manufacturers.

The final CNC-milled version of the central drive turned out to be highly optimized, with press-fitted bearings that could handle more than twice the original system stress. I could have significantly reduced the mass of the part, but that would have meant higher milling costs/complexity, and the weight reduction would have been only around 0.5 kg, which can be easily ignored.

Exploded View:

A video of the initial assembly of the system:

Parts, parts and more parts

The central part was CNC-milled from a 7075 aluminium block, while the sheeted parts (motor mounting, upper base, and bearing holders) were laser-cut (6082 aluminium) by a manufacturer in Germany.
Most of the electrical system parts were ordered from Germany, while the Motor (Alien Power Systems) and VESC (Electronic Speed Controlled) were obtained from the UK. Some key parts, like the freewheel, were directly ordered from the USA due to their limited availability. Originally, such freewheels are used on Chainsaws in the USA.

Each of these parts had its own set of requirements, which were carefully considered during the development and ordering process.

Setting up the electronic development

To develop a control board specific to my needs, I created a development mockup to program the inputs and outputs into the microcontroller accordingly.

I set up a logic to assist in developing the microcontroller code.

The speed control board was developed using EAGLE. Originally, I planned to have a separate Buck converter as a power source, but this requirement changed since I was using a highly advanced ESC that provided an independent and stable 5V source. Future versions of this board would need to operate independently since an error in the ESC would result in the control board turning off automatically. Having a standalone power source would allow me to add functions like an Anti-Theft system that remains on at all times and create a certain level of system redundancy.

The selected microcontroller for the prototyping was the Atmega 8. Although it did not fulfil the necessary functions and the required number of ports as defined by the initial control board requirements, it would be sufficient for developing a basic framework for early troubleshooting. The subsequent microcontroller used was the Atmega 32.
The prototype was programmed using BASCOM. I acknowledge that many electronic developers might find this amusing and will start laughing out loud now! :D
I don't judge you for that. In most of my applications, BASCOM was sufficient to achieve the desired goals. If I were to develop something more complex, I would certainly use C++. However, that was not often the case in home-brew projects! A prototype of the board was etched, with soldering that was not as clean as it could have been. :)

End of part I...

This page will be updated with more information and references once I find them all. Please note that this project was conducted 10 years ago, so many of the technologies used may be outdated.

In the next post, I will provide further details about the final version of the bicycle.

0
Subscribe to my newsletter

Read articles from L. directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

L.
L.