vedderb / bldc

The VESC motor control firmware
2.25k stars 1.38k forks source link

FOC Speed Control with Quadrature Encoder (ABI Encoder) #620

Open jmfortin opened 1 year ago

jmfortin commented 1 year ago

Hello,

I have hooked up a quadrature encoder to my BLDC motor in an attempt to get better startup torque and low speed control than with the default FOC sensorless mode. Unfortunately, I can't get it to work and it seems like FOC speed control is only implemented with Hall sensors inside the motor, which I don't have. Is there something I am missing ? Is it even possible to do speed control with a quadrature encoder in FOC mode ?

Thanks!

Zob314 commented 1 year ago

Are you setting the sensor port mode to ABI Encoder? From the info in the VESC tool:

ABI Encoder A rotary encoder with A-B-Index output. Notice that this encoder does not help until the index pulse is found, so when running FOC open loop mode will be used for up to one mechanical revolution to find the index position when trying to run a motor for the first time after a power cycle.

Notice that you also have to set the number of encoder counts in order to use this type of encoder. This usually is the number of pulses per revolution times 4, since every edge of both pulse trains is counted.

You'll also have to set the FOC -> Sensor Mode to Encoder. This will cause the commutation to be done via the encoder as well as the speed control. At this time it doesn't look like there's a way to do speed control with anything but the FOC commutation input.