Encoder, Small Motor Issues

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
Posts: 18
Joined: 20 Jan 2016, 04:29
Location: Washington, DC

Encoder, Small Motor Issues

Postby jgeating » 26 Apr 2017, 00:52


I am trying to get position control to work on a small low KV hobbyking motor.
Using the AS5047. The motor doesn't seem to want to commutate in both BLDC and FOC modes. It just skips around, even after detecting properly in both cases. In BLDC mode, it cogs while rotating slowly. In FOC mode, it just oscillates back and forth.

Furthermore, I can't get the encoder to register. I've triple checked the wiring and tried it in both SPI and ABI modes to no avail. I can hold a meter to the B and GND lines and see it switch between 0 and 5V as I rotate slowly, so I think the encoder is operating properly. I set FOC to sensored mode, and selected the proper encoder option (ABI/AS5047) in the GUI.


Here are the pinouts I'm using, from googling forums:
When in ABI mode:
H1: B
H2: A
H3: I
5V: 5V

When in SPI Mode:
5V: 5V and MOSI in parallel

The first 10 or so times I tried sensing the encoder, it moved about 5-10X one direction, then in the other, then the port disconnected and I had to restart the VESC. Now, all I hear is a tick and the motor doesn't move, BLDC tools says I'm still connected, but I have no control and I need to restart the VESC to regain control.

Thanks, any help would be appreciated. I'm trying to first work out the encoder, then worry about the commutation.

Posts: 8
Joined: 07 Apr 2017, 02:45
Location: Los Angeles

Re: Encoder, Small Motor Issues

Postby beak90 » 18 May 2017, 00:35

The issue is probably related to the size of your motor. By default, most VESCs are setup for massive motors, so the current sensing circuit is setup for a scale of 0-165A. This results in a lot of noise in the low range of current. On mine, the noise was +-1A. The VESC cannot control the motor without clean current signals. To make the VESC work with a smaller motor, the current shunts need to be changed to a larger value. 5x or 10x larger would probably be good.

Go to the current tab in BLDC tool and take a measurement with the motor not spinning (press "Now" in the sample area). Post a screenshot of that so we can see the current values. I'm guessing it will be very noisy.

Return to “FOC”

Who is online

Users browsing this forum: No registered users and 1 guest