# Clash position detection

**URL:** <https://crucible.hubbe.net/t/clash-position-detection/2439>\
**Category:** Sabers\
**Created:** [October 4, 2022, 12:25pm UTC](https://crucible.hubbe.net/t/clash-position-detection/2439 "2022-10-04T12:25:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celemourn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/celemourn/32/3007_2.png) [@Celemourn](https://crucible.hubbe.net/u/Celemourn)\
**Post date:** [October 4, 2022, 12:25pm UTC](https://crucible.hubbe.net/t/clash-position-detection/2439/1 "2022-10-04T12:25:59Z")

</div>

I got to wondering about how a saber could be rigged up to detect how far along the blade contact with a hard surface such as another blade is made. The application would be that if you know where two blades are contacting each other, you could add effects at that location using a pixel blade. Specifically, turn the blade white, and maybe boost the output for 6 inches on either side of the impact point.

My first thought was to add an accelerometer to the back of each neopixel in the blade. While I’m sure that would work, the cheapest accelerometers I could find on Mouser are on the order of $0.70 a piece, so \* 144 \* 2 you’re looking at over $200 additional cost for the blade. Might be worth it for disney, but not for most folks, I bet.

What other mechanisms might be usable to detect impacts, blade deformations, etc? Maybe some kind of optical effect that can be measured with lasers when the blade tube changes shape significantly? Pressure sensors? Transparent piezo elements on the inside of the blade? What do you guys think?

---

<div class="post-metadata">

**Author:** ![Fett263](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/fett263/32/214_2.png) [@Fett263](https://crucible.hubbe.net/u/Fett263)\
**Post date:** [October 4, 2022, 12:40pm UTC](https://crucible.hubbe.net/t/clash-position-detection/2439/2 "2022-10-04T12:40:14Z")

</div>

See here:

> [@The dream of clash locations is crushed](https://crucible.hubbe.net/t/the-dream-of-clash-locations-is-crushed/1920):
>
> For a very long time, I’ve been wanting to try to guess the clash location based on gyro/accelerometer data. I’ve collected and plotted clash data before, but this time I got serious and applied some machine learning to the problem. First thing I did was to create a better clash recorder. It lights up a small section of the blade, waits for a clash, and then asks if I want to save it. The saved data contains the accelerometer and gyro data, along with the computed “down” vector, saved 1600 times per second. The saved data has 256 rows, 128 of which are before the clash, and 128 are after the clash. The saved data also contains the location that was highlighted. Next, I recorded 150 clashes, each at a random location on the blade. Then I copied the saved data to my computer and fired up TensorFlow. Unfortunately, TensorFlow doesn’t seem to be able to find a correlation between the data and the location, the best it seems able to do looks something like this: In this scatterplot, the X axis is the highlighted point on the blade, and the Y axis is the predicted point. In an ideal world, these points should form a 45-degree line. As you can see there is very little correlation between predicted data and real data. Unless I’m using TensorFlow wrong in some way, I think that means that it’s unlikely that we can find a correlation between the accelerometer/gyro/down data and the clash location.
