You are here

SPI Encoder communications with AS5047

4 posts / 0 new
Last post
vadimz
Offline
Last seen: 1 year 8 months ago
Joined: 2018-08-29 17:30
Posts: 17
SPI Encoder communications with AS5047

Hi all,

 

Couple of questions on dealing with AS5047 encoder :

1. Why the SPI protocol is implemented in software ? It seems that this MCU has hardware SPI module, what am I missing ?

2. When encoding reading fails (I simulate it by disconnecting P1), the motor current shoots al the way to maximum and stays there until motor overheats. It would probably be safer to brake the motor in this condition. Did anyone tried making this change already ?

 

Thanks in advance,

vadimz
Offline
Last seen: 1 year 8 months ago
Joined: 2018-08-29 17:30
Posts: 17

I'm now making a modified FW version that will raise a fault when encoder communication is broken.  Can make a pull request when ready, if there's interest.

petertaylor
Offline
Last seen: 4 months 1 week ago
VESC Free
Joined: 2018-02-19 07:01
Posts: 18

I'm interested in this. I used this series of sensors because they were compatible with the vesc, but ended up using them for external (to the vesc) rpm measurements. I'm glad you're working on this Vadimz! Not sure i can add anything other than cheering from the sidelines as yet.

Guillaume227
Offline
Last seen: 2 years 7 months ago
Joined: 2017-09-11 09:56
Posts: 3

Hi Vadimz,

I came upon your post wondering about the same thing.

My understanding is that SPI is implemented in software to gain flexibility in the SPI pin configuration : either reuse the Hall sensor pins (with no MCU SPI support) or dedicated MCU SPI pin set.

See the AS5047_USE_HW_SPI_PINS #ifdef.