[help] VESC Tool + AS5047

Hey guys. I had some trouble setting up my VESC and encoder on the VESC tool. Here is what happened:

General info: Maytech VESC 6 200A with SK3 6374 149kv and AS5047 encoder adapted onto sensor adapter. then connected to VESC. Connect two of them using canbus. Mini remote.

With 3.57 firmware: All detection success and received all results with motor detection and encoders. After finishing all setting up, only one of the vesc with reciver for remote plugged in is working. Canbus can’t power other VESC. No faults in the terminals.

Then flashed down to 3.40: Motor detection failed.

If anyone have any idea where I should be looking into, please let me know. Thanks!

Maybe @Trampa?

Anyone???

Maybe I soldered the encoder wrong?

How you run them, with 5V or 3.3V? Do you use shielded wires? Did you check noise on the line? Does the motor detection work without encoder?

2 Likes

5V port with shielded wires. Getting clean signals.

Haven’t tried the detection without encoder. Will try that today!

Thanks for the advice!

Little update:

Ran motor detection and it works just fine 3.58

Updated the firmware to 3.58 and it magically worked good…

2 Likes

Got a fault code after I put these on the boards, anyone know what this means?

FAULT_CODE_ENCODER_SPI

Thanks!

SPI Format
As its name suggests, it is not a protocol but an interface format, meaning it defines hardware connections without making any demands on the actual binary word format. SPI is a master/slave arrangement. In this example, the controller and the encoder are master and slave, respectively.

// Relevant only in FOC mode with encoder enabled
if(m_conf.motor_type == MOTOR_TYPE_FOC &&
m_conf.foc_sensor_mode == FOC_SENSOR_MODE_ENCODER &&
encoder_spi_get_error_rate() > 0.05) {
mc_interface_fault_stop(FAULT_CODE_ENCODER_SPI);
}

Would say something with the communication between encoder and vesc does not work well, but have no idea :sweat_smile:
just what google found fo me.

1 Like

Somehow I never saw that from google search.

Maybe I will try bldc mode with encoder. Thanks for the info! @Andy87

1 Like

I just did look around a bit as I was interested for what SPI stands. I think I got it now, but still doesn’t tell me the what exactly can cause it. Good luck and please update it here if you found something out and got it work.

1 Like

The firmware now does parity checks on the SPI data. So its either bad signal or no connection on one of the spi lines.

Is there a particular reason why everyone uses the spi interface with these ams encoders? I find the incremental interface much more practical as it permits the use of long, unshielded wires as the frequency of the signal is much lower. The spi interface has 4x more resolution but both are plenty for spinning up a motor.

1 Like

I am using some adaptor cable for the encoder wires. Maybe that’s why?

I have a picture attached. I am still new to encoder stuff. But how do I change to incremental interface instead of spi?

1 Like

You just need to switch the Ck, Cs and MISO encoder connections over to A, B and I. Then in vesc tool set sensor port mode to encoder ABI and set steps per revolutiuon to the default for the sensor. I think its 4096.

Your cable in that pic looks a bit long. The SPI runs at something like 2 mhz which is quite fast. With the ABI interface at 2500 erpm your signal will only be about 5 khz.

1 Like

got it. I will try one more time with SPI mode and shorter cable. Because sometime it can detect and receive encoder results and most of the time it doesn’t. i will get rid of the extension white cable and plug straight in.

Does bad signals usually occur because the cables are too long and creating too much interference?

@Andy87 got the error off. Got rid of the white extension cable and it can detect and receive encoder results all the time I have tried.

@district9prawn SPI do need short cables lol

Please see the attached video. However i got a new problem…

One of the motor makes that strange noise when accelerating hard, only on one side of the motor, I have no idea where it’s from.

1 Like

Maybe it’s some misalignment in the gears and not the motor? I would open up the gear drive and have a look first.

1 Like

I don’t have gears or wheels on. Just motors. So nothing is really in the way…

But I switched two phase wires and the noise is gone. Why? I have no clue… :man_shrugging::man_shrugging::man_shrugging:

1 Like

How to install the encoders? I couldn’t find any detailed info regarding installation / setup and what to do.

Any pictures/videos that help?

@Andy87
@370HSSV

What a luck… I just had one in my hand while having dinner… :joy:

Check the data sheet on mouser

There is pretty much everything explained.

Basically it’s a magnet placed on the motor shaft front or back and the pcb with the sensor placed infront of it. You will need to bridge the pcb to 5V or 3.3V operating voltage and regarding this as well switch your vesc to 5v or 3.3v. 3.3v should help to get a more clear signal, but 5v works well too for most.
Very important to have a shielded sure to the vesc and try to hold the length as short as possible.
As far as I know it doesn’t work with hw4.12 vescs without some small soldering on the pcb, but vesc 6 based he should always support it.

Got pictures of installing one?

No. But you can search for as5047 in the old place. There should be some. Not hard to find as not much people did wrote something about it. Might ask @NoWind or @Duffman could have some pictures.