Das Multimeter zeigt keine brauchbaren ströme, da hier kein vernünftiger Gleichstrom fließt, auch kein Sinusförmiger Wechselstrom. 9V sollten aber passen.
Die Genauigkeit ist bei den INAs nicht sehr gut, bei den 10milliOhm varianten sogar recht bescheiden.
Entscheidend ist die Einstellung wann der Sender Ein- und Ausgeschaltet wird.
PERI_CURRENT_MIN hast du scheinbar eingestellt.
#define OTAUpdates 1 // OTA Updates
#define WhatsApp_messages 1 // Receive Messages when the mower starts from station and returns to station. (Configuration necessary)
// 1) Create the Whatabot contact in your smartphone. The phone number is: +54 9 2364205798
// 2) Send: "I allow whatabot to send me messages"
// 3) Copy the phonenumber and the API that Whatabot sent you and enter it below.
// Type your phone-number (e.g.: +49 170 123456789 --> 4917012345678) and your API-key in PersonalAccessData.h
#define AUTO_START_SIGNAL 1 // Use to start sender when mower leave station
#define USE_STATION 1 // This station is used to charge the Mower. Then show the chargecurrent.
#define USE_PERI_CURRENT 1 // Use Feedback for perimeter current measurements? (set to '0' if not connected!)
//#define USE_BUTTON 0 // Use button to start mowing or send mower to station not finish
//#define SerialOutput 1
void loop() {
#ifdef OTAUpdates
ArduinoOTA.handle();
#endif
if (millis() >= nextTimeControl) {
nextTimeControl = millis() + 10000; //after debug can set this to 10 secondes
#ifdef Screen
StaticScreenParts();
#endif
void IRAM_ATTR onTimer() {
portENTER_CRITICAL_ISR(&timerMux);
if (enableSenderA) {
if (sigcode_norm[step] == 1) {
digitalWrite(pinIN1, LOW);
digitalWrite(pinIN2, HIGH);
} else (sigcode_norm[step] == -1) {
digitalWrite(pinIN1, HIGH);
digitalWrite(pinIN2, LOW);
}
step++;
if (step == sigcode_size) {
step = 0;
}
}
if (enableSenderB) {
if (sigcode_norm[step] == 1) {
digitalWrite(pinIN3, LOW);
digitalWrite(pinIN4, HIGH);
} else (sigcode_norm[step] == -1) {
digitalWrite(pinIN3, HIGH);
digitalWrite(pinIN4, LOW);
}
step++;
if (step == sigcode_size) {
step = 0;
}
}
portEXIT_CRITICAL_ISR(&timerMux);
}
// End of Signalmanagement
You set the perimeter Max value at 17120 .You need to put here the max value you can read when mower is just above the wire.
Now for the strange behaviour when mower find the wire can you try to:
TEST WITHOUT SONAR Activate (i never test the code for sonar while tracking)
Check console when mower roll, it's not normal
Into setting motor:
reduce speed max in PWM
test with PID = 1 / 0.4 / 0
Check that when mower drive in flat ground RPM/PWM Speed L/R are both near the max value.
For example PWM max =150 / RPM max=34 with PWM real time = 80 / RPM real time = 34 are bad setting value
Also actual speed coeff need between 0.9 and 1.1 on flat ground.
Into setting Perimeter:
Reduce the tracking max speed if tracking in not smooth.
Test with PID =16.5 / 8 / 0