You are here

Questions about encoder on vesc 6

9 posts / 0 new
Last post
willyfan
Offline
Last seen: 8 months 4 weeks ago
Joined: 2018-01-04 14:14
Posts: 7
Questions about encoder on vesc 6

I want try use encoder on my VESC, in order to improve low speed (I'm using it on a cablecam). But I have I have a lot of doubts, and I do not find many answers.

I will make a list of the questions, hoping that they can also serve others in the future.

1) I read everywhere about encoder AS5047p. Many people tried other encoder (like AS5048A or AS5047D) but they have some problem, like that the VESC don't read all bit and need to compile a firmware for fix it. Actually is not easy to find the AS5047p, expecially with board. I found some IC and I'm designing a board, but there is many others encoder with similar performance (Ak7452 to say one). Question is, What features must exactly have an encoder to work well with VESC? SPI? ABI? Why around the web all people speak about at AS5047p only?

2) Many people connected the encoder in SPI, some others people speak about ABI. Whats is better?

3) And, I'm using a Vesc 6 from flipsky. In order to use the encoder, need it modification to the input (remove filter -  I found this info only about old hardware)?

4) If I don't want modify the VESC, canI use other input, using standard firmware? Or in some way?

5) Modification is needed only for SPI or for ABI, too?

Than you in advance for for help.

Danny Bokma
Offline
Last seen: 10 hours 20 min ago
VESC FreeVESC Original
Joined: 2017-05-24 12:11
Posts: 53

Hi Willy,

They are normally on stock at mouser and digikey, but they run out of them I see. I think the AS5047D would work as well. Where are you located? I can maybe send you a board.

Last week and thus with the most recent version of the VESC and VESC Tool I got the AS5047 to work on a 4.12ESC, it works perfectly.

AS5047 should be connected trough SPI, is has a higher resolution and has no chance of accumulating drift when you stay around the same location (without a full rotation) for long.

To use the AS5047 you have to remove the input filters (on 4.12 at least, don't exactly know about the 6hw), there is no alternative port (you could go for a regular encoder but the AS5047 is smooth as butter and I doubt that a regular encoder could beat that). 

As far as I know the modification is only needed for SPI.

 

willyfan
Offline
Last seen: 8 months 4 weeks ago
Joined: 2018-01-04 14:14
Posts: 7

Thank you for your answer.

I'm in Italy, but don't worry: I designed a board and I waiting for expedition from manufacturer. In some days I will have some encoder for test. i found the AS5047p, but at digikey have only some pieces and no board, only the chip   (I bought it a digikey anyway...).

I'll explain the reasons for my questions and I'll put the links, because on the web you read everything and you never know if the infos are reliable.

I asked about other encoder because searching on the web, I found that someone had problem  with AS5047D and AS5048A (in SPI mode). Problem is that they read only 180°, and error is one bit don't read. There is a suggest in order to modify the firmware using only 13 bits, but if I can use regular fw is better. http://vedder.se/forums/viewtopic.php?t=72

About SPI and ABI, In some forum somone tell me that SPi have some latency, more then ABI https://discourse.odriverobotics.com/t/magnet-encoders/337?u=madcowswe

Maybe because SPI is simulated and not hardware? There is also a modification to the fw for use another port for SPI ( I think the controller port) that is hardware serial port. Using this port don't need modification to the hardware but to the firmware. https://hackaday.io/project/72497/logs?sort=oldest&page=4 . 

About the input filter, I will ask to frsky because I'm not sure if also vesc 6 need the modification, i don't know where are the component to remove, I will investigate.

Thank you again

district9prawn
Offline
Last seen: 19 hours 31 min ago
VESC Free
Joined: 2018-04-26 12:18
Posts: 72

If you have version 6 hardware, there should be no filters on the pcb. Filtering is done in software. 

The latest firmware should work fine with SPI providing 14 bit resolution without issues. Although I've personally only tried as5048a. I'm sure ABI or SPI will work fine provided your mechanical rpm is not crazy high. According to the data sheet both SPI and ABI benefit from some latency compensation. The pwm output apparently doesn't have latency compensation. SPI has a higher data rate so you will need to make sure signal quality is good. 

VirtB
Offline
Last seen: 1 year 10 months ago
Joined: 2018-08-27 21:44
Posts: 4

willyfan,

I am also using a flipsky V6 board and encoder AMT102 and also having difficulties. My application is also cable pull ( - a winch ) and I need smooth low speed performance, eventually a multi-turn position encoder.

flipky told me to remove the 2K2 pull-up resistors on the Hall inputs, which I did and that allowed me to detect the encoder. I can run with BLDC motor or with FOC but only with duty cycle control. As soon as I try a PID speed control it locks up. Perhaps you can help me. So far I have not attempted firmware changes.

Bruno

 

Bruno

willyfan
Offline
Last seen: 8 months 4 weeks ago
Joined: 2018-01-04 14:14
Posts: 7

Thanks to all. good news are that I don't need to remove filters, I have a V6 hardware. i will try it.

Also a good news about issued fixed about bits. My RPM is not very hight because I'm using slow motors (190- 270 KV). I have, with my 6s battery a max ERPM at around 35.000. Also with 8s (max battery  I can use with this motors) maybe I will arrive to 50.000 ERPM, around 8000 RMP mechanical.

@ Bruno: tell my how I can help you. Where are you? In some days I will have some encoders AS5047D with board, dif you want it, but maybe the expedition can be expensive.

Enak
Offline
Last seen: 2 weeks 3 days ago
VESC OriginalVESC Platinum
Joined: 2017-06-29 19:52
Posts: 20

I'm using the AS5047P-TS_EK_AB which works great in SPI.  Make sure you use twisted pair cable otherwise it does not work well.

On VESC 4 hardware you need to remove the filters but VESC 6 hardware requires no modification.

You can fit an 8 way JST XH connector to the dev board which makes connection easy.

IMG_20180106_153432.jpg

willyfan
Offline
Last seen: 8 months 4 weeks ago
Joined: 2018-01-04 14:14
Posts: 7

Good news. Now I'm building the encoder on a custom made board, little and circular. I will try in some days. 

Henriwivani
Offline
Last seen: 1 year 8 months ago
Joined: 2018-08-30 09:09
Posts: 1

Hi!

I'm working with an AS5047D Board and was wondering why you had wired the MOSI pin to the 5V jumper? 

I have seen a couple examples including on the rover project (See picture) where this hasn't been done.

Are there any noted changes in performance/reliability between the 3.3V and 5V modes?

If anyone could clarify for me that'd be great. It's my first try doing anything like this so sorry if somethings gone over my head.

 

Henri