Hi, I am making my own E-bike, and am trying to get my ESP-32 to have control over the VESC. I am able to initialise the connection, as well as call and read functions like input voltage totally fine, with no issues, but when I run…
The motor twitches, and makes a horrible screeching noise.
When I set the throttle to neutral (128), nothing happens as expected, and when I turn on the brake (dropping the value bellow 128), the motor twitches but doesn’t apply any break.
I have tried putting a delay in the loop, but that didn’t seem to work either.
What makes all this stranger is that I can see in VESC tool that the correct throttle percentage is being received.
Note: The motor does spin fine when using a ADC throttle, and during testing, I unplugged the ADC throttle and set the input as UART only. This suggests that the issue isn’t withing the ESP-32, or the code, but somewhere withing the APP settings of the VESC.
I would like to avoid having to use a PPM signal, as in theory this should work.
As for sensors, the motor has halls, which I am currently using, if I switch to something like HFI the noise becomes louder (most likely due to the motor glitches and the high frequency signals that HFI uses at low speeds adding together), but still no movement.
The bike did work 100% when using only ADC, so all the motor settings are fine.
Yeah sorry I have basically zero experience with ADC as esk8 pretty much never ever uses it.
There’s a couple people who’ve built ebikes on here though they might be able to help. You might also find some people more in tune with the programming/code side on the VESCTool forum
OK, I have found the issue, I had my Motor Current Max Brake set to 0, and because the throttle that the ESP-32 uses is a 2 way throttle, it needs the capabilities to apply a brake?
I think that is what is going on, anyway, thanks to everyone who helped.