Dann habe ich das richtig verstanden.
Mein Ziel ist es das er die Spiral verlässt und geradeaus weiterfährt und die Zeit der Spiral zu definieren.
Dazu habe ich in der mower.cpp eine
SpiralTime = 50000; definiert
und die
case STATE_FORWARD:
// driving forward
if (mowPatternCurr == MOW_BIDIR){
double ratio = motorBiDirSpeedRatio1;
if (stateTime > 4000) ratio = motorBiDirSpeedRatio2;
if (rollDir == RIGHT) motorRightSpeedRpmSet = ((double)motorLeftSpeedRpmSet) * ratio;
else motorLeftSpeedRpmSet = ((double)motorRightSpeedRpmSet) * ratio;
}
if ((lastSetSpiralStartTime = stateStartTime + motorSpiralStartTimeMin)) {
if (millis() < lastSetSpiralStartTime + 4000) rotatePoint = motorSpeedMaxRpm;
else rotatePoint = 0;
if (rollDir == RIGHT){
motorRightSpeedRpmSet = (motorSpeedMaxRpm*(1.0/(1.0+(float)motorSpiralFactor/(float)(millis()-lastSetSpiralStartTime)))-rotatePoint);
}
else{motorLeftSpeedRpmSet = (motorSpeedMaxRpm*(1.0/(1.0+(float)motorSpiralFactor/(float)(millis()-lastSetSpiralStartTime)))-rotatePoint); }
}
checkErrorCounter();
checkTimer();
checkRain();
checkCurrent();
checkBumpers();
checkDrop(); // Dropsensor - Absturzsensor
checkSonar();
checkPerimeterBoundary();
checkLawn();
checkTimeout();
break;
geändert. rotatePoint bewirkt das anfängliche drehen auf der stelle, um die "Inseln" zu vermeiden
Werde ich am Wochenende mal testen ob das so geht
Gruß Stefan
Mein Ziel ist es das er die Spiral verlässt und geradeaus weiterfährt und die Zeit der Spiral zu definieren.
Dazu habe ich in der mower.cpp eine
SpiralTime = 50000; definiert
und die
case STATE_FORWARD:
// driving forward
if (mowPatternCurr == MOW_BIDIR){
double ratio = motorBiDirSpeedRatio1;
if (stateTime > 4000) ratio = motorBiDirSpeedRatio2;
if (rollDir == RIGHT) motorRightSpeedRpmSet = ((double)motorLeftSpeedRpmSet) * ratio;
else motorLeftSpeedRpmSet = ((double)motorRightSpeedRpmSet) * ratio;
}
if ((lastSetSpiralStartTime = stateStartTime + motorSpiralStartTimeMin)) {
if (millis() < lastSetSpiralStartTime + 4000) rotatePoint = motorSpeedMaxRpm;
else rotatePoint = 0;
if (rollDir == RIGHT){
motorRightSpeedRpmSet = (motorSpeedMaxRpm*(1.0/(1.0+(float)motorSpiralFactor/(float)(millis()-lastSetSpiralStartTime)))-rotatePoint);
}
else{motorLeftSpeedRpmSet = (motorSpeedMaxRpm*(1.0/(1.0+(float)motorSpiralFactor/(float)(millis()-lastSetSpiralStartTime)))-rotatePoint); }
}
checkErrorCounter();
checkTimer();
checkRain();
checkCurrent();
checkBumpers();
checkDrop(); // Dropsensor - Absturzsensor
checkSonar();
checkPerimeterBoundary();
checkLawn();
checkTimeout();
break;
geändert. rotatePoint bewirkt das anfängliche drehen auf der stelle, um die "Inseln" zu vermeiden
Werde ich am Wochenende mal testen ob das so geht
Gruß Stefan