Encoder won't count more than one count

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

Encoder won't count more than one count

Postby jgeating » 28 Apr 2017, 20:24

Trying to use the AS5047 in ABI mode to no avail. I started with A/B to H1/H2, and I to H3, to no avail. I've tried switching to any combination, and it still won't read position properly. Rotor position only counts one count in either direction and then goes back to 0. For example, if I spin it CW it goes 0°-.042°-0°-.042° and so on, if CCW, it does 0-359.9X-0-359.9X.

When trying to autodetect, it always spits out a ratio of 500, which is incorrect. Just applying 5V to the encoder and taking a meter to it, both the A and B channels go to 5V and 0V as I spin the motor to different positions, so I believe it is encoding correctly. It also doesn't autodetect with the index unplugged (still gives ratio of 500).

Running firmware 2.16. I've also tried 2.18 - that's what I started with originally because I wanted to operate using SPI - but that kept on disconnecting the VESC, both in SPI and ABI mode.

Any ideas would be greatly appreciated!


Posts: 232
Joined: 26 Dec 2015, 14:38
Location: Sweden, Stockholm

Re: Encoder won't count more than one count

Postby arvidb » 30 Apr 2017, 10:35

That it always counts one step and then back again sounds to me like one of your channels (A or B) is not connected. Maybe check continuity between the pins on the microprocessor and the outputs of the encoder?

Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Encoder won't count more than one count

Postby rew » 30 Apr 2017, 19:13

Or the chip is looking for the signal on a different pin. So start with a SPEC of where the signal is supposed to be and follow it to your encoder, not the other way around ("here is B on my encoder, it goes tot he board here, and then to ... ah, let see, that's pin 38 on the chip....." Then you haven't verified that it's on the RIGHT pin on the chip).

Return to “FOC”

Who is online

Users browsing this forum: No registered users and 1 guest