[FXOS8700] Transient Detection troubles

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[FXOS8700] Transient Detection troubles

2,175 Views
Ruig25
Contributor I

Hello!

I know, that the sensor is a little bit old, but nevertheless.

I have one application case and I still cannot solve a problem with transient detection. Of course I have read all App. Notes.

 

Use case description:

  • Sensor board attached to the wrist so that x-axis is along the arm (if we stretch index finger - the x-axis and the finger are +/- parallel).
  • The arm is on the rest (Xg =~ -250mg). It is initial position.
  • Now the stretched arm will be rosen slightly above the head (Xg =~ 300-350mg).
    X and Z axes are ignored (out of interest).
  • I want to have an interrupt after hand was rosen as described above.


Here is described motion (ODR=100Hz)

2023-05-28 22_15_16-Window.png

 

My first idea was to use vector-magnitude detection. But I did't tried it because I don't have constant Gref (initial position may have some variiations...).

The second idea - motion or transient detection.


Code (abstract):

  1. software rest + 1ms wait
  2. Standby CTRL_REG1=0x0
  3. Fullscale 2g XYZ_DATA_CFG=0x0
  4. Clr debounce counter and set ths to 5 (5x63mg=315mg) TRANSIENT_THS=0b10000101
  5. TRANSIENT_COUNT=6
  6. X only + evt latching TRANSIENT_CFG=0b00010010
  7. Enable transient interrupt CTRL_REG4=0b0010000
  8. Route transient interrupt to int1 CTRL_REG5=0b00100000
  9. Active mode, ODR 12,5Hz, Low Noise CTRL_REG1=0b00101101

Interrupt event triggered non-stop. I tried many different values for 4) and 5).

uC input IO configured for neg. edge with enabled pull-up.

I tried to move 6) after 3) like here. No interrupt triggered at all.

I tested circuit enabling FIFO watermark interrupt. Works without problems.

 

Any ideas?

Or motion detection is more suitable in my case?

 

Many thanks in advance

Tags (1)
0 Kudos
2 Replies

2,119 Views
JozefKozon
NXP TechSupport
NXP TechSupport

Hello Igor, 

for your case, I think the best would be the "Acceleration vector-magnitude detection". Please refer to the section 12.10 in the FXOS8700CQ datasheet and to the AN4692.

JozefKozon_0-1685354985792.png

With Best Regards,

Jozef

 

0 Kudos

2,122 Views
Ruig25
Contributor I

After 10h of investigation:

It seems that threshold set in TRANSIENT_THS is ignored. Therefore interrupt fired non-stop (fallback threshold 0mg?).

But after enabling a_ffmt_trans_ths_en=1 in A_FFMT_THS_Y_MSB the system started to work correctly.

Axis of interest is X.
And I didn't expect to use invidual thresholds per axis. But it works now.

%3CLINGO-SUB%20id%3D%22lingo-sub-1658766%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%5BFXOS8700%5D%20Transient%20Detection%20troubles%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1658766%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3EI%20know%2C%20that%20the%20sensor%20is%20a%20little%20bit%20old%2C%20but%20nevertheless.%3C%2FP%3E%3CP%3EI%20have%20one%20application%20case%20and%20I%20still%20cannot%20solve%20a%20problem%20with%20transient%20detection.%20Of%20course%20I%20have%20read%20all%20App.%20Notes.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3EUse%20case%20description%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3ESensor%20board%20attached%20to%20the%20wrist%20so%20that%20x-axis%20is%20along%20the%20arm%20(if%20we%20stretch%20index%20finger%20-%20the%20x-axis%20and%20the%20finger%20are%20%2B%2F-%20parallel).%3C%2FLI%3E%3CLI%3EThe%20arm%20is%20on%20the%20rest%20(Xg%20%3D~%20-250mg).%20It%20is%20initial%20position.%3C%2FLI%3E%3CLI%3ENow%20the%20stretched%20arm%20will%20be%20rosen%20slightly%20above%20the%20head%20(Xg%20%3D~%20300-350mg).%3CBR%20%2F%3EX%20and%20Z%20axes%20are%20ignored%20(out%20of%20interest).%3C%2FLI%3E%3CLI%3EI%20want%20to%20have%20an%20interrupt%20after%20hand%20was%20rosen%20as%20described%20above.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3EHere%20is%20described%20motion%20(ODR%3D100Hz)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222023-05-28%2022_15_16-Window.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222023-05-28%2022_15_16-Window.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225108i08D3C1452B17097C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222023-05-28%2022_15_16-Window.png%22%20alt%3D%222023-05-28%2022_15_16-Window.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMy%20first%20idea%20was%20to%20use%20vector-magnitude%20detection.%20But%20I%20did't%20tried%20it%20because%20I%20don't%20have%20constant%20Gref%20(initial%20position%20may%20have%20some%20variiations...).%3C%2FP%3E%3CP%3EThe%20second%20idea%20-%20motion%20or%20transient%20detection.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3ECode%20(abstract)%3A%3C%2FSTRONG%3E%3C%2FP%3E%3COL%3E%3CLI%3Esoftware%20rest%20%2B%201ms%20wait%3C%2FLI%3E%3CLI%3EStandby%26nbsp%3B%3CSPAN%3ECTRL_REG1%3D0x0%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EFullscale%202g%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EXYZ_DATA_CFG%3D0x0%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EClr%20debounce%20counter%20and%20set%20ths%20to%205%20(5x63mg%3D315mg)%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ETRANSIENT_THS%3D0b10000101%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3ETRANSIENT_COUNT%3D6%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EX%20only%20%2B%20evt%20latching%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ETRANSIENT_CFG%3D0b00010010%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EEnable%20transient%20interrupt%26nbsp%3B%3CSPAN%3ECTRL_REG4%3D0b0010000%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CSPAN%3ERoute%20transient%20interrupt%20to%20int1%26nbsp%3BCTRL_REG5%3D0b00100000%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CSPAN%3EActive%20mode%2C%20ODR%2012%2C5Hz%2C%20Low%20Noise%26nbsp%3BCTRL_REG1%3D0b00101101%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CSPAN%3E%3CSPAN%3EInterrupt%20event%20triggered%20non-stop.%20I%20tried%20many%20different%20values%20for%204)%20and%205).%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EuC%20input%20IO%20configured%20for%20neg.%20edge%20with%20enabled%20pull-up.%3C%2FP%3E%3CP%3EI%20tried%20to%20move%206)%20after%203)%20like%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FSensors%2FFXOS8700-accel-transient-threshold-resolution-in-per-axis-mode%2Fm-p%2F354855%2Fhighlight%2Ftrue%23M1047%22%20target%3D%22_self%22%3Ehere%3C%2FA%3E.%20No%20interrupt%20triggered%20at%20all.%3C%2FP%3E%3CP%3EI%20tested%20circuit%20enabling%20FIFO%20watermark%20interrupt.%20Works%20without%20problems.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAny%20ideas%3F%3C%2FP%3E%3CP%3EOr%20motion%20detection%20is%20more%20suitable%20in%20my%20case%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMany%20thanks%20in%20advance%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1659105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20%5BFXOS8700%5D%20Transient%20Detection%20troubles%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1659105%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Igor%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3Efor%20your%20case%2C%20I%20think%20the%20best%20would%20be%20the%20%22Acceleration%20vector-magnitude%20detection%22.%20Please%20refer%20to%20the%20section%2012.10%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fdata-sheet%2FFXOS8700CQ.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFXOS8700CQ%20datasheet%3C%2FA%3E%20and%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN4692.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAN4692%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JozefKozon_0-1685354985792.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JozefKozon_0-1685354985792.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225200i4CF2C17BBD5E6EFB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JozefKozon_0-1685354985792.png%22%20alt%3D%22JozefKozon_0-1685354985792.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWith%20Best%20Regards%2C%3C%2FP%3E%0A%3CP%3EJozef%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1659023%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20%5BFXOS8700%5D%20Transient%20Detection%20troubles%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1659023%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAfter%2010h%20of%20investigation%3A%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20seems%20that%20threshold%20set%20in%26nbsp%3B%3CSTRONG%3ETRANSIENT_THS%26nbsp%3B%3C%2FSTRONG%3Eis%20ignored.%20Therefore%20interrupt%20fired%20non-stop%20(fallback%20threshold%200mg%3F).%3C%2FP%3E%3CP%3EBut%20after%20%3CEM%3Eenabling%26nbsp%3Ba_ffmt_trans_ths_en%3D1%3C%2FEM%3E%20in%26nbsp%3B%3CSTRONG%3EA_FFMT_THS_Y_MSB%3C%2FSTRONG%3E%20the%20system%20started%20to%20work%20correctly.%3C%2FP%3E%3CP%3EAxis%20of%20interest%20is%20X.%3CBR%20%2F%3EAnd%20I%20didn't%20expect%20to%20use%20invidual%20thresholds%20per%20axis.%20But%20it%20works%20now.%3C%2FP%3E%3C%2FLINGO-BODY%3E