Fix bei ca.600U/Min ist ende verliert schritte

This commit is contained in:
Jannis 2026-10-10 10:45:49 +02:00
parent 96dd8da2d9
commit 1a43c4702c
2 changed files with 10 additions and 10 deletions

View file

@ -33,7 +33,7 @@ uint32_t lastPlotTime = 0;
bool autoStop = false; bool autoStop = false;
bool bSettings = false; bool bSettings = false;
uint32_t curTemp = 0; int32_t curTemp = 0;
bool send = false; bool send = false;
bool stopMove = false; bool stopMove = false;
@ -211,7 +211,7 @@ int getTempInC(uint8_t senTemp){
return ((milliVolt - 500)/10); return ((milliVolt - 500)/10);
} }
uint32_t getFilteredTemp(int rawSensorPin) { int32_t getFilteredTemp(int rawSensorPin) {
constexpr uint8_t FILTER_SAMPLES = 100; // Puffergröße (100 Messwerte) Mittelwert über 10s constexpr uint8_t FILTER_SAMPLES = 100; // Puffergröße (100 Messwerte) Mittelwert über 10s
static int readings[FILTER_SAMPLES]; static int readings[FILTER_SAMPLES];
static uint8_t readIndex = 0; static uint8_t readIndex = 0;
@ -458,15 +458,8 @@ void printStatus(FastAccelStepper *stepper, int speed, int clickPlus, int clickM
// ############################################################ // ############################################################
// ################ EINZIGE STELLE FÜR MOTORSTEUERUNG ######### // ################ EINZIGE STELLE FÜR MOTORSTEUERUNG #########
// ############################################################ // ############################################################
enum MotorCmd {
MOTOR_KEEP, // nichts am Motor ändern
MOTOR_STOP, // schnell anhalten
MOTOR_AUTO, // Automatikbetrieb (Zeitschaltuhr) laufen lassen
MOTOR_MANUAL // Handbetrieb mit 'speed'
};
void applyMotor(MotorCmd cmd, int32_t speed) { void applyMotor(MotorCmd cmd, int32_t speed) {
switch (cmd) { switch(cmd){
case MOTOR_STOP: case MOTOR_STOP:
if (stepper->isRunning()) { if (stepper->isRunning()) {
stepper->setAcceleration(10000); stepper->setAcceleration(10000);

View file

@ -62,3 +62,10 @@ struct SystemSettings {
}; };
enum MotorCmd {
MOTOR_KEEP, // nichts am Motor ändern
MOTOR_STOP, // schnell anhalten
MOTOR_AUTO, // Automatikbetrieb (Zeitschaltuhr) laufen lassen
MOTOR_MANUAL // Handbetrieb mit 'speed'
};