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!
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
just what google found fo me.
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.
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.
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.
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?
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.
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.