EBIKE Speed limit to throttle using pwm signals and hall sensor

I want to control the throttle of my bldc motor controller using a pot and i also want to add a speed limit to the throttle so that once it reaches that speed the the throttle response is cut off.
Please let me know if you can give me the code or suggest some source. I am new to arduino programming and need your help to complete my project

What do you have working so far?

Actually i have done some research and found some of the codes for using the servo.h library and controlling the pwm for throttle
But nothing for putting a speed limit to it and also alot of them deal with small bldc motors (drones etc)
Can it be handled by using an if statement like if speed (from hall sensor) is greater than or eual to speed limit cut off the throttle
Pls help

you should have a way to measure RPM of the wheel so this will be the input to control maximum speed

Yes I mentioned above the the motor has a hall sensor so going to use that for measuring speed

you could start by:

If (speed_hall_sensor < value_for_maximum_speed) {

then you just program the PWM in steps as 25%, 50% and 100% of pedal assist , right?

Yes i guess this should work

Your ebike has a speed controller, You will need to find out the type of throttle you have, many have a throttle that has variable resistance. (measure the resistance of the throttle from off to full throttle, If you find out that value you can add a pot to your controller. Or you can use a motorcycle throttle stop, locks the throttle in one position but you can easily change the throttle.

In order to fix the speed, you will also need to look at the controller you have. Some controllers have a max speed setting, but many do not.

You might need to upgrade your controller to a controller that supports this functionally.

Good Luck with your project

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.