ProffieOS 7.5 Beta Testing Blade ID

Ok, I’m gonna go with the first hilt:

A Proffie v2.2 with a 22k pullup resistor between Data 1 and 3.3V. It has a Shtok ECO V2. So it shared the Data1 with the illuminated PCB which mirror the blade data.

Test1:

#define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 22000>
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_SCAN_MILLIS 3000
#define BLADE_ID_TIMES 1

8 scans of No Blade.
8 scans of a 47k bladeplug
8 scans of a 6.8k blade
8 scans of No Blade with the Blade turned on
8 scans of the 47k bladeplug with the blade turned on.

Ohms No Blade No Blade 47k 47k 6.8k 8.3k
Blade turned off on turned off on turned off turned off
Average 11,671.22 11,953.67 9,332.42 9,547.05 4,394.86 5,062.49
STDDEV 37.66 121.44 23.29 71.47 16.53 23.63
11,674.14 11,876.69 9,332.41 9,551.82 4,379.39 5,044.42
11,623.88 11,825.83 9,332.41 9,684.95 4,410.32 5,076.92
11,674.14 11,825.83 9,332.41 9,463.69 4,410.32 5,044.42
11,674.14 11,876.69 9,288.89 9,463.69 4,410.32 5,044.42
11,674.14 11,876.69 9,376.04 9,507.69 4,379.39 5,109.51
11,724.55 11,978.88 9,332.41 9,551.82 4,410.32 5,044.42
11,674.14 12,081.70 9,332.41 9,507.69 4,379.39 5,076.92
11,674.14 11,927.71 9,332.41 9,596.07 4,379.39 5,044.42
11,623.88 12,133.33 9,596.07 5,076.92
11,674.14 12,133.33
11,623.88
11,674.14
11,674.14
11,674.14
11,674.14
11,623.88
11,775.11

Test2:

#define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 22000>
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_SCAN_MILLIS 3000
#define BLADE_ID_TIMES 20

8 scans of No Blade.
8 scans of a 47k bladeplug
8 scans of a 6.8k blade
8 scans of No Blade with the Blade turned on
8 scans of the 47k bladeplug with the blade turned on.

Ohms No Blade 47k 6.8k 8.3k
Blade turned off on turned off on turned off turned off
Average 11,732.90 11,961.90 9,364.59 9,506.36 4,400.85 5,043.82
STDDEV 16.46 103.75 5.31 22.05 3.55 4.24
11742.25 11813.19 9369.5 9468.13 4405.68 5044.43
11757.43 11833.54 9369.51 9536.54 4396.41 5037.94
11752.37 11881.88 9362.95 9490.21 4405.7 5041.19
11739.72 11920.18 9371.68 9494.68 4397.95 5039.57
11752.36 11915.27 9365.14 9510.02 4397.95 5049.31
11744.77 11958.66 9360.78 9501.15 4402.59 5042.8
11752.36 11966.48 9356.41 9499.04 4401.05 5046.06
11737.2 11989.39 9360.77 9532.08 4399.5 5049.29
11729.63 12107.54 9525.43
11727.09 12097.37
11732.18 12097.44
11717
11714.47
11722.03
11709.43
11727.09
11701.87
11709.43
11706.96

Test3:

#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_SCAN_MILLIS 3000
#define BLADE_ID_TIMES 1

8 scans of No Blade.
8 scans of a 47k bladeplug
8 scans of a 6.8k blade
8 scans of No Blade with the Blade turned on
8 scans of the 47k bladeplug with the blade turned on.

Ohms No Blade 47k 6.8k 8.3k
Blade turned off on turned off on turned off turned off
Average 326.50 330.10 291.00 293.00 174.50 192.88
STDDEV 0.53 1.60 0.82 1.60 0.76 0.64
327 330 291 290 175 193
327 328 292 294 174 193
326 331 290 294 174 193
326 330 291 293 174 193
326 330 292 292 176 194
326 328 290 292 174 193
326 330 291 294 175 192
327 329 295 174 192
327 332
327 333
326
326
327
326
324

Test3:

#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_SCAN_MILLIS 3000
#define BLADE_ID_TIMES 20

8 scans of No Blade.
8 scans of a 47k bladeplug
8 scans of a 6.8k blade
8 scans of No Blade with the Blade turned on
8 scans of the 47k bladeplug with the blade turned on.

Ohms No Blade 47k 6.8k 8.3k
Blade turned off on turned off on turned off turned off
Average 327.15 330.67 291.29 293.86 174.69 193.16
STDDEV 0.28 1.18 0.15 0.47 0.16 0.12
327.25 328.5 291.5 293.9 174.9 193.1
327 329.45 291.2 293.05 174.8 193.05
327.2 330.15 291.3 294.35 174.65 193.3
327.1 330.45 291.2 293.8 174.75 193.2
327.55 330.55 291.5 293.4 174.35 192.95
327.1 330.6 291.1 293.75 174.7 193.25
327.25 330.95 291.2 294.35 174.65 193.25
327.45 331.5 291.3 294.25 174.75 193.2
327 332.35
326.55 332.2
326.9
328.35

First conclusion:

  • #define BLADE_ID_SCAN_MILLIS seems to be working fine.
  • #define BLADE_ID_TIMES 20 appears to give a slight improvement for the no blade, and a factor of ~4 improvement in accuracy for the resistored case.
  • Turning on the blade adds noise (about 3X Std Dev)
  • Using pixel mirroring for the PCB illumination seems to really compress all the values, and would seem to make impossible to get “true” resistor values.
  • Using Pullup method with mirrrored PCB seems worthless since the STDDEV seems to be on par or slightly higher than the snapshot method, while still offering nowhere to true values.
  • Using #define BLADE_ID_TIMES 20 reduced STDDEV by a factor of 5. The next post will probably try 10 and 5 to find the sweetspot.
  • For all the cases Resistor values are usually 10% away, while STDDEV even for single samples is below 0.5%.

Before the conclusions another detail: whenever I get a new detection while polling (either blade in or blade out), I get a double scan ID:

EVENT: ?47 millis=194490
EVENT MENU TURN RIGHT
ID: 9411.05
ID: 9393.55
blade = 2
WS2811 Blade with 80 leds.
Style RAM = 1196
...
EVENT: Clash millis=218601
EVENT: Clash millis=218853
ID: 11795.52
ID: 11765.00
blade = 3
WS2811 Blade with 108 leds.
...
Playing Kyberpho/Blue/hum01.wav
channels: 1 rate: 44100 bits: 16
ID: 9525.62
ID: 9569.52
blade = 2
WS2811 Blade with 80 leds.
...
EVENT: Clash ON millis=275654
unit = 1 vol = 0.50, Playing Kyberpho/Blue/clsh01.wav
channels: 1 rate: 44100 bits: 16
ID: 12144.16
ID: 12154.05
blade = 3
WS2811 Blade with 108 leds.

I don’t know if this matters or not, but did wanted to point it out.

Ok, I went and did some testing of no blade, and a 47k one, both with and without igniting the blade. My results seems to show that between 5 and 10 there’s a marked improvement, but 5 seems to be twice better than 1. 20 Samples adds very little.

Blade ID Standard Deviations

No Blade No Blade 47k 47k
Sampling turned off on turned off on
1 0.3227% 1.0159% 0.2496% 0.7486%
5 0.1600% 0.6407% 0.1679% 0.3107%
10 0.1557% 0.5306% 0.0545% 0.2202%
20 0.1403% 0.8673% 0.0567% 0.2319%

This is weird.
When powered, neopixel data inputs are supposed to be high impedance, which should mean that have very little impact on the measured values. Might still be true, but I don’t understand why.

Since standard deviation is already low, it seems like the sweet spot is 1?
(At least if we can figure out why the mirrored pixels things is behaving so weird.)

Yeah, this is normal.
The code that checks if anything has changed is embedded deep in neopixel blade code, so when it detects a change, it just sets a bool to true, and another piece of code picks it up, resets everything back to the beginning and starts over with a new blade identification.
Let me know if this turns out to be a problem.

1 Like

Yeah. I’ve been struggling because I don’t have the high resistored blades (68k and up). But I’m afraid they would be just too compressed. In the end, I think it is important to understand the eco-chassis problem. I have to install three Graflex in a couple of months, all with ECO, so I will have more samples. But on principle it seems more of a quirk than a problem to be addressed with 7.5 Beta.

As I said before, I don’t see much point in doing multiple polls in practice, but some high resistors might be so sensitive that they actually need them. I would keep the feature “just in case”, but I will probably not be using it.

Zero problem, really. I would say that up to here, everything checks up.

I will be repeating later these tests with a Shtok V3 that has the separate data lines and Blade Present, which generates “true” value on demand. I think the only two “deviation” I saw anecdotally were that if you take the Blade ID very fast after Blade Present, the circuit might not be closed between Data and GND. And the strange readings for the charging blade.

But I don’t expect to see mayor issues with this code. Constant polling allows to avoid the Blade Present pin, which is a win for those PCBs without BP pins, and for those using rotary connectors through a neck that usually don’t allow for BP and two switches.

Second hilt:

Proffie 2.2 with a 33k pullup resistor between Data 1 and 3.3V. It has a V3 Shtok Illuminated PCB with a separate Data 2 line for the illuminated LEDs plus a Blade Present pin.

Test1:

#define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 33000>
#define BLADE_DETECT_PIN blade3Pin
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_TIMES 1	

8 scans of No Blade.
8 scans of a 47k bladeplug
8 scans of a 6.8k blade
8 scans of a 8.3k blade
8 scans of a 22k blade
8 scans of a 39k charging blade plug
8 scans of No Blade with the Blade turned on
8 scans of the 47k bladeplug with the blade turned on.
8 scans of a 39k charging blade plug with the blade turned on.

Ohms No Blade No Blade No Blade No Blade 47k 47k 6.8k 8.3k 22k 39k Chargin Plug 39k Chargin Plug
Blade turned off after BP off on after BP on turned off on turned off turned off turned off turned off on
Average 847,143.01 891,111.93 908,709.22 959,622.30 45,118.99 44,967.21 6,681.95 8,513.53 24,068.30 81,330.13 61,732.33
STDDEV 11,774.90 254,120.22 113,627.40 303,599.54 96.56 1,615.48 24.91 27.26 6,311.24 31,787.65 24,446.22
833,461.81 1,093,400.00 880,296.56 629,588.00 45,041.57 43,279.91 6,661.97 8,462.58 21,946.34 9,292.87 6,708.58
856,263.81 1,022,999.00 791,194.81 701,608.50 45,222.22 43,800.00 6,661.97 8,513.51 41,926.83 92,620.83 74,617.84
856,263.81 856,263.81 856,263.81 1,218,554.12 45,041.57 43,974.95 6,708.58 8,513.51 21,946.34 92,155.55 72,600.00
856,263.81 856,263.81 932,485.69 616,845.75 45,222.22 47,075.83 6,708.58 8,564.58 22,947.02 94,037.59 72,600.00
833,461.81 833,461.81 905,666.31 1,266,691.62 45,041.57 43,800.00 6,661.97 8,513.51 21,946.34 95,486.71 68,173.66
856,263.81 592,777.94 856,263.81 592,777.94 45,041.57 46,886.52 6,708.58 8,513.51 22,762.38 93,561.78 65,807.01
856,263.81 833,461.81 811,800.00 905,666.31 45,222.22 45,953.27 6,661.97 8,513.51 20,980.83 92,155.55 71,619.20
856,263.81 503,381.22 856,263.81 1,318,680.00 8,513.51 21,946.34
833,461.81 752,861.00 1,022,999.00 1,218,554.12 23,039.80
833,461.81 717,933.31 1,173,858.37 1,436,219.25 21,240.77
1,057,064.00 991,000.94
1,173,858.37 671,000.44
685,978.25 629,588.00
1,093,400.00 1,218,554.12
629,588.00 932,485.69
1,375,000.87 1,502,997.87
960,882.75 991,000.94
671,000.44 671,000.44
656,632.88 656,632.88
1,502,997.87 1,022,999.00
604,585.25
1,173,858.37
592,777.94
991,000.94
671,000.44
833,461.81
1,022,999.00
856,263.81
833,461.81
701,608.50
833,461.81
856,263.81
880,296.56
717,933.31
616,845.75
1,318,680.00
685,978.25
1,375,000.87
1,318,680.00
  • Everything “normal” seems to be working. The one exception I had was that I got a double value on the 22k, but the connection was wobbly.
  • The sampling works fine for the NOBLADE only when the blade is off and not immediately after the blade is removed.
  • The variance of the NOBLADE case after the Blade Present opens is pretty large (upto 30%), but since the average is 850k and the Blade ID values are 2k to 100k, we seem to be fine.
  • There’s a large increase in variance when the blade is on. But still small enough not to confuse between different resistor values.
  • The charging bladeplug keeps giving out of family results. I will test it in a later post.
  • Personally, I would say that BLADE_ID_TIMES 1 seems to be fine.
  • If Proff wants, I can test with #define BLADE_ID_SCAN_MILLIS 3000 with or without #define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin> to further test Blade ID.

Is this because there is some other neopixels hooked up in parallel, or becuase there is some interference when we’re trying to send data to the blade. (Even though it’s not there.)

This hilt has the all the accents, crystal chamber AND the illuminated PCB on data2. I’m assuming that the samples after Blade Present go off might be because of the disconnect might arc or still be incomplete. I don’t know if you have a slight delay after BP is activated to sample the Blade ID. Because I’ve had some inverted (i.e. the blade’s resistance when the blade is off or the NOBLADE resistance when inserting the blade) readings. I’m assuming a slight delay so all pins physically compress and any possible arc ends could be a mitigating strategy.

So there is nothing on data1 except the blade, and the blade is not connected.
Yet somehow the blade being on or off makes a difference, right?

Yes, nothing on Data1, but powering the blade (opening the MOSFETS), increase the noise on the reading. On average you have a bit more resistance (from 850k to 900k and variance from 11k to 114k). That’s one case. BUT, the big increase in noise is after Blade Present pin opens (when the blade is retired). Std Dev was 255k and 300k (blade turned off and on) on the readings after Blade Present is retired.

But that’s weird, because if the blade is not connected, the FETs are not connected to data1 at all, right?

Data1 is bridged with a 33k resistor to 3.3V. Given that we are talking about 500k and up Ohms, I don’t know if some ground is leaking through that. Or if there’s some arcing when the blade is leaving. Really way beyond my understanding of electronics.

The 500k is just a measurement.
The real resistance between Data1 and any of the LED pads should be some large number of megaohms.

Arcing is not an issue at the voltages we use.