Os6.6 false clashes and stab sound and effects

That’s encouraging. I still don’t understand why this is happening though.
I’ll have to look over the code again, maybe there is a bug somewhere… (Or maybe there is a bug in the chip itself…)

I’d like to see what happens when you move the PROFFIEOS_ACCELEROMETER_RANGE back up, keeping everything else the same. Maybe test at 8 and 16? See if there’s a point where the false clashes return or if you can get back to 16 maybe there’s still something else different since the master branch has other fixes and things in place as well. Seeing as it’s still not something we’re able to replicate on most sabers it’d be nice to actually confirm this was the cause.

As a side-note you can probably lower the clash threshold because there’s a default AUDIO_CLASH_SUPPRESSION_LEVEL applied if you don’t have the define, so it is still helping.

12 is not a valid range, only 2, 4, 8 and 16.
It would be interesting to try different ranges and see what happens though.

1 Like

Ah, noted. Edited previous post.

Updated ACCELEROMETER_RANGE to 8, and kept everything else the same.

#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 2700
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 2.2
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define IDLE_OFF_TIME 60*5*1000
#define MOTION_TIMEOUT 60 * 15 * 1000
#define DISABLE_DIAGNOSTIC_COMMANDS
#define ENABLE_SPINS
#define NO_REPEAT_RANDOM
#define FILTER_CUTOFF_FREQUENCY 50
#define FILTER_ORDER 8
#define PROFFIEOS_ACCELEROMETER_RANGE 8
//#define AUDIO_CLASH_SUPPRESSION_LEVEL 16
#endif

//#ifdef CONFIG_PROP
//#include "../props/saber_fett263_buttons.h"
//#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {

This one felt the most natural to me. Was able to do normal clashes again, and it wasnt that hard to trigger them. I still had very minor false clashes, but only when doing blaster-blocks…and it was so minor it was like 1 out of every 14 blaster blocks did it. Gonna try to up the ACCELEROMETER_RANGE again and see what happens

1 Like

updating the ACCELEROMETER_RANGE to 16 made it worse. False clashes came back during both blaster-blocks, and ignitions. Still works better than the normal 6.7OS thats out, and certainly better than using the Audio_Clash_Suppression_Level in the config…but not as perfect as the ol’ days of OS5.9

UPDATE: Moved the ACCELEROMETER_RANGE back to 4 (with a CLASH_THRESHOLD_G 2.2), and this is the sweetspot to not have any false clashes at all. However trying to trigger a normal clash is tedious, and requires a pretty good, hard hit/smack on the saber hilt or blade

after a few edits and re-uploads…The sweet spot for this seems to be ACCELEROMETER_RANGE at 8, and CLASH_THRESHOLD_G to 2.8 - 3.0. This now works as intended (or close enough) with these settings.

I’m going to write some code that measures and quantifies the noise in the accelerometer data, then we can try it out with different ranges and see if that explains what’s going on here.

1 Like

Ok, we have another tool for analyzing what’s going on with the accelerometer data:

#define FUSOR_VARIANCE

To use it, you will need the latest ProffieOS from github master. In addition to the FUSOR_VARIANCE you will also need the ENABLE_DEVELOPER_COMMANDS define to enable the dumpfusor command.

After doing all that, dumpfusor will show some additional data:

 VARIANCE=0.00003714, 0.00001779, 0.00002074 STDDEV=0.00609451, 0.00421824, 0.00455438

This is with the board laying still and no speaker, so the values are very low.
For flash clashes to occur, the standard deviation has to be much bigger.

The interesting question is whether the accelerometer range affects the standard deviation or not. I need some help testing this.

Please note that dumpfusor just dumps the “right now” state, which includes 20 vaues (or 1/80th of a second) so we might need to run it a bunch of times to find anything out.

Also, depending on what prop and defines you use, the accelerometer might be off when the saber is off, in which case dumpfusor would not show anything helpful.

1 Like

Downloading the new master from GIthub and gonna try this now…

For some reason this new github Master doesnt want to compile…

Arduino: 1.8.13 (Windows 10), Board: "Proffieboard V2, Serial, SDCARD (SPI), 80 MHz, Smallest Code"

In file included from C:\Users\BK\Desktop\GitHUb6.7-Testing\ProffieOS\ProffieOS.ino:1344:

sketch\common/serial.h:135:57: error: missing terminating " character

  135 |         STDOUT << "Welcome to ProffieOS " << version << "\n;

      |                                                         ^~~~

In file included from C:\Users\BK\Desktop\GitHUb6.7-Testing\ProffieOS\ProffieOS.ino:232:

sketch\common/stdout.h: In instantiation of 'static void PrintHelper<T, X>::out(Print&, T&) [with T = ConsoleHelper; X = void]':

sketch\common/stdout.h:55:24:   required from 'ConsoleHelper& ConsoleHelper::operator<<(T) [with T = ConsoleHelper]'

sketch\common/serial.h:135:54:   required from 'void Parser<SA>::Loop() [with SA = SerialAdapter]'

sketch\common/serial.h:130:8:   required from here

sketch\common/stdout.h:29:37: error: no matching function for call to 'Print::print(ConsoleHelper&)'

   29 |   static void out(Print& p, T& x) { p.print(x); }

      |                                     ^

In file included from C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Stream.h:26,

                 from C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/HardwareSerial.h:24,

                 from C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Arduino.h:108,

                 from C:\Users\BK\Desktop\GitHUb6.7-Testing\ProffieOS\ProffieOS.ino:155:

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:57:12: note: candidate: 'size_t Print::print(const __FlashStringHelper*)'

   57 |     size_t print(const __FlashStringHelper *);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:57:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'const __FlashStringHelper*'

   57 |     size_t print(const __FlashStringHelper *);

      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:58:12: note: candidate: 'size_t Print::print(const String&)'

   58 |     size_t print(const String &);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:58:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'const String&'

   58 |     size_t print(const String &);

      |                  ^~~~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:59:12: note: candidate: 'size_t Print::print(const char*)'

   59 |     size_t print(const char[]);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:59:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'const char*'

   59 |     size_t print(const char[]);

      |                  ^~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:60:12: note: candidate: 'size_t Print::print(char)'

   60 |     size_t print(char);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:60:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'char'

   60 |     size_t print(char);

      |                  ^~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:61:12: note: candidate: 'size_t Print::print(unsigned char, int)'

   61 |     size_t print(unsigned char, int = DEC);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:61:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'unsigned char'

   61 |     size_t print(unsigned char, int = DEC);

      |                  ^~~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:62:12: note: candidate: 'size_t Print::print(int, int)'

   62 |     size_t print(int, int = DEC);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:62:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'int'

   62 |     size_t print(int, int = DEC);

      |                  ^~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:63:12: note: candidate: 'size_t Print::print(unsigned int, int)'

   63 |     size_t print(unsigned int, int = DEC);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:63:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'unsigned int'

   63 |     size_t print(unsigned int, int = DEC);

      |                  ^~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:64:12: note: candidate: 'size_t Print::print(long int, int)'

   64 |     size_t print(long, int = DEC);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:64:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'long int'

   64 |     size_t print(long, int = DEC);

      |                  ^~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:65:12: note: candidate: 'size_t Print::print(long unsigned int, int)'

   65 |     size_t print(unsigned long, int = DEC);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:65:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'long unsigned int'

   65 |     size_t print(unsigned long, int = DEC);

      |                  ^~~~~~~~~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:66:12: note: candidate: 'size_t Print::print(double, int)'

   66 |     size_t print(double, int = 2);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:66:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'double'

   66 |     size_t print(double, int = 2);

      |                  ^~~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:67:12: note: candidate: 'size_t Print::print(const Printable&)'

   67 |     size_t print(const Printable&);

      |            ^~~~~

C:\Users\BK\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4/Print.h:67:18: note:   no known conversion for argument 1 from 'ConsoleHelper' to 'const Printable&'

   67 |     size_t print(const Printable&);

      |                  ^~~~~~~~~~~~~~~~

exit status 1

Error compiling for board Proffieboard V2.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Heres the main config, in which i also commented out the FUSOR and DEVELOPER thinking that was causing the issue, but its not…

#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 2700
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 2.9
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define IDLE_OFF_TIME 60*5*1000
#define MOTION_TIMEOUT 60 * 15 * 1000
//#define DISABLE_DIAGNOSTIC_COMMANDS
#define ENABLE_SPINS
#define NO_REPEAT_RANDOM
#define FILTER_CUTOFF_FREQUENCY 50
#define FILTER_ORDER 8
#define PROFFIEOS_ACCELEROMETER_RANGE 8
//#define FUSOR_VARIANCE
//#define ENABLE_DEVELOPER_COMMANDS
//#define AUDIO_CLASH_SUPPRESSION_LEVEL 16
#endif

//#ifdef CONFIG_PROP
//#include "../props/saber_fett263_buttons.h"
//#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {

@profezzorn Looks like a missed " in the last commit.

@BK_Saber open common/serial.h make below change and it should fix the error (I think).

STDOUT << "Welcome to ProffieOS " << version << "\n;

should be

STDOUT << "Welcome to ProffieOS " << version << "\n";

My bad, sorry. Fix submitted

ok, went in and edited that file, the compile now works, no errors.

So my dumb question is, where does one go look at the FUSOR_VARIANCE data? I didnt see anything in serial monitor for that

In the output of the dumpfusor command.

this is what i have with the saber OFF…and PROFFIEOS_ACCELEROMETER_RANGE set to 8

gyro extrapolator data:
 START=66552699 samples=20 S(t^2)=ovf sum={23.50, 7.81, -70.80} S(.)={3591494.00, 1185105.62, -10804748.00}
 start_copy=66552699 avg={1.17, 0.39, -3.54} slope={0.00, -0.00, -0.00} avg_t=152602.50
 VARIANCE=0.05641887, 0.36758789, 0.02704500 STDDEV=0.23752657, 0.60629028, 0.16445364
 66703169  {1.16, 1.65, -3.42}
 66703778  {1.65, -0.55, -3.17}
 66704388  {0.98, 0.85, -3.48}
 66704997  {1.04, 0.31, -3.54}
 66705606  {1.16, -0.31, -3.66}
 66706215  {1.22, 1.10, -3.66}
 66706824  {1.10, -0.37, -3.72}
 66707434  {1.46, -0.12, -3.72}
 66708043  {1.22, 0.49, -3.42}
 66708652  {1.10, -0.37, -3.48}
 66709261  {1.22, 0.67, -3.42}
 66709871  {1.04, 0.37, -3.36}
 66710480  {1.83, 0.18, -3.60}
 66711089  {1.04, 0.79, -3.72}
 66699514  {1.22, 0.00, -3.66}
 66700124  {0.85, 1.16, -3.42}
 66700732  {0.85, 0.55, -3.54}
 66701342  {1.10, 0.49, -3.60}
 66701951  {1.10, 1.10, -3.85}
 66702560  {1.16, -0.18, -3.36}
 ready=1

Should i also ignite it and/or and get more data on different PROFFIEOS_ACCELEROMETER_RANGE other than 8?

That’s the second half of the dumpfusor output, which only shows the gyro data, not the accelerometer data.

I don’t know if your gyro/acelerometer runs while the saber is off or not, it depends on your prop. However, I think the data might be more interesting when the saber is on, assuming that’s when you get false clashes.

Ideally, run the dumpfusor command multiple times, then take the first VARIANCE line from each run, and just paste that.

heres multiple runs with saber ON and PROFFIEOS_ACCELEROMETER_RANGE set to 8:

 VARIANCE=0.02259021, 0.00033205, 0.00334338 STDDEV=0.15030038, 0.01822236, 0.05782198
VARIANCE=0.03417342, 0.00045671, 0.00651244 STDDEV=0.18486054, 0.02137076, 0.08069970
VARIANCE=0.03006468, 0.00265209, 0.00525881 STDDEV=0.17339170, 0.05149848, 0.07251766
VARIANCE=0.00967232, 0.00049059, 0.00440171 STDDEV=0.09834795, 0.02214927, 0.06634538

Those values are quite high compared to mine.
I’m very curious to see how they change when you change accelerometer range though.

1 Like

It might also be interesting to try set_volume 0 in the serial monitor and see if the variance changes.

1 Like