OpenSource Ampler

BB8

1 mW
Joined
Sep 25, 2019
Messages
12
IMG_20190917_111345.jpgThis project took me quite a while, before I started I didn't know a lot about electric bikes, and their components. I got a lot of info from this forum, so that's why I wanted to share this project

I decided, because of reasons, to convert my Ampler curt to an open source controlled Ampler curt, using a VESC. This all just fits into the space available, and it is able to read the pedal sensors, control the lights and turn the rear motor of course. I 3d printed a enclosed to match the original one.

For others interested in this project, this is the information I gathered
1. The motor in the Ampler is a motor made by AKM or Aikema, and generally referred to as a Q100C. Or the "Q100C CST 36V350W Rear Driving EBike Hub Motor - RPM : 201" you can find on Bmsbattery
2. The connecters used on the bike are Julet Mini connectors, I used the ones from this supplier

The parts I used for the conversion:
Arduino Pro Micro here
Flipsky mini fsecs here
Flipsky antispaak switch here
Replacement switch here
Small NPN transistor from Farnell

If people are interested I can provide some schematic, and a 3d print file and Arduino software

Now it is able to propel me to about 35kp/h , this varies a bit depending on the state of charge. :D :D

To turn on the lights, I have programmed the Arduino to turn them on when you move the pedals half a turn backwards after turning it on. Because the power switch is now a latching switch to control the antispaak switch I cannot use that to control it. The lights are power from the VESC 1A BEC (battery eliminator circuit). The Arduino controls the VESC using uart, I used this library to control it

tempImage3P1lCP.gif
tempImage1lSM3K.gif
tempImagetGD6eC.gif
tempImagenh0YMO.gif


Screenshot 2021-04-19 at 07.47.14.png
 
Looks like the anti spark switch I used is blown, it now stays on the on state. :roll:

Is this expected behaviour when it is blown?

This one:
https://www.banggood.com/Flipsky-AntiSpark-Switch-Pro-280A-for-Electric-Skateboard-RC-Car-Model-Parts-p-1349674.html?cur_warehouse=CN
 
BB8 said:
Looks like the anti spark switch I used is blown, it now stays on the on state. :roll:

Is this expected behaviour when it is blown?
If it's made using FETs, then yes, that's a common failure mode of FETs (shorted). :(
 
flipsky anti-spark are known for being a bit shit.

If the xt90s can be integrated into your design, it works much more reliably.

Unfortunately, I don't know any anti-spark switches that are super reliable, but take a read here
https://forum.esk8.news/t/anti-spark-switches/1646/66

The esk8 guys are very into VESC stuff
 
H'mmmm .... why the Anti-spark switch? Is it required by the circuit?
If you just want to avoid seeing the arcing and sparking then a good mechanical switch might be a more reliable alternative.
See the thread: https://endless-sphere.com/forums/viewtopic.php?f=2&t=110347

If you do need electronic control then there is a old thread about "Active pre-charge/inrush control" circuits here:
https://endless-sphere.com/forums/viewtopic.php?f=3&t=40142
 
First of all nice Project!
I would also like to replace my controller. Any chance you could upload your wiring schematic, 3d print file and Arduino code?
 
I wonder if the op just doesnt' check their thread for replies? Their profile shows they have logged in as recently as last month, yet they never reply to anyone at all. :(
 
Yeah. That's why I also PM'ed him. He might not get notified when someone posts in his threads.

Eitherway I am gonna buy the components he metioned and gonna try figure it out myself in following weeks.
Unfortunately i am using my bike to drive to work. Therefore I have to find time to take the bike apart and check how everything is wired up.

I've also been wondering if he was able to integrate the "Torque sensor for smooth acceleration" into the new controller.
 
Hey, the original anti spark switch I used blew, I swapped it out with this one:
https://flipsky.net/products/anti-spark-switch-smart-280a-for-electric-skateboard-ebike-scooter-robots?_pos=1&_sid=279ba950c&_ss=r

But because this was a bit larger that the first one, I wrapped the whole thing in insulating tape and did not use the 3D printed part anymore. (sadly, because the 3D printed part was way nicer to stuff into the tube)

Let me find some stuff for you guys!
 
Here is the Arduino source attached, in the vesc.ino.zip

I used the analog inputs to read out the encoder signals, there is some arbitrary threshold in the code to read a high or low on both these signals (340 and 750). Maybe these values are different on your setup.

After boot you can rotate the pedals backwards to turn on the lights and step through different 'assist-levels'

I used a library to talk to the VESC, which is also attached in VescUart-master.zip
https://github.com/RollingGecko/VescUartControl
 

Attachments

  • VescUart-master.zip
    32.8 KB · Views: 29
  • vesc.ino.zip
    1.6 KB · Views: 31
Here are the 3D files for the housing, I also attached the Fusion 360 file so it's easier to modify
 

Attachments

  • Vesc for Ampler v2.f3d.zip
    97.7 KB · Views: 23
  • Vesc for Ampler v2.stl.zip
    22.6 KB · Views: 17
anzulo said:
Yeah. That's why I also PM'ed him. He might not get notified when someone posts in his threads.

Eitherway I am gonna buy the components he metioned and gonna try figure it out myself in following weeks.
Unfortunately i am using my bike to drive to work. Therefore I have to find time to take the bike apart and check how everything is wired up.

I've also been wondering if he was able to integrate the "Torque sensor for smooth acceleration" into the new controller.

I didn't manage to ready out the torque sensor, would be a nice feature!
The is the pinout of the sensor:

Pinout pas sensor
Red A1 PAS A
Black A2 PAS B
Blue A3 analogPin (torque)
Green VCC
Yellow GND

I also attached a pdf of the manufacturer of the pas sensor
 

Attachments

  • ForeHorse 2018 product manuals.pdf
    2.3 MB · Views: 50
Thanks a lot for sharing. I gonna order the parts in next few days and report back I got everything and start the Project.
I'll also see if I can figure out the torque sensor.

EDIT: Can I ask why you decided not to use the default ampler switch?
 
I think it was because the original anti spark switch had a latching button.

The one I use now uses a momentary button, so I think you can use the original switch yes
 
Alright Thanks. I'll try to keep the ampler switch. I've just odered few parts.

I got one more question. I am about to get the cables and was wondering which and how many to get. It seems like there are ones with 2pin/3pin/4pin/5pin/6pin. If you remember, could you tell me which one and how many i need?
 
Here is a picture of all the connectors on the original ampler controller

I remember now, the 5 pin green one might be a "normal" Julet connector, not a Julet mini
This one:
https://nl.aliexpress.com/item/4001091169417.html?spm=a2g0s.12269583.0.0.20463c1eZzJOIv&gatewayAdapt=glo2nld

And of course don't forget the 9 pin motor connector and battery connector
 

Attachments

  • IMG_5215.jpg
    IMG_5215.jpg
    503 KB · Views: 1,323
I really enjoyed reading all posts concerning your great project - so I felt I have to register and post this feedback!

Curt is a really nice piece of engineering.
I bought my Curt (MY 2021) mid of 2022 and rode some after work kilometers.
Now I face the same situation you did: I would like to improve my skills and understand more about the drivetrain.

Question upfront: your bike was equipped with BBTS1.0 torque and speed sensor. Outer Geometry of my 2021 Curt seems to be same. Anybody able to confirm that 2021 Curt is also using BBTS1.0?
 
Maybe you can tell from the outside, here are some pictures of mine

IMG_20190928_195030.jpg
IMG_20191001_154849.jpg
IMG_20191001_154853.jpg
 
Thanks a lot for your really quick response.
My Bike looks @ left side comparable to yours, @ right side (belt drive) different - see photos.

I did some internet research:
THUN x-cell-rt 2.0 might be matching (optically)
https://thun.de/de/project/x-cell-rt-2-0/
The product video also shows (in my opinion) the Ampler Bike.
THUN x-cell-rt 3.0 might also fit

NCTE is absolutely matching to your photos
https://www.ebike-solutions.com/de/shop/teile-fuer-steuersysteme/tretsensoren/ncte-sensorisches-4-kant-tretlager.html?number=aepasnc128L-01
but different to mine.

20230102_195116.jpg
20230102_203909.jpg
 
Yes that's different from mine on the side of the sprocket

You can try e-mail the manufacturer for specifications
 
Lots of Projects at home and at work seriously delayed my Ampler Project - but inbetween I found some time to continue.

1st step after your mails in January had been a small hardware setup on my desk

Subsystem A
Motor: NoName | 36VDC | 250W | 9 Pin Connector
ESC: ESK8 Controller
Potentiometer for ESC / Input for Current Control

Subsystem B
Torque Sensor: NCTE SBBRT - 120L - 1 -5 - 20 | 6 Pin Connector
Till this point of time it was unclear wether this Sensor will fit into my Amlper Curt.
µController: WEMOS D1 mini

DC Power Supply: 0-60VDC, 0-5A

Project Targets:
- Communication WEMOS D1 mini & Torque Sensor
- Crank Speed / revs per min
- Rotation / positive or negative
- Each rev divided in 16 increments
- Read Torque Sensor
- Communication ESC and Motor
- Teach Motor Paramters
- Control Torque / Current via Potentiometer


eBike Project Step1.jpg
 
In a 2nd step both Subsystems had to be married to one common system.
To avoid any scratches or defects at my nice Ampler Curt, I was searching the internet for a very long time to find a defect bike as workhorse for my trials. In a best case this bike should be technically comparable to my Curt.
Some weeks ago I spotted a defective Ampler Stellar for an acceptable price - so I bought the bike and the project began.

Inbetween the main Steps of work had been
- Repair LiIon Battery Module (some defective 18650 cells had to be exchanged)
- Replace BMS
- Integrate my NCTE Torque Sensor into the Ampler Bike (geometry was 100% compatible despite connector)
- Install an Anti Spark Switch inbetween Battery and ESC
- Connect Anti Spark Switch to Ampler Latching Button & LED indicator
- Combine WEMOS D1 mini & VESC; VESC 3.3 VDC and GND used to Power the WEMOS D1 mini
- Wire Ampler Battery Charging Interface w/ Battery

Remarks:
- Light not yet connected.
- Torque Sensor only uses Speed Information / Torque not yet inlcuded
- Torque Control by PWM Out of WEMOS D1 mini
- Hardware (WEMOS D1 mini and VESC) is externaly mounted (plastic box @ frame)

Current Status:
- 1st test drives started this evening :) [on private ground]
- Bike is propelling up to approx 35km/h
- Already fun to ride even w/o torque control. Speed Signal only already "feels" quite good!
- Bike only propels if cadence exceeds a certain limit & direction of rotation positive
- After a timeout of 250ms or in case of negative crank rotation support stops

Next Steps (whenever there will be some time)
- Include Torque Control
- Switch over to Digital Communication inbetween WEMOS D1 mini and VESC instead of using PWM
- Replace ESK8 Controller by VESC mini 4.2 (smaller in size)
- Integration of entire Hardware into bicylce Frame
- Maybe Add Display or SD Card to log information during "debugging" period
- Include Speed Limit


eBike Project Step2.jpg


@BB8: thanks for inspiration! Studied your Arduino Code today. Excellent Job! Really like how you managed to use the front and back lights to indicate the current support mode!
 
Last edited:
In the mean time I found some time to continue.
2 Controller Versions build up

a) "Light Edition" - fully integrated in Ampler Frame
- µC WEMOS D1 mini
- VESC mini 4.2
- Mechanical Power on/off switch 22mm
- Light by BEC, switched by main power supply
- Digital Communication µC to VESC
- PAS Mode only, no usage of Torque Sensor

Really Tough to mount all parts into the space available, but finally fitted.
This version of Controller will stay inside the bike for a while.
Technically it´s a downsized and little improved version compared to my first test based on the ESK8 Controller (see previous post).

Just wondering if the Anti Spark Switch would additionally fit into the frame?

Ampler Light.JPG
 
Last edited:
Back
Top