Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Detecting broken/smashed epaper displays by TPS65185 VOM kick-back voltage? #393

Open
cyberman54 opened this issue Jan 23, 2025 · 22 comments · May be fixed by #395
Open

[Question] Detecting broken/smashed epaper displays by TPS65185 VOM kick-back voltage? #393

cyberman54 opened this issue Jan 23, 2025 · 22 comments · May be fixed by #395
Assignees

Comments

@cyberman54
Copy link

cyberman54 commented Jan 23, 2025

I'm looking for a way to detect a smashed / broken epaper display with epdiy, just by software.
The idea is: The TPS65185 can perform a voltage measurement on the VCOM pin to determine the kick-back voltage of the epd panel.
Would it be expectable to detect a smashed epaper display by reading this value and compare it against a certain threshold value?
Has anyone tested this?

/cc @martinberlin

@martinberlin martinberlin self-assigned this Jan 24, 2025
@martinberlin
Copy link
Collaborator

martinberlin commented Jan 24, 2025

They won't be other way than to test this. From the TPS65185 datasheet we can read:

8.3.7.1 Kick-Back Voltage Measurement

TPS65185x can perform a voltage measurement on the VCOM pin to determine the kick-back voltage of the panel. This allows in-system calibration of VCOM. To perform a kick-back voltage measurement, follow these steps:

• Pull the WAKEUP pin and the PWRUP pin high to enable all output rails.
• Set the HiZ bit in the VCOM2 register. This puts the VCOM pin in a high-impedance state.
• Drive the panel with the Null waveform. Refer to E-Ink specification for detail.
• Set the ACQ bit in the VCOM2 register to 1. This starts the measurement routine.
• When the measurement is complete, the ACQC (Acquisition Complete) bit in the INT1 register is set and the nINT pin is pulled low.
• The measurement result is stored in the VCOM[8:0] bits of the VCOM1 and VCOM2 register.
The measurement result is not automatically programmed into nonvolatile memory. Changing the power-up default is described in the following paragraph.

Questions:

  1. What is the null waveform?
  2. Would be the same just to refresh white the display and measure it?
  3. Would be another means to detect vandalism like a sudden change of temperature (TPS65185 has also a thermistor) or simply that the Firmware will hang since cannot update the display. It all depends on how bad you call it broken. Because it can be completely smashed or just have a break in the side and in that case I'm not sure if the Kick-Back Voltage measurement will mark any difference.
    Hopefully will do if it's broken but also we don't know because it really needs some experimentation.

Additional notes read on TI website:

  1. The null waveform can be obtained from the e-paper company. It is a blank waveform that they use for testing and calibration. I would simply apply a normal refresh black to white or even render a white framebuffer for a whole minute, then it will get to show last timetable.

How long we need to measure to get correct readings?

Depending on the capacitance that is at the VCOM node it can be as high as 60 seconds until the VCOM node stabilizes enough for accurate measurement. The leakage current of the panel is low enough that it takes a significant amount of time to charge the bulk capacitors in a system. Without added capacitors the time is a few seconds for reliable results.

@vroland
Copy link
Owner

vroland commented Jan 26, 2025

Sounds like an interesting thing to try! We haven't even implemented kick-back measurement for normal VCOM calibration yet though, so that would be a prerequisite. And we know that there is quite a variance in VCOM from display to display, but detecting a change for the same display sounds pretty plausible. As martin said, you'll need to try ;)

@cyberman54
Copy link
Author

Yes, I'm going to try it out together with Martin with an experiment.

Is there a schematic diagram for epaper displays somewhere that shows the connection between Vcom, Vsource and Vgate?

@martinberlin
Copy link
Collaborator

martinberlin commented Jan 26, 2025

Not really there is no official schematic about this anywhere that I could find.
Here you can see one that was drawn by Petteri Aimonen
eink schema
So far we just know that VCOM is a surface reference voltage. Higher than 15 voltages are driving the pixel mosfet Gates supposedly one for letting pass -15 V (ink goes up) and another one for positive voltage per pixel.
So actually only +15 and -15 are used to drive the ink for each pixel in all parallel Einks

@cyberman54
Copy link
Author

Thus, for breakage detection it may be useful to average Vcom reading over some time, while pulsing every single TFT FET.

@cyberman54
Copy link
Author

I asked eInk if this idea would work. They say yes, and that they applied this already in some applications.
But they don't want to share details without NDA.
So, let's DIY this here, and open source it :-)

@martinberlin
Copy link
Collaborator

Awesome, is not a surprise Eink being so friendly and open, the first block to pass here in my opinion is:

  • What is the NULL waveform. And how we can simulate that in epdiy?

To me it seems like a special waveform that is used for this VCOM kick-back voltage measurement.

Set the HiZ bit in the VCOM2 register. This puts the VCOM pin in a high-impedance state.

This point is already working in my demo. VCOM pin is in fact "in the air" and voltage is not assigned to it.

@martinberlin
Copy link
Collaborator

Hello @zephray maybe you have a more clear idea of what is a "Null waveform" and how we could simulate it here?

@cyberman54
Copy link
Author

cyberman54 commented Jan 27, 2025

This public Eink document says there ist a "Mode 0 = INIT" Waveform:
"MODE 0 ─ INIT Initialize is used to completely clear the display, if it's left in an unknown
state (i.e. if the previous image has been lost by a re boot)"

Some more information on Eink waveforms can be found on the internet in this document published by waveshare.

@martinberlin
Copy link
Collaborator

Thanks! Yeah actually looks like a gray matrix (waveform) that is just clearing the display. Also WHITE, full black, and white again. I will try that in my next tests to see what comes out of the VCOM readings

@zephray
Copy link

zephray commented Jan 27, 2025

Hello @zephray maybe you have a more clear idea of what is a "Null waveform" and how we could simulate it here?

The null waveform (based on my understanding) is just keep sending 0x00 (no operation) to the screen. This should allow doing VCOM kick back measurement

@martinberlin
Copy link
Collaborator

martinberlin commented Jan 28, 2025

Thanks a lot @zephray that helped a lot. Ok first tests are due and it's already reading something. Will play with this some days more anyways to see if it's the right way. @cyberman54 I've so far added 3 functions in tps65185 C files:

void tps_vcom_kickback();
This one starts the board in this special mode:

  // Pull the WAKEUP pin and the PWRUP pin high to enable all output rails.
  // But do not set VCOM to any voltage!
    epd_current_board()->measure_vcom(epd_ctrl_state());
  // PLUS Sets the HiZ bit in the VCOM2 register (BIT 5) 0x20
  // Adding BIT 3 & 4 Number of acquisitions that is averaged to a single kick-back V. measurement to 8 acq's
    tps_write_register(I2C_NUM_0, 4, 0x38);

void tps_vcom_kickback_start();

    // Set the ACQ bit in the VCOM2 register to 1 (BIT 7)
    tps_write_register(I2C_NUM_0, TPS_REG_VCOM2, 0xA0); // BIT 5 + 7
    // IMPORTANT To keep in mind that we need to mind leaving other BITs in same state and not overwrite them, that's why here we also leave HiZ bit Set 
  • unsigned tps_vcom_kickback_rdy();

Just checks if the ACQ bit is set. When it is then the readings should be readable from VCOM registers that we do with the following code:

/**
 * @brief ACQC (Acquisition Complete) bit in the INT1 register is set
 * @return mV 0 is not read! 
 */
unsigned tps_vcom_kickback_rdy() {
    uint8_t int1reg = tps_read_register(I2C_NUM_0, TPS_REG_INT1);
    if (int1reg == 0x02) {
        uint8_t lsb = tps_read_register(I2C_NUM_0, 3);
        uint8_t msb = tps_read_register(I2C_NUM_0, 4);
        int u16Value = (lsb | (msb << 8)) & 0x1ff;
        printf("Kickback lsb:%d msb:%d result:%d\n\n", lsb, msb, u16Value);
        return u16Value *10;
    } else {
        return 0;
    }
}

In my tests so far I've used 2 displays and this is the value that comes out, taking 2 passes of the NULL waveform to get the readings:

  1. 9.7" 1200x825, Vcom in the adhesive: -1780 mV. VCOM Kickback reading in my test: 270 mV. Disconnecting the display, readings are 0 like expected.
  2. 11.5" display, Vcom in the adhesive: -1400 mV. VCOM Kickback reading of 410 mV.
    Disconnecting the display, readings are 0 like expected.

Both readings where constant in my tests. Still didn't arrive to the part of breaking first displays since I want to make sure that the procedure is delivering a value we can use.
As a resume the VCOM readings I have are real. But they do not represent the VCOM that is on the display. We are really not interested that they match because nowhere in the datasheet says it should be so.
After more tries I will make first display broken but first I need to wait a week till a new one comes to my studio.

As an important remark: The NULL waveform is full of Zeroes (no-action) but even if it's no action the pixel instruction, it might make the dark tint a bit more gray, so I highly recommend after running the test to refresh the display with the normal setup. Or just do it on the night at a certain hour and then restart completely the device to get last time-tables

@cyberman54
Copy link
Author

cyberman54 commented Jan 28, 2025

Can you try the same approach, with some other waveform, while measuring? To see impact of waveform on voltage value. Also, could you try to heat or cool display while measuring, and compare value? To see impact of temperature on Vcom.

@martinberlin
Copy link
Collaborator

martinberlin commented Jan 28, 2025

Low temperatures do affect the readings a lot: Measuring with the 9.7" 1200x825 at normal room temperature of 21°C gives 270 mV VCOM reading.

COLD:
Left display in the freezer 5 minutes at -18° Celsius. First reading was 20 mV. Second around 30 mV. After one minute it was again 270 mV. But note display is naked, this extreme temperature will not happen like this if it's on a sealed case. But for sure in very cold days we can expect VCOM values to be lower.

HOT weather:
Actually in next test I warmed up the display directly with a hair dryer slowly up to 30°Celsius like a hot summer day:
VCOM reading of 280 mV. Only went up 10 mV.

So as a resume it seems physics of the display affect VCOM including temperature. It seems very cold temperatures minor than -10°C will make broken displays hard to detect. The good thing is that the TPS65185 is usually tied with a NTC Thermistor that can be read by I2C.
If it's worth it I could read it and print the Values alongside the VCOM readings. What I'm not sure is if it will read -0 °C values.

Thermistor

Will make tomorrow tests with different waveforms.

@martinberlin martinberlin changed the title [Question] Decting broken/smashed epaper displays by TPS65185 VOM kick-back voltage? [Question] Detecting broken/smashed epaper displays by TPS65185 VOM kick-back voltage? Jan 28, 2025
@martinberlin
Copy link
Collaborator

Hello @cyberman54 here some readings with temperature of the Thermistor, same display ED097TC2:

TPS temperature: 5 °C
VCOM reading of 10 mV.

TPS temperature: 7 °C
VCOM reading of 230 mV.

TPS temperature: 8 °C
VCOM reading of 240 mV.

TPS temperature: 10 °C
VCOM reading of 240 mV.

From 11 to 13 seems to be also 240 mV. Note that thermistor is on the PCB and not inside the display.

TPS temperature: 16 °C
VCOM reading of 250 mV.

Last reading is already 20°C room temperature that is again constant in 270 mV Vcom kickback voltage.

Vcom kickback

I don't think the thermistor in PCB get's below 0°C since I always get positive values.

@cyberman54
Copy link
Author

Hmm, that's bad news because it makes things more complicated, meaning some kind of temperature compensation will be needed when comparing Vcom Values.

Solution: Always read Vcom and Temp value from TPS chip. Then combine both values in some way before compare.

Now depends on Vcom values we see with broken displays. If the variation is smaller than average temperature impact, a breakage detection via Vcom will be difficult or impossible, especially in outdoor environments.

@martinberlin
Copy link
Collaborator

martinberlin commented Jan 28, 2025

Now depends on Vcom values we see with broken displays. If the variation is smaller than average temperature impact, a breakage detection via Vcom will be difficult or impossible, especially in outdoor environments.

Totally agree. In the cold winter nights under 0° C will be hard to detect. But also keep in mind I did this test putting the naked Display in the freezer. Such an extreme cold shock won't have when it's in the outdoor enclosure protected by glass.

But for for sure VCOM readings will be lower. Tomorrow I will start breaking first a 6" that I've somewhere in the lab and don't use, and will document it in the WiKi, and in video. I'm hoping that when display is completely broken VCOM kickback will be close to 0.

Additional tests:

Using a different waveform like display original waveform does not change my readings as long as the display is white. Updating the display with the dragon demo image just before the Test changes the VCOM readings. I would say that to make a VCOM lecture that is stable for that seconds the display should be cleared like a white paper.
If it has an image printed, even refreshing it with the NULL Waveform, seems to deliver lower readings. I would recommend that for the 4 or 5 seconds this test is running that the display cleared, then performs the test, and then can restart to do what the firmware normally does.

UPDATE: Found a small bug in the way I was doing the update. Because epdiy firmware makes a diff between Front buffer and back buffer the ideal way to do a NULL "active waveform" is:

epd_init(&DEMO_BOARD, &ED097TC2, EPD_LUT_64K);
    hl = epd_hl_init(&epdiy_NULL);
    // We start the Kickback process
    tps_vcom_kickback();

    // Display starts to pass BLACK to WHITE but doing nothing+
    // Since the NULL waveform is full of 0 "Do nothing for each pixel"
    idf_loop();
    // start measure and set ACQ bit:
    tps_vcom_kickback_start();
    int isrdy = 1;
    int kickback_volt = 0;
    while (kickback_volt == 0) {
        idf_loop();
        isrdy++;
        kickback_volt = tps_vcom_kickback_rdy();
    }

This outputs the following and so far is always the same value, higher and closer to real VCOM:

Kickback raw readings:52 TPS temperature: 20 °C
VCOM reading of 520 mV.

Now this has to be with the NULL waveform. If we use a normal waveform and the pixel move then affects the VCOM a lot making it closer to the higher possible value with TPS65185 that is around 5060 mV. In case using a NULL waveform is not available the best is to refresh the display using always white over white.

@cyberman54
Copy link
Author

Not sure, if'm a right (i am NOT an electrical engineer): Regarding to the prinicple schematic on top, i would guess Vcom values will rise (not drop) when TFTs on the substrate break. If so, we have no trade off with temperature impact. Maybe we can even detect how many TFTs break and then guess "n% of display surface is broken". That would be extremly nice ;-) But theory so far.

@martinberlin
Copy link
Collaborator

Between tomorrow and Friday I will make a real test of breaking and documenting a 6" display.
For me the best way to measure VCOM in the open knowing that you can measure temperature, will be to do it always when temperature is >= 10°C also in the warmest moment in the day in winter (And possibly in the night on the summer)
Also try to make it only between 10 and 20°C so the drift as low as possible

@martinberlin
Copy link
Collaborator

Additional note from my side:
The reason that VCOM is high if you measure it right afterwards doing a normal display operation with Display waveform is also that both VCOM and the pixel push +15 and -15 have 1 uF capacitors

Power line capacitors

My theory is that then to do proper readings you need to wait some seconds until this capacitors drain. And then you apply the NULL waveform and read. This time VCOM is in HiZ state also like pin is in high impedance state, ready to get the voltage from the other layers. But it might be your theory is right and goes up when display substrate is broken, let's document it. I'm really curious to see what comes out

@martinberlin
Copy link
Collaborator

@cyberman54 you where right!
Video proof: https://youtu.be/PyhPsOnWIcA (Is unlisted because my German is not good)

@cyberman54
Copy link
Author

@cyberman54 you where right! Video proof: https://youtu.be/PyhPsOnWIcA (Is unlisted because my German is not good)

Thank you very much for this experiment! Looks like a well paved road to go for a remote display health check! Lets go further now!

@martinberlin martinberlin linked a pull request Jan 30, 2025 that will close this issue
@martinberlin martinberlin linked a pull request Jan 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants