AnsweredAssumed Answered

AD-FMCMOTCON1-EBZ MathWorks FOC IP controller will not go into closed loop mode

Question asked by nick.wernicke@gmail.com on Nov 14, 2014
Latest reply on Nov 24, 2014 by ACozma

Hello! I am having better luck with my AD-FMCMOTCON1-EBZ, but I have gotten stuck again while trying to use the matlab controller in closed loop mode.

I followed the instructions to build the bootable SD card and update it to the lastest software using Zynq Quick Start Guide [Analog Devices Wiki]

 

I followed the instructions at the end of

AD-FMCMOTCON1-EBZ IIO User Guide [Analog Devices Wiki]

 

The script seems to get stuck while calibrating the encoder offset. It shows $OFFSET_DEC '/' $OFFSET_ERR, and $OFFSET_DEC keeps decreasing, or sometimes it increases. But it just keeps going and never seems to be satisfied. How do I fix it? Does the matlab closed loop controller require the optical encoder?

 

Here is the output of the script:

root@linaro-ubuntu-desktop:/usr/local/bin# ./foc_script.sh

Initializing the FOC controller...

w: reg[0x100] = 0x3

w: reg[0x120] = 0x0

w: reg[0x104] = 0x61a8

w: reg[0x118] = 0x0

w: reg[0x11c] = 0x51f

FOC controller initialized. Select Run in IIO Scope and hit Enter to continue.

 

 

Calibrating the encoder offset...

OFFSET1: -2899

w: reg[0x120] = 0xb53

ERR1: 77177

OFFSET2: -2399

w: reg[0x120] = 0x95f

ERR2: 52578

KEEP THE SAME OFFSET SEARCH DIRECTION

w: reg[0x120] = 0x92d

OFFSET / OFFSET ERR: -2349 / 1832

w: reg[0x120] = 0x8fb

OFFSET / OFFSET ERR: -2299 / 52054

w: reg[0x120] = 0x8c9

OFFSET / OFFSET ERR: -2249 / 5148

w: reg[0x120] = 0x897

OFFSET / OFFSET ERR: -2199 / 60239

w: reg[0x120] = 0x865

OFFSET / OFFSET ERR: -2149 / 12596

w: reg[0x120] = 0x833

OFFSET / OFFSET ERR: -2099 / 69003

w: reg[0x120] = 0x801

OFFSET / OFFSET ERR: -2049 / 21848

w: reg[0x120] = 0x7cf

OFFSET / OFFSET ERR: -1999 / 77190

w: reg[0x120] = 0x79d

Outcomes