Update stall detection params and expand documentation
- Adjust stall current threshold to 4A and detection time to 2500ms - Add comprehensive README with hardware specs, wiring diagrams - Include current sensing circuit documentation and math - Improve motor and webserver implementations
This commit is contained in:
@@ -28,17 +28,44 @@ const char index_html[] PROGMEM = R"rawliteral(
|
||||
text-align: center;
|
||||
}
|
||||
h1 { color: #00d9ff; margin-bottom: 30px; }
|
||||
.status {
|
||||
background: #16213e;
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
.status {
|
||||
background: #16213e;
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.status span {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
.status span {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #00d9ff;
|
||||
}
|
||||
.current-display {
|
||||
background: #16213e;
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
.current-value {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #00d9ff;
|
||||
}
|
||||
.current-label {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
.stall-warning {
|
||||
background: #ff5252;
|
||||
color: white;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
display: none;
|
||||
}
|
||||
.stall-warning.active { display: block; }
|
||||
.slider-container {
|
||||
background: #16213e;
|
||||
padding: 20px;
|
||||
@@ -92,6 +119,21 @@ const char index_html[] PROGMEM = R"rawliteral(
|
||||
<div class="container">
|
||||
<h1>Motor Control</h1>
|
||||
|
||||
<div class="stall-warning" id="stallWarning">
|
||||
⚠️ STALL DETECTED - Motor Stopped
|
||||
</div>
|
||||
|
||||
<div class="current-display">
|
||||
<div>
|
||||
<div class="current-label">CURRENT (Active)</div>
|
||||
<div class="current-value"><span id="currentActive">0.00</span>A</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="current-label">THRESHOLD</div>
|
||||
<div class="current-value" style="color:#ff9100;">4.0A</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="status">
|
||||
Direction: <span id="dirStatus">STOPPED</span>
|
||||
</div>
|
||||
@@ -147,15 +189,33 @@ const char index_html[] PROGMEM = R"rawliteral(
|
||||
else dirStatus.textContent = 'STOPPED';
|
||||
}
|
||||
|
||||
// Get initial state
|
||||
fetch('/status')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
slider.value = data.speed;
|
||||
speedVal.textContent = data.speed;
|
||||
currentDir = data.direction;
|
||||
updateStatus();
|
||||
});
|
||||
function pollStatus() {
|
||||
fetch('/status')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
slider.value = data.speed;
|
||||
speedVal.textContent = data.speed;
|
||||
currentDir = data.direction;
|
||||
updateStatus();
|
||||
|
||||
// Update current display
|
||||
const active = data.direction > 0 ? data.currentR :
|
||||
data.direction < 0 ? data.currentL : 0;
|
||||
document.getElementById('currentActive').textContent = active.toFixed(2);
|
||||
|
||||
// Show/hide stall warning
|
||||
const stallWarning = document.getElementById('stallWarning');
|
||||
if (data.stalled) {
|
||||
stallWarning.classList.add('active');
|
||||
} else {
|
||||
stallWarning.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Poll status every 500ms
|
||||
pollStatus();
|
||||
setInterval(pollStatus, 500);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user