You are here

SK3 Turnigy 6374 149 / encoder CUI AMT102 => can VESC 4 support position control?

6 posts / 0 new
Last post
fourchette
Offline
Last seen: 3 years 3 days ago
Joined: 2018-11-07 19:29
Posts: 16
SK3 Turnigy 6374 149 / encoder CUI AMT102 => can VESC 4 support position control?

hello,

I have the following motor and quadrature encoder 

motor: areodrive turnigy SK3 6374 149
encoder: CUI AMT102 (it's a quadrature encoder with a 2048 * 4 ticks per revolution)

on a VESC 4 board

Can i get position control throught UART with this?

 

thanks

pf26
Offline
Last seen: 3 weeks 5 days ago
VESC FreeVESC Silver
Joined: 2018-12-04 08:44
Posts: 53

Yes. Beware you need up to one turn to have the encoder index found, and your absolute motor position is not determined until then.

fourchette
Offline
Last seen: 3 years 3 days ago
Joined: 2018-11-07 19:29
Posts: 16

perfect. this limitation is perfectly fine.

unfortunately i do not have my VESC 4 cards nearby, thus vesc_tool wont start its excellent motor config wizard

in previous setup i was using velocity control over UART using hall effect sensors and foc.

here looking i settings windows i see

Motor > General > General > Motor type > FOC (is it ok?)
Motor > General > General > Sensor Port Mode > ABI encoder / AS5047 encoder / AD2S1205 resolver (which one should i choose?) 
Motor > General > General > ABI encoder count > 8192 (looks like a 2048*4 so should be ok, can u confirm?)

Motor > FOC > General > Sensor Mode > Encoder 
Motor > FOC > Encoder > Encoder > Encoder Offset > 180.0 (should i keep this default value?)
Motor > FOC > Encoder > Encoder > Encoder Ratio > 7.0 (what is this?)
Motor > FOC > Encoder > Encoder > Encoder Inverted > False (what is this?)

Motor > PID Controllers > Position Controller > Kp / Ki / Kd / Kd Filter ==> please tell me i do not have to touch this and the wizzard will take care of it???
Motor > PID Controllers > Position Controller > Position Angle Division > 1.0 (what is this?)

in terms of cabling the encoder, is it like hall effect = dont care about how things are connected, because the wizzard will figure it out alone? or do i need to follow a particular convention?

Now for controlling the position, it seems the API is to talk in degrees instead of encoder counts (which is fine). So on principle issuing the following commands :

+360 makes the motor turns one complete revolution in positive direction
-720 makes the turns spin backwards 3 revolutions
0 makes spin forward 2 revolutions
0.5 makes the motor spin forward 0.5/360*8192 = 11 encoder ticks

==> ???

and what is the best way to make that single turn to have the encoder index found? (calibration i suppose)

 

(ok maybe there are too many questions here... but the i did not find enough explanations in the manual => https://vesc-project.com/node/180)

 

 

 

 

 

 

pf26
Offline
Last seen: 3 weeks 5 days ago
VESC FreeVESC Silver
Joined: 2018-12-04 08:44
Posts: 53

Motor > General > General > Motor type > FOC
Motor > General > General > Sensor Port Mode > ABI encoder
Motor > General > General > ABI encoder count > 8192

Cabling:  A, B and I (on Hall input 3)

Then please give it a try, and ask more questions if needed.  I fear position control is not multiturns (at least it wasn't at first) -  maybe it can be done with some parameters like position angle division ?

fourchette
Offline
Last seen: 3 years 3 days ago
Joined: 2018-11-07 19:29
Posts: 16

What???

Limited to single turns??

Can't be. What if there is a 30:1 gear reduction after motor?

We'll see. I'll try and report. Isn't VESC opensource? Maybe if default FW limits absolute positioning to single turn someone can add support for multiple turns?

pf26
Offline
Last seen: 3 weeks 5 days ago
VESC FreeVESC Silver
Joined: 2018-12-04 08:44
Posts: 53

I think someone already developed a multi-turn firmware patch: see https://vesc-project.com/node/626