cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with SW_MODE bit in CONFIG register

dmatsumoto
Associate II
Posted on July 01, 2014 at 01:11

I'd like to enable the HardStop interrupt (i.e. SW_MODE = 0) when I home my motor and then disable it afterward so that subsequent moves do not trigger the interrupt.  Enabling the interrupt before I start homing via GoUntil and ReleaseSW work fine.  I checked the STATUS and CONFIG registers to confirm that there aren't any fault conditions, and that the SW_MODE bit is cleared when I send my command to enable the hardstop interrupt.

Following any call to GoUntil or ReleaseSW, my command to set SW_MODE fails every time.  I get a NOTPERF_CMD error flag in the STATUS register and as expected, the SW_MODE bit is not set.

So far, the only way I can set SW_MODE is *after* I use any HiZ command that disables the bridges.  However, this is not what I want because the axis will drop when the bridges are disabled!

What is strange is that after homing, and after some unknown period of time, I can send a command to set SW_MODE and it doesn't result in a NOTPERF_CMD flag.

Can anyone recommend strategies for determining why I'm getting NOTPERF_CMD immediately after GoUntil or ReleaseSW?

#notperf_cmd #l6470 #sw_mode
2 REPLIES 2
Enrico Poli
ST Employee
Posted on July 07, 2014 at 09:43

Hi,

the CONFIG register is ''protected'' and you cannot write it if the power stage is enabled (see datasheet).

In order to obtain the behavior you described you could detect the SW falling-edge using the FLAG output as an interrupr and send an HardStop command when the event is detected.

Regards

Enrico

dmatsumoto
Associate II
Posted on July 08, 2014 at 15:21

Thank you for your response, Enrico.  That's basically what I figured was the problem, but what confused me was that elsewhere in the tests that I run, I'm able to drive the motor past the limit switch, which means that the SW_MODE was disabled at some point... but if the bridges were disabled, the axis would have fallen, and that didn't happen.  I'll look into it some more!