You are here

Cant get Rotor position to work

4 posts / 0 new
Last post
nancio
Offline
Last seen: 1 year 10 months ago
Joined: 2021-11-03 17:44
Posts: 2
Cant get Rotor position to work

Hello guys

I have an Enertion Focbox (the black one with only one output), and I have been trying to get it to read an encoder

focbox.png

The encoder I chose was the As5057. I did not want to modify the FOCBOX so I wanted to use the hardware pins and not remove the hall pins filters.

So I installed a VM with Linux and recompiled the firmware (5.03 because I had problems with the new one) and uncommented the line of the Hardware pins.

code.png

However, I still couldn’t read anything. So I used a logic analyzer to use the communication and this is what I got:

1.png

For comparison, this is the same encoder talking to an Arduino via spi

2.png

I also tried to use it as an ABI encoder and had no luck. The vesc tool does not show anything.

Any suggestion?

Also, my reset pin seems to have been broken? What I mean is, to connect to the pc and be recognized I have to short the reset pin to Vcc. I think this means the internal pull-up resistor may be burned? Is that even possible?

20220606_193308.jpg

 

 

frank
Offline
Last seen: 1 day 20 hours ago
VESC BronzeVESC FreeVESC GoldVESC OriginalVESC PlatinumVESC Silver
Joined: 2016-12-27 20:19
Posts: 847

Reset should not be connected to VCC but to GND  and only if you have trouble to flash the software via SWD. It is typically shorted to GND for a fraction of a second before you try to re-flash the unit.

SWD should only be connected via CLK GND and IO if you use a ST-link V2 clone! Otherwise you feed 3.3V and potentially damage the unit. If you use an original ST-Link, you also connect VCC to the 3.3V sniffer pin on the ST-Link.

USB should not power up the device. You need to power it up via a battery and then connect via USB. AS5047P Should work out of the box without any modifications.

nancio
Offline
Last seen: 1 year 10 months ago
Joined: 2021-11-03 17:44
Posts: 2

"Reset should not be connected to VCC but to GND" If the reset pin is left open or connected to GND the FOCBOX is not recognized by the PC. It does not appear as a device in the device manager and the error pin does not flash (it flashes in my case because I have no motor connected and I am using the USB to power the FOCBOX). 

I don't know why this is happening, for a while I thought it was broken (because I could not get it to be recognized by the PC, this started after I changed the firmware to one that I edited but only after I changed the encoder in the vesc tool and uploaded that configuration) but by connecting a  programmer it worked and by probing I found out that the programmer was pulling that pin high and by checking the datasheet I found this.

reset.png

"USB should not power up the device"  to facilitate debugging I shorted R6 so I could USB as a hoste.

"AS5047P Should work out of the box without any modifications." that was the idea that I had but that communication that I posted before does not make sense and the FOCBOX does not receive any information from the encoder.

frank
Offline
Last seen: 1 day 20 hours ago
VESC BronzeVESC FreeVESC GoldVESC OriginalVESC PlatinumVESC Silver
Joined: 2016-12-27 20:19
Posts: 847

Please make sure to remove the R6 short when you apply a battery to the Focbox and intend to use USB. Otherwise you creat a GND loop to the computer and that can kill either the Focbox or the computer. If you power it with 5V it should light up the blue LED and no error code should be visible.