Arctic Hare mod by Jussi

I have send a new version in GitHub.
What is your platform and ticksperRev on motor ?
I leave the mower all the Week without the bumper docking to see if it's OK but no problem on 5 or 6 docking test.
Set the CheckStation distance to zero and when tracking set the log to OFF to be sure all is OK.
Into Setting R/C have you deactivate the raspberry PI

If it didn't work uncomment line 2537 to 2543 an compare with my log.

Code:
15:20:03 86054/25.95/28.23
15:20:03 85554/26.01/28.39
15:20:02 85042/25.96/28.47
15:20:02 84542/25.91/28.56
15:20:01 84041/25.86/28.65
15:20:01 83511/25.81/28.75
15:20:00 83012/25.76/28.84
15:20:00 82510/25.70/28.95
15:19:59 82010/25.64/29.06
15:19:59 81510/25.58/29.18
15:19:58 81007/25.51/29.30
15:19:58 80507/25.47/29.44
15:19:57 Start to record the Battery charging

15:19:57 New State 12 CHARG Dir 0 State changed at 80009 From  previous state STAT
15:19:57 New State 11 STAT Dir 0 State changed at 80005 From  previous state STCHK
15:19:57 Charge Voltage detected 
15:19:57 80004/25.31/29.47
15:19:57 79505/25.14/29.50
15:19:56 79005/24.96/29.53
15:19:56 New State 13 STCHK Dir 0 State changed at 78504 From  previous state PTRK
15:19:56 Detect a voltage on charging contact check if it's the station
15:19:56 78504/24.74/29.52
15:19:56 78503/24.74/0.00
15:19:56 78503/24.74/0.00
15:19:55 78486/24.74/0.00
15:19:55 77401/24.74/0.00
15:19:55 77401/24.74/0.00


Here the normal log.(FROM BOTTOM TO TOP)

Code:
15:33:02 Stop to record the Battery charging
15:33:02 New State 11 STAT Dir 0 State changed at 144889 From  previous state OFF 
15:33:00 -------------------- LOOP NOT OK DUE IS OVERLOAD ------------------------ Over 1 sec 585
15:33:00 New State 0 OFF  Dir 0 State changed at 142887 From  previous state CHARG
15:33:00 Robot Stats address Stop = 826
15:33:00 Robot Stats address Start = 800
15:32:59 Save Robot Stats
15:32:53 Start to record the Battery charging

15:32:52 New State 12 CHARG Dir 0 State changed at 135279 From  previous state STAT
15:32:52 New State 11 STAT Dir 0 State changed at 135279 From  previous state STCHK
15:32:52 Charge Voltage detected 
15:32:51 New State 13 STCHK Dir 0 State changed at 133775 From  previous state PTRK
15:32:51 Detect a voltage on charging contact check if it's the station
15:32:28 New State 8 PTRK Dir 0 State changed at 111032 From  previous state ROLLSTOPTOTRACK
15:32:28 New State 57 ROLLSTOPTOTRACK Dir 0 State changed at 110453 From  previous state ROLLTOTRACK
15:32:25 New State 34 ROLLTOTRACK Dir 0 State changed at 108028 From  previous state STOPTOTRACK
15:32:24 New State 35 STOPTOTRACK Dir 0 State changed at 107032 From  previous state PFND
15:32:24 Not inside so start to track the wire
15:32:20 New State 7 PFND Dir 0 State changed at 102789 From  previous state OFF 
15:32:18 New State 0 OFF  Dir 0 State changed at 100768 From  previous state LANEROL1
15:32:18 Robot Stats address Stop = 826
15:32:18 Robot Stats address Start = 800
15:32:17 Save Robot Stats
15:32:14 New State 28 LANEROL1 Dir 0 State changed at 96860 From  previous state POUTREV
15:32:12 New State 20 POUTREV Dir 0 State changed at 95078 From  previous state STOPONBUMPER
15:32:12 New State 40 STOPONBUMPER Dir 0 State changed at 95022 From  previous state SONARTRIG
15:32:12 New State 42 SONARTRIG Dir 0 State changed at 94427 From  previous state PFND
15:32:12 Sonar Right Trigger at cm : 66
15:32:10 New State 7 PFND Dir 0 State changed at 92724 From  previous state OFF
 
@jussip
Look at the previous post, i put a debug batvolt and chgvolt when docking.
The battery read value increase very slowly.
But i remember that one day i have the same behaviour you have explain (increase so fast that never start charging) so certainly Something wrong in the filtert with the >5
 
In code there is e.g. 5 and 8 volts. Where those come from? Those are multiplied to 'real' values but how this happen?
 
If have used the ADC version from Alexander Sunray to avoid issue with calibration and faster working.
But it's possible there is some value not perfectly adjust.
I only charge the battery into the station on Denna Platform, and it work perfectly.
I can test with paranello one.
see here maybe it can help ??
https://www.ardumower.de/index.php/de/forum/anleitungen-hilfe/1576-err-battery-pcb1-3-azurit1-0a7#15061
 
Simply 5 -> 8 and now normal battery operating voltage goes trough filter.

Code:
if (abs(batVoltage - batvolt) > 8)   batVoltage = batvolt; else batVoltage = (1.0 - accel) * batVoltage + accel * batvolt;

When testing I found this, don't know is it bug or feature. During charging if unplug charger -> Relay stays on and charger voltage stay up -> States keeps changing between station and charging. This ' state' last 8 minutes every time

Code:
11:13:18.672 -> 34278 / batVoltage = 26.11 / chgVoltage = 0.10
11:13:19.182 -> 34778 / batVoltage = 26.28 / chgVoltage = 29.45
11:13:19.182 -> Status STATION New State STAT Dir 0 State changed at 34778 From state OFF 
11:13:19.182 -> Status STATION New State CHARG Dir 0 State changed at 34778 From state STAT
11:13:19.689 -> 35278 / batVoltage = 26.42 / chgVoltage = 29.36
11:13:20.166 -> 35778 / batVoltage = 26.46 / chgVoltage = 29.25
----- 
11:15:15.747 -> 151303 / batVoltage = 27.68 / chgVoltage = 27.45
11:15:16.223 -> 151803 / batVoltage = 27.61 / chgVoltage = 27.40
11:15:16.256 -> Status STATION New State STAT Dir 0 State changed at 151803 From state CHARG
11:15:16.256 -> Status STATION New State CHARG Dir 0 State changed at 151803 From state STAT
11:15:16.734 -> 152303 / batVoltage = 27.55 / chgVoltage = 27.35
11:15:17.248 -> 152803 / batVoltage = 27.49 / chgVoltage = 27.30
11:15:17.725 -> 153303 / batVoltage = 27.44 / chgVoltage = 27.26
11:15:18.229 -> 153803 / batVoltage = 27.38 / chgVoltage = 27.22
11:15:18.229 -> Status STATION New State STAT Dir 0 State changed at 153804 From state CHARG
11:15:18.268 -> Status STATION New State CHARG Dir 0 State changed at 153804 From state STAT
11:15:18.741 -> 154303 / batVoltage = 27.33 / chgVoltage = 27.18
11:15:19.245 -> 154803 / batVoltage = 27.28 / chgVoltage = 27.14
-----
11:23:19.397 -> 634815 / batVoltage = 26.13 / chgVoltage = 26.21
11:23:20.076 -> 635502 / batVoltage = 26.13 / chgVoltage = 26.21
11:23:20.076 -> Status STATION New State STAT Dir 0 State changed at 635513 From state CHARG
11:23:20.378 -> Status STATION New State CHARG Dir 0 State changed at 635801 From state STAT
11:23:20.579 -> 636002 / batVoltage = 26.12 / chgVoltage = 0.03
11:23:21.091 -> 636502 / batVoltage = 26.12 / chgVoltage = 0.03
11:23:21.568 -> 637002 / batVoltage = 26.12 / chgVoltage = 0.03
11:23:22.078 -> 637502 / batVoltage = 26.13 / chgVoltage = 0.03
11:23:22.381 -> Status STATION New State STAT Dir 0 State changed at 637802 From state CHARG
11:23:22.381 -> We are in station but ChargeVoltage is lost ??? 
11:23:22.381 -> Save Robot Stats
11:23:22.913 -> Robot Stats address Start = 800
11:23:22.913 -> Robot Stats address Stop = 826
11:23:22.913 -> Status WAIT New State OFF  Dir 0 State changed at 638324 From state STAT
11:23:23.190 -> 638602 / batVoltage = 26.13 / chgVoltage = 0.03
 
When testing I found this, don't know is it bug or feature. During charging if unplug charger -> Relay stays on and charger voltage stay up -> States keeps changing between station and charging. This ' state' last 8 minutes every time

I have never remark this but YES i have exactly the same result, Certainly electronics on PCB1.3 behaviour.

Maybe to change state from station to charging we need to also use the chgCurrent to avoid swap from station to charge everytime
 
Any idea where that 8 minutes come? State change from station to charging happens so quick that relay stay on, maybe second or so delay?
 
Sorry but it's not exactly the same behaviour as you

I Don't have the 8 min (After 12 Min the relay is Always ON)
 
How i test
The start charging is at 26.2V
The battery is at 26.43 V
I connect the charger
State change to station but charge Don't start.
So to start charging i change this in PFOD to 29V
The relay goes ON and state is StationCharge
I remove the charger : State jump from station to charge because chgVoltage Don't go to 0 ????
The relay stay ON and the chgVoltage is not zero ???????????
20 minutes after removing the charger the relay stay always ON the state jump fron station to charge.
But if i put again the start charging voltage to 26V into Pfod:
the relay goes OFF and chgVoltage is 0 and state is OFF


So for me except the strange behaviour with chgVoltage when unplug the charger all work correctly on a normal cycle battery charge


The 5 Hours record is OK on my working mower,But when charge start, the batVoltage is< startVoltageIfBelow and after 5 H when finish it's > so the state don't jump again to charge.

Are you OK with this ??
 
That's OK. I agree that it's not going to happen on normal usage and there's no easy solution without hardware mods. (and my mower abnormal state last only 8 minutes :D :D)
 
A gosht Inside :p
I work on the RFID and the PN5180 work for the moment on table like i expected.
I have also test to replace the old HC05 BT module by the ESP32 and it's was working perfectly for that (PFOD is OK at 115200 bps) but when i add the PN5180 Library in the code the RX2 and TX2 stop to work :evil:
It will be perfect if i can replace the HC05 by the ESP32 and read the RFID at the same time
 
For the 8 minutes
Are you sure it is not the idle timeout of the battery .(see setting battery)
Into my version ,This value power off the pcb not only in state off or error
If you have not activate the timer , into state station the idle power off all the pcb after a delay but if the usb is connected to the pc the due restart all immediatly .
 
It's not idle timeout. Tested 6 times, always 8 minute :D

Yesterday on high grass mowsense triggrers several times. Reset error counters resets only ERR_MOW_SENSE not motorMowSenseCounters. Only way is reboot pcb/due. Without reboot mowsense error come immediately after first error
 
Ok for the 8 minutes.
For the motorMowSenseCounter
It's reset here

Code:
errorCounterMax[ERR_MOW_SENSE] = 0;
    motorMowSenseCounter = 0;
    if ((lastTimeMotorMowStuck != 0) && (millis() >= lastTimeMotorMowStuck + 60000)) { // wait 60 seconds before switching on again
      errorCounter[ERR_MOW_SENSE] = 0;


Are you sure all is OK
If the sense is 80 % it's spirale.
If it's more than 100% 10time*100ms the motor stop for 1 minute and restart automaticly after.
If it really too high it's the driver motor itself who stop by safety the motor and it's not good at all (only restart can reset it)
 
Maybe it was motor driver then.. pfod show every time mowsense error. There's few spots on lawn where is moss and it's problematic to mower if it reach to blade plate.

Code:
void Robot::checkCurrent() {
  if (millis() < nextTimeCheckCurrent) return;
  nextTimeCheckCurrent = millis() + 100;
  if (statusCurr == NORMAL_MOWING) {
    if ((motor1MowSense >= 0.8 * motorMowPowerMax) || (motor2MowSense >= 0.8 * motorMowPowerMax)) {  //do not start the spirale if in tracking and motor detect high grass
      spiraleNbTurn = 0;
      halfLaneNb = 0;
      highGrassDetect = true;
      Console.println("Warning  motorMowSense >= 0.8 * motorMowPowerMax ");
      ////  [URL]http://forums.parallax.com/discussion/comment/1326585#Comment_1326585[/URL]     }
    else {
      if ((spiraleNbTurn >= 8) || (halfLaneNb >= 8)) {
        spiraleNbTurn = 0;
        halfLaneNb = 0;
        highGrassDetect = false; //stop the spirale
      }
    }
  }

  if (motor1MowSense >= motorMowPowerMax)
  {
    motor1MowSenseCounter++;
    Console.print("Warning  motor1MowSense >= motorMowPowerMax and Counter time is ");
    Console.println(motor1MowSenseCounter);
  }
  if (secondMowMotor) {
    if (motor2MowSense >= motorMowPowerMax) {
      motor2MowSenseCounter++;
      Console.print("Warning  motor2MowSense >= motorMowPowerMax and Counter time is ");
      Console.println(motor2MowSenseCounter);
    }
  }
  else {
    errorCounterMax[ERR_MOW_SENSE] = 0;
    motor1MowSenseCounter = 0;
    if (secondMowMotor) motor2MowSenseCounter = 0; // second mow motor
    if ((lastTimeMotorMowStuck != 0) && (millis() >= lastTimeMotorMowStuck + 60000)) { // wait 60 seconds before switching on again
      errorCounter[ERR_MOW_SENSE] = 0;
      if ((stateCurr == STATE_FORWARD_ODO)) { //avoid risq of restart not allowed
        motorMowEnable = true;
        lastTimeMotorMowStuck = 0;
        Console.println("Time to restart the mow motor(s) after the 60 secondes pause");
      }
    }
  }

  //need to check this
  if ((motor1MowSenseCounter >= 10) || (motor2MowSenseCounter >= 10)) { //ignore motorMowPower for 1 seconds
    motorMowEnable = false;
    Console.println("Error: Motor mow current");
    addErrorCounter(ERR_MOW_SENSE);
    lastTimeMotorMowStuck = millis();
  }
 
Die 8 Minuten ist eine Sicherheitszeit die den Mower abschaltet wenn er nicht benutzt wird bzw wenn er in keinen Betriebsmodus steht.
in der Mower.cpp

Code:
#elif defined (PCB_1_3)   // PCB 1.3
	batSwitchOffIfIdle         = 8;          // switch off battery if idle (minutes, 0=off) 
  	batFactor                  = voltageDividerUges(100, 10, 1.0)*ADC2voltage(1)*10;   // ADC to battery voltage factor *10
	batChgFactor               = voltageDividerUges(100, 10, 1.0)*ADC2voltage(1)*10;   // ADC to battery voltage factor *10
	chgFactor                  = ADC2voltage(1)*5;        // ADC to charging current ampere factor  (see mower.h for macros)	
        DiodeD9                    = 0.36;       // Spannungsabfall an der Diode D9 auf den 1.3 Board (Die Spannungsanzeige ist zu niedrig verursacht durch die Diode D9) **UZ**							  
  #endif


Gruß
Uwe
 
Hello
I am back on my problems :)
The docking problem is complete gone.
But my next problem is understanding the way to automatic.
I tried different ways.
1. Mower is in charging station in status "Station"
2. I setup a Timer for current time with ArduRemote
3. When i press now Automatic in Comands then the Mower starts undock but not like "Move back, turn, move forward to find wire" So it is not the Timer based movement.

Next version of try:
1. Mower is in charging station in status "Station"
2. I setup a Timer for current time with ArduRemote
3. Press the Button in Timer: Try this settings now
4. Mower leave charging station, turn, move 50cm forward and then hard stopps without Error or message

Next version of try:
1. I setup a Timer for current time with ArduRemote
2. Place the mower on gras and start Comand: Automatic
3. After Battery is empty the Mower go home and charge
4. After charging the mower leave station, turn and doing a nice curve direct to wire and follow the wiring 20m like i placed in Timer: Perfect

So: Try number 3 works but it is not easy to setup.
What is the right way to bring the mower in normal automatic mode with timer?

Thank you
Best, Bjoern
 
Hi.
Important.
When you want to stop the mowing you use the Go Home to send the mower in station, But if the timer is active the mower restart immediatly.:huh:

To avoid this:
If you use the Go Home to put the mower in the station Then the timer is not read for the next 1 hour you can change this here (the 3600000)


Code:
void RemoteControl::processCommandMenu(String pfodCmd) {
  if (pfodCmd == "ro") {
    // cmd: off
    robot->setNextState(STATE_OFF, 0);
    sendCommandMenu(true);
  } else if (pfodCmd == "rh") {
    // cmd: home
    robot->whereToStart=99999;
    robot->nextTimeTimer=millis()+3600000;
    robot->statusCurr=BACK_TO_STATION;
    robot->setNextState(STATE_PERI_FIND, 0);
    sendCommandMenu(true);
  } else if (pfodCmd == "rr") {



To test a timer Simply change it from YES to NO and again to YES (This reset the nextTimeTimer) and wait for the next minute.

Try this settings now
I set this a long time ago and never test it again (Try to change the code to remove the 1 hour wait in this case)

Code:
else if (pfodCmd.startsWith("pb")) {
    processSlider(pfodCmd, robot->timer[timerIdx].startLaneMaxlengh, 1);
    checkStart = true;
  }
  else if (pfodCmd.startsWith("pc")) {
    robot->nextTimeTimer=millis();
    // adjust stop time
    stopmin = max(5, time2minutes(robot->timer[timerIdx].stopTime));



The automatic start with forward and can't be use in the station without small change in the code (I take a look)

Normaly in automatic mode you have nothing to do (except setting the Timer) simply drink beer and see the mower work. B)
 
Oben