Most chassis today have a good pressure fit for speakers I use the eco KR chassis for my saber no glue needed really. Unless you glue the speaker for extra reinforcement? Either way for speaker glue or not if chassis is designed for pressure fitting for speaker, should not give me that problem. I’ll try using those clear color tape use for electronic s for the board. The board is glued with e6000 already but doesn’t hurt to try.!
My JuanSith Vader font is very bassy. So I’ve lowered the Valume from 1800 to 1600. Hopefully the defines you give will solve it. The two defines that you just gave #define FILTER_CUTOFF_FREQUENCY 100
#define FILTER_ORDER 8 , does matter where I place them in the config top section or does it not? Let me know thank thank
No, as long as the defines are in the CONFIG_TOP section of your config, order doesn’t matter but you can group together with the related defines to make it more organized.
I’m a little late to the party but that’s great news! I don’t currently have a proffie saber installed but will soon and will test! I have more time now that I’m out of school for the summer!
I’ve given this a bit of a test on my Sabertrio Arclyte which had this issue - I’d get clashes, stabs, even melts when I turned it on. I’ve had the Clash Threshold set as high as 4 and the issue was the same.
This define seems to solve that issue, but I’m now having issues activating clashes. They seem to work as intended when I hit the hilt, but I cannot activate a clash at all if I hit the blade. This is using:
Audio Clash Suppression: 15
Clash Threshold: 1.5
I did some more testing - this was mostly using the Staple Sword font by Kyberphonic. I had to take Audio Clash Suppression down to 5 in order to get clashes to register on the blade, with a Clash Threshold of 1.9.
I tested some other fonts that were on my saber too using the same settings, and the results vary a lot by font:
Kyberphonics
Staple - works fine
Little Green Friend - works fine
Return - difficult to get a clash on the blade
The Repulsor Fist - works fine
ESB Graflex - works fine
Outcast Knight - phantom clash/stab on ignition
TFA Graflex - works fine
Code Fulcrum - works fine
Father - difficult to get a clash on the blade
The Tragedy - phantom clash/stab on ignition AND difficult to get a clash on the blade
Second Sister - works fine
Violence - phantom clash/stab on ignition
Temple Guardian - works fine
KSith
Final Steps - phantom clash/stab on ignition
Lord Blako
Mantle of the Force - works fine
I hope this is useful in some way!
Did you try these,
Fonts that are louder by nature will require harder clashes due to how the AUDIO_CLASH_SUPRESSION_LEVEL works, these additional defines may help to bring those louder fonts in line but you’ll want to test changing all the defines involved to find the right mix for your saber. In addition, making sure you chassis is supported well can help.
So this is my current test:
Running a 89 Sabers Fallen saber, 22mm speaker, OS 6.7. KSith Savage font.
I find that anything over clash threshold of 3 means I have to strike the blade too hard so I keep it at 2.5.
Tried audio clash suppression from 20-50. Seems best between 40-50. Anything lower than that will cause a lot more false clashes. For the test have kept it at 50.
Added 2 defines
#define FILTER_CUTOFF_FREQUENCY 100
#define FILTER_ORDER 8
Again - lots of false clashes with quotes.
So I started lowering the max volume in 100 increments and this is what I found:
Max Vol. Number of false clashes per cycle of quotes
1000 1
1100 1
1200 1
1300 2
1400 1
1500 2
1600 3
1700 3
1800 5
1900 4
2000 4
So it seems like the sweet spot is Volume 1400-1500, clash threshold 2.5-3.0, suppression 40-50.
It is a little disappointing to have to sacrifice so much volume or have to raise clash threshold too high. Raising it to 5 essentially eliminates all false clashes but it becomes impossible to elicit a regular clash.
If it’s only quotes (or specific sound files) causing how about adjusting the volume of the quotes themselves in Audacity?
If a sound is simply too loud for your board/chassis set up maybe replace or adjust said file.
Unfortunately it is not one specific sound font, but there are certainly some that are worse than others. This was the “worst” of all on my config, so I chose it to run the test.
Ok, then you’re probably limited in the volume you can run on that saber. TBH I still never experience false clashes on any of my sabers so its definitely specific to the saber and/or fonts you run. There’s only so much we can account for with the defines unfortunately.
Yes, I absolutely agree. It’s a combination of speaker size/physical factors (distance from Proffie board, sound insulation and resonance chamber), fonts and to some extent the defines. The defines you provided have been extremely helpful on another saber (Graflex which can now run a volume of 2100 at a clash threshold of 2.5 with 0 false clashes - this was impossible before). However with the Fallen saber, there are more limitations probably due to a 22mm vs 31mm speaker. Thank you very much for all your help anyway. It’s much appreciated!
I was recently exploring how ways to figure out where on the blade a clash occurred. Unfortunately my exploration did not yield any results. However, maybe I should focus on making a better clash detector instead. I could use the clash recorder to record real and fake clashes, then try to see if I can tell the difference somehow.
I just started playing around with this on my “daily beater” saber and I was able to reduce my clash threshold from 7.5 to 4.5 which I think provides a noticable improvement in clash sensitivity.
Note, when I go from 6 to 10 for AUDIO_CLASH_SUPPRESSION_LEVEL with clash threshold at 4.5, I feel like there is a sizable decrease in the sensitivy of the saber to the point were it is less sensitive than it was at 7.5 without audio clash suppression. Just an intersting observation about the relationship of these different settings to one another.
I still need to play with different setting combinations to see if I can further optimize it, but overall so far so good. Nice improvement:) Here are my current settings.
#define VOLUME 3000
#define CLASH_THRESHOLD_G 4.5
#define AUDIO_CLASH_SUPPRESSION_LEVEL 6
Hey everyone! I’m new to OSS/Proffie as I just recently got my first saber, a Proffie Neopixel from Sabertrio. With it updated to 6.7, I found this false clash issue very badly present. With a preconfigurated VOLUME
of 1750 and CLASH_THRESHOLD_G
of 4.0, false clashes would occur anywhere from 30% volume and louder. When loud enough, false clashes would trigger more false clashes.
While simultaneously going through customer support for help I’ve been scouring these boards for potential software solutions and I’ve tried a lot.
Raising the CLASH_THRESHOLD_G
does little to no help; raising it all the way to 10 or more didn’t do that much. Lowering the VOLUME
also doesn’t have too much improvement, or not nearly enough. Changing FILTER_CUTOFF_FREQUENCY
and FILTER_ORDER
also does nothing.
Using AUDIO_CLASH_SUPPRESSION_LEVEL
helps to filter out most of the false clashes (~23 was my sweetspot), but it also introduces a lot of inconsistency towards detecting real clashes. Because the threshold to register a clash increases as the volume increases, registering a real clash while the saber is playing other sounds (even just swings or heavy swings) makes it very hard to register a clash while the blade is in motion or playing softer sounds that wouldn’t normally trigger a false clash. I also speculate that this may be increasing the threshold past the highest possible reading of the acceelerometer (16), which would make clashes impossible when the volume is high enough. I also speculate that the volume used to multiply with AUDIO_CLASH_SUPPRESSION_LEVEL
is reading the volume of the sound file being played as opposed to the output volume of the speaker; it is just as hard to detect real clashes at the minimum volume setting as compared to the maximum.
Lastly, I have tried moving back the PROFFIEOS_MOTION_FREQUENCY
and PROFFIEOS_ACCELEROMETER_RANGE
values. Lowering the motion frequency didn’t seem to really change anything. HOWEVER, changing the Accelerometer Range back to 4 nearly COMPLETELY FIXED the issue. lowering it to 8 didn’t do much; only by setting it back to the supported value in Proffie v5 (4) did I see major improvements. With this and a CLASH_THRESHOLD_G
of 3.99, false clashes very rarely happen even at max volume, and real clashes register perfectly.
There definitely is some weirdness introduced by increasing the maximum accelerometer reading value in v6, at least with my saber. I speculate that if this bug could be squashed while simultaneously keeping the max accelerometer value at 16, I could simply raise my clash threshold a little bit more and my issues would probably be completely gone.
Here’s the config file I’m currently using:
s3config.h (78.1 KB)
This is quite interesting, because it possibly hints that there might be better ways to detect clashes, assuming I can figure out why this works in the first place.
Clash detection is proffieos is simple, it is:
| acceleration - down | > ClashThreshold
With the PROFFIEOS_ACCELEROMETER_RANGE set to 4, acceleration is a vector where X, Y and Z stay between +4 and -4. Down is a vector which (hopefully) points down, with a length of 1. When the saber is still, the acceleration and the down vector should be roughly the same.
Now, depending on which direction the down vector is pointing, some acceleration directions won’t be able to yield a difference that has a magnitude over 3.99. I’m not sure what this means though, maybe it means that you’ll have false clashes if you hold your saber upside down? Or maybe it means that false clash readings are more likely to be in the down direction?
It also means that acceleration that is exactly in the X, Y or Z direction will have a harder time causing clashes since they will be clamped to 4. Maybe speaker vibrations are generally in the same direction as the blade? (It would sort of make sense since the speaker is generally mounted in the opposite direction of the blade.)
Probably the right thing to do here is to use the clash recorder script to record some real and false clashes, then inspect the data to see if there is some simple way to distinghish them from each other.
We could also try setting the accelerometer range back to 16, but then clamp it to 4 in software and see if we get the same results.
To note, I also had great results with a threshold of 3.9 while the accel range is capped at 4. 3.99 is just the threshold I’m currently running. While at 3.99, a lot of the false clashes seem to be thrusts. I’ll have to check to see if 3.9 also has the same behaviour.
Could I get some pointers for how to run the clash recorder, and how I can manually clamp the range to 4? I can make some local edits and test it out whenever I find spare time, though I’ll be pretty busy.
Well, clamping should be easy, let’s see…
Probably easiest to add a clamp function first, here:
It would look like:
Vec3 clamp(const Vec3& min, const Vec3& max) const {
return Vec3(
x < min.x ? min.x : x > max.x ? max.x : x,
y < min.y ? min.x : y > max.y ? max.y : y,
z < min.z ? min.x : z > max.z ? max.z : z);
}
Then we could use it here:
That statement would become:
prop.DoAccel(
MotionUtil::FromData(databuffer + 6, PROFFIEOS_ACCELEROMETER_RANGE / 32768.0, // 16 g range
Vec3::BYTEORDER_LSB, Vec3::ORIENTATION).clamp(Vec3(-4.0), Vec3(4.0)),
first_accel_);
I’ve tested setting PROFFIEOS_ACCELEROMETER_RANGE
back to 16 and adding the clamp to 4.0, and I can confirm that it doesn’t work. The false clashes came back with the same intensity.
I dug around the files a little bit and found some files for the clash recorder, but I wasn’t able to figure out how to use it properly.
That is super weird! Because setting the range to 4g and setting the range to 16g and then clipping it really ought to be the same thing! (Unless of course I messed up the code somehow.)
To use the clash recorder, I think all you need to do is to add:
#include "../scripts/clash_recorder_config.h"
right before #ifdef CONFIG_PRESETS
in your config file.
You’re supposed to use the ClashRecorderStyle
to make the blade light up in the right place before you do the clash, but since you’re looking to record fake and non-fake clashes, you can just ignore that.
Note that after each recorded clash it will ask you to accept or reject the recording before saving it to the SD card.
Oh, and you probably need the latest ProffieOS from the github master for the clash recorder to work.