Yeniden işleme istasyonundaki Reject butonu hızlı basışları kaçırıyor. Ayrıca Forge bunları bizim için sayabilir mi?
Yapay zekâ tarafından English dilinden çevrildi ·
Bir kapı paneli hattının sonunda bir yeniden işleme istasyonumuz var. Bir operatör bir paneli reddettiğinde büyük bir mantar başlıklı düğmeye basıyor; bir ESP8266 (Wemos D1 mini) basışları sayıp sayıyı her dakika Hermetry’ye gönderiyor. Bunu saat bazında grafiğe dökmekteyiz.Sorun: İki veya üç panel art arda geldiğinde operatörler düğmeye hızlıca vuruyor ve sayı düşük çıkıyor. Bir vardiya boyunca elle yapılan sayımda 47 red çıktı, Hermetry ise 39 aldı. ESP düğmeyi loop() içinde digitalRead() ile okuyor, ancak loop() ayrıca WiFi işlemlerini, yayını ve debounce için 50 ms gecikmeyi de yapıyor.İkinci soru: Üretim için Hermetry Forge’un anıldığını gördüm. Kendi çözümümüzü geliştirmek yerine red sayımı için bunu kullanabilir miyiz?
We have a rework station at the end of a door panel line. When an operator rejects a panel they press a big mushroom button, and an ESP8266 (Wemos D1 mini) counts the presses and sends the count to Hermetry every minute. We chart it per hour.
Problem: when two or three panels come in quick succession, operators tap the button fast and the count comes out low. Tallying by hand for one shift gave 47 rejects, Hermetry got 39. The ESP reads the button with digitalRead() in loop(), and loop() also does WiFi, the publish and a 50 ms delay for debounce.
Second question: I saw Hermetry Forge mentioned for manufacturing. Is that something we could use for reject counting instead of rolling our own?
Yapay zekâ tarafından English dilinden çevrildi ·
Düğmenin iki ucuna bir kondansatör bağlamak yardımcı olur mu? Bir zil projemde yaptığım şey tam olarak buydu.
Would a capacitor across the button help? That’s what I did for a doorbell project.
Yapay zekâ tarafından English dilinden çevrildi ·
Cap, basışların kaçmasına değil, titreşime (bounce) yardımcı olur. loop() başka yerde 200 ms meşgulse, 100 ms’lik bir dokunuş her iki durumda da kaybolur.
Cap helps with bounce, not with missed presses. If loop() is busy elsewhere for 200 ms, a 100 ms tap is gone either way.
Yapay zekâ tarafından English dilinden çevrildi ·
Owen haklı. Basış döngünüzden daha kısa sürüyor, bu yüzden yoklama (polling) onu kaçırıyor. Pin düştüğü anda sayımın gerçekleşmesi için bir kesme (interrupt) kullanın ve sıçrama (debounce) filtrelemesini içinde zamana göre yapın. Yıllardır gaz sayaçlarındaki darbe sayaçlarını bu şekilde yapıyorum:
volatile uint32_t rejects = 0; // since boot
volatile uint32_t lastEdgeUs = 0;
void IRAM_ATTR onPress() {
uint32_t now = micros();
if (now - lastEdgeUs > 30000) { // ignore bounce within 30 ms
rejects++;
}
lastEdgeUs = now;
}
void setup() {
pinMode(D5, INPUT_PULLUP); // button to GND
attachInterrupt(digitalPinToInterrupt(D5), onPress, FALLING);
}
loop() içindeki delay(50) satırını kaldırın. Yayın sırasında, sayacı kesmeler kısa süreliğine kapalıyken kopyalayın.Donanım: fabrika zemininde düğme kablosu çoğu zaman motor kablolarının yanında metrelerce uzunlukta olur. ESP pininde seri bir 1 kΩ direnç ve 100 nF kondansatör ekleyin ya da daha iyisi, düğmeyi 24 V ile çalıştırıp bir optokuplöre bağlayın. Aksi halde hayalet reddetmeleri saymaya başlarsınız.”Bu dakikadaki red sayısı” yerine kümülatif bir sayaç gönderin: {"rejects.total": 1532}. Bir mesaj kaybolursa, bir sonraki mesaj yine doğru toplamı içerir ve artış (increase) toplulaştırmasıyla bir grafik size saatlik red sayısını verir.
Owen has it. The press is shorter than your loop, so polling misses it. Use an interrupt so the count happens the moment the pin falls, and do the debounce by time inside it. I’ve had pulse counters on gas meters for years done like this:
volatile uint32_t rejects = 0; // since boot
volatile uint32_t lastEdgeUs = 0;
void IRAM_ATTR onPress() {
uint32_t now = micros();
if (now - lastEdgeUs > 30000) { // ignore bounce within 30 ms
rejects++;
}
lastEdgeUs = now;
}
void setup() {
pinMode(D5, INPUT_PULLUP); // button to GND
attachInterrupt(digitalPinToInterrupt(D5), onPress, FALLING);
}
Remove the delay(50) from loop(). In the publish, copy the counter with interrupts briefly off.
Hardware: on a factory floor the button cable is often metres long next to motor cables. Add a 1 kΩ series resistor and 100 nF at the ESP pin, or better, run the button at 24 V into an optocoupler. Otherwise you’ll start counting phantom rejects.
Send a cumulative counter, not “rejects this minute”: {"rejects.total": 1532}. If a message is lost, the next one still has the right total, and a chart with the increase aggregate gives you rejects per hour.
Yapay zekâ tarafından English dilinden çevrildi ·
ESP yeniden başlatıldığında kümülatif sayıya ne olur? Tekrar 0’dan başlar.
What happens to the cumulative count when the ESP reboots? It starts at 0 again.
Yapay zekâ tarafından English dilinden çevrildi ·
Doğru. Bunu sıfırlamalar boyunca RTC belleğinde tutun ya da bunun yanında bir açılış sayacı gönderin ve düşüşü grafiğe bırakın. En basit yol RTC belleği.
Right. Keep it in RTC memory across resets, or send a boot counter as well and let the chart handle the drop. Simplest is RTC memory.
Yapay zekâ tarafından English dilinden çevrildi ·
Forge hakkında: bunun için bir doküman sayfası yok, bu yüzden reddedilenleri sayıp saymadığını ya da nasıl etkinleştirileceğini söyleyemem. Lewis’in tarif ettiği, paketleme hatlarımızda yaptığımız şeydir: sayaçlar telemetri olarak ve artış toplamıyla saatlik bir çubuk grafik. Vardiya değişiminde süpervizörler buna bakar.
On Forge: there’s no doc page for it, so I can’t tell you whether it counts rejects or how you’d switch it on. What Lewis describes is what we do on our packing lines: counters as telemetry and a bar chart per hour with the increase aggregate. The supervisors look at it at shift change.
Yapay zekâ tarafından English dilinden çevrildi ·
Kesme (interrupt) versiyonu Pazartesiden beri istasyonda. Elle sayım 52, Salı vardiyasında Hermetry 52. Ayrıca “bu dakikadaki redler” verisini yayınlayıp sıfırlıyordum; bu yüzden geçen hafta iki mesaj kayboldu ve redleri sessizce yutmuş oldu. Artık rejects.total kullanıyorum ve sayaç RTC belleğinde. Forge notu için teşekkürler Keisha. Müdürümüz “Forge’a bak” demişti; bunu hesap yetkilimize ileteceğim, ama sayaç bugün her durumda işini görüyor.
Interrupt version is on the station since Monday. Hand tally 52, Hermetry 52 on Tuesday’s shift. I’d also been publishing “rejects this minute” and resetting to zero, so two lost messages last week had silently eaten rejects; it’s rejects.total now with the counter in RTC memory. Thanks for the Forge note Keisha. Our manager had asked me to “check Forge”, I’ll pass that to our account contact, but the counter does the job today either way.
- Bu konuyu yanıtlamak için giriş yapmış olmalısınız.
Sohbete katılın
Soru sormak ve yanıtlamak, yararlı gönderileri beğenmek ve sorununuzu çözen yanıtı işaretlemek için oturum açın. Her katkı puan ve seviye kazandırır.

