I’m currently working on a project where I want to build a stationary bike that uses a BLDC motor as a braking mechanism. The idea is to press the motor against the rear wheel and use a VESC to control the resistance. The resistance should simulate terrain conditions like uphill gradients or slopes.
The concept is that when the user pedals the bike, the BLDC motor will act as a resistive load, providing torque that opposes the pedaling force, as if the rider were going uphill. The harder the simulated slope, the more the motor will resist. I’m not using the motor to drive the wheel, only to actively resist the rider’s pedaling, based on terrain data.
To do this, I plan to use an ESP32 to process slope and elevation data from a virtual ride, and then send appropriate commands to the VESC to adjust the braking torque in real-time.
My main question is: what’s the best method or control mode in the VESC to achieve this kind of dynamic braking behavior? I’m considering FOC current control, but I’m not sure if that’s the most suitable approach. Is there a way to control regenerative braking torque directly from the ESP32? Also, are there any similar projects or references that might help guide my implementation?
Any suggestions or guidance would be greatly appreciated. Thanks!
You’re going to want to run it in duty cycle mode. You won’t need a throttle because you are trying to achieve an RPM of zero. Then what you need to do is have your computer talk to the vesc and change the motor current limit according to the amount of resistance want. I know this because I recently just built a roller Dyno using a vesc and a bldc motor as the load
Could you please explain more about how to implement the braking without using regenerative mode? What would be the best way or method to achieve the resistive torque effect in that case?
Hi! Thanks for sharing your experience. Since you mentioned you recently built a roller dyno using a VESC and a BLDC motor as a load, could you please explain a bit more about how you set up the control?
Specifically, how do you configure the VESC to provide a controlled resistive torque without the motor spinning freely? Do you use duty cycle mode with current limits, or is there a particular way to keep the motor at zero RPM while adjusting torque?
I’m currently looking for some help with my roller dyno project. Maybe we can help each other.
I’m trying to find a way to link a potentiometer to the motor current limit in vesc. Bonus points if I could use the built-in pwm input on the vesc I already have.