EBIKE Speed limit to throttle using pwm signals and hall sensor

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