Drehen nach Perimeter-Stop

Hallo,
sobald mein Mäher zum Perimeterdraht kommt, stoppt er, fährt zurück und dreht (POUTROLL). Diese Drehung ist aber nicht wie erwartet zwischen 20 und 100° sondern meistens zwischen ca. 300 und 400°. Er fährt also gern zum Draht und dreht komplett um dann erneut zum Draht zu fahren. So dreht er minutenlang bis er dann doch wieder weniger weit dreht und weiter mäht. Ich habe im PERI_OUT_ROLL nach einem Fehler gesucht, doch seint hier alles OK. Die Drehung sollte im mower.cpp so begrentzt sein:
motorRollDegMax = 100; // max. roll Deg
motorRollDegMin = 20; //min. roll Deg

Im ODO-Test fährt er genau 3m gerade aus, doch bei der 180° Drehung stoppe er nicht und dreht und dreht.

Hat jemand eine Idee, wo ich suchen kann?
Danke
Jens
 
Ja, hab ich - leider keine Änderung (hatte ich zuvor auch schon gemacht). Ich hab ein kurzes Video von der letzten Drehung und dem "Entkommen" angefügt. Er sollte nur zwischen 20° und 100° drehen, oder?
 

Anhänge

  • VID_20220606_2.mp4
    1,3 MB
Jetzt habe ich in der ROBOT.CPP folgendes geändert:

case STATE_PERI_OUT_ROLL: //roll left or right in normal mode
AngleRotate = random(motorRollDegMin, motorRollDegMax); //Se eingefügt
if (mowPatternCurr == MOW_RANDOM) AngleRotate = random(motorRollDegMin, motorRollDegMax);

Hier ist (mowPatternCurr == MOW_RANDOM) ist aus irgend einem Grund nicht wahr und daher wird der AngleRotate nicht richtig gesetzt.
mit der zusätzlichen Zeile ohne diese Bedingung (//Se eingefügt) läuft er wie erwartet.
Damit ist mein Problem gelöst, doch frage ich mich, warum mowPatternCurr nicht stimmt - ich habe in RAND gemäht.
Hat jemand eine Idee?
 
First the test ODO rotate 180 and 360 need a correct result.
After it's something i solved in the dev branch but i don't understand why mower roll 2 time more than i expect
see here:

maybe you can test the DEV branch or simply use the case STATE_PERI_OUT_ROLL: locate in it:
Code:
case STATE_PERI_OUT_ROLL: //roll left or right in normal mode
      if(motorRollDegMin>motorRollDegMax) ShowMessageln("Warning : Roll deg Min > Roll deg Max ????? ");
    
      if (mowPatternCurr == MOW_RANDOM) AngleRotate = random(motorRollDegMin, motorRollDegMax);
      ShowMessage("Heading : ");
      ShowMessage((imu.ypr.yaw / PI * 180.0));
      
      if (dir == RIGHT) {
        ShowMessage(" Rot Angle : ");
        ShowMessageln(AngleRotate);
        if (mowPatternCurr == MOW_ZIGZAG) AngleRotate = imu.scale180(imuDriveHeading + 135); //need limit value to valib the rebon
        UseAccelLeft = 1;
        //bb6
        //UseBrakeLeft = 1;
        UseBrakeLeft = 0;
        UseAccelRight = 0;
        UseBrakeRight = 1;
        motorLeftSpeedRpmSet = motorSpeedMaxRpm ;
        motorRightSpeedRpmSet = -motorSpeedMaxRpm;
        Tempovar = 2*36000 / AngleRotate; //need a value*100 for integer division later
        stateEndOdometryRight = odometryRight - (int)100 * (odometryTicksPerCm * PI * odometryWheelBaseCm / Tempovar);
        stateEndOdometryLeft = odometryLeft + (int)100 * (odometryTicksPerCm * PI * odometryWheelBaseCm / Tempovar);
      } else {
        ShowMessage(" Rot Angle : ");
        ShowMessageln(-1*AngleRotate);
        if (mowPatternCurr == MOW_ZIGZAG) AngleRotate = imu.scale180(imuDriveHeading - 135); //need limit value to valib the rebon
        UseAccelLeft = 0;
        UseBrakeLeft = 1;
        UseAccelRight = 1;
        UseBrakeRight = 0;
        motorLeftSpeedRpmSet = -motorSpeedMaxRpm ;
        motorRightSpeedRpmSet = motorSpeedMaxRpm;
        Tempovar = 2*36000 / AngleRotate; //need a value*100 for integer division later
        stateEndOdometryRight = odometryRight + (int)100 * (odometryTicksPerCm * PI * odometryWheelBaseCm / Tempovar) ;
        stateEndOdometryLeft = odometryLeft - (int)100 * (odometryTicksPerCm * PI * odometryWheelBaseCm / Tempovar) ;
      }

      OdoRampCompute();
      break;
 
When I mow in Random the If statement (mowPatternCurr == MOW_RANDOM) is not true(??). Without that the AngleRotate ist OK and the mower turns between 20° and 100° as expected. But why does the "If...." not work?
 
I've checked my ODO settings and found, the 180° and the 360° turn cannot be completed on gras but on hard ground perfectly. So on the lawn I have some slip. Does it make sense to change the ODO settings (to wrong values) to get 180° on gras?
I'll try the DEV branch case STATE_PERI_OUT_ROLL and come back with my results.
 
So, I've tryed the Dev branch version and it works. I took the 2*36000 into the calculation with success but without understanding.
Thank you 👍😀
 
Does it make sense to change the ODO settings (to wrong values) to get 180° on gras?
In bylane mode mower roll 2 time (135 deg and 45 deg) and it's good if at the end of the 2 roll mower have made a half turn.
And yes you can change the distance between wheel in the odo setting to have a correct result in mowing condition.
 
The STATE_PERI_OUT_ROLL issue is still there. 😐
After a while the
rotation angles > motorRollDegMax
came back.
I do not longer belive that the issue is located in STATE_PERI_OUT_ROLL.
So I tryed to turn off IMU without success.
The ODO works with just a small deviation on gras. Is there another possibility that could cause this problem?
Start from Station ist also not possible. At the first return the left wheel is slower so the straight return route is a curve and the mower can't leave the station.
These two issues might have the same root cause???
 
Start from Station ist also not possible. At the first return the left wheel is slower so the straight return route is a curve and the mower can't leave the station.
i don't understand what is the first return ?
Did mower find the station ??
 
After charging I tryed to Start with the app "Start Now" from station in Random mode (no timer). At first he should go straight backwards for one meter but he goes in a curve and stuck in the station. In manual mode I can leave the station.
In STATE_STATION_REV I found the end of odometry left and right equal. So it might could be the same issue somewere else(?)
 

Anhänge

  • IMG_20220612_191459.jpg
    IMG_20220612_191459.jpg
    6,3 MB · Aufrufe: 11
Certainly It's odometry or motor driver issue.
on STATE_STATION_REV the 2 motor need to run at same speed and stop only after the end of odometry ticks count (100 cm * ticks/cm) or the timeout compute by the motor calibration (calibration is used to compute how many ticks mower can do in 1 second at normal speed so maybe for 1 meter it's 4 second)
But timeout stop the 2 motor at same time,so mower need to reverse straight
Is the test ODO 3 meter is OK and do you have click on the motor calibration ?
 
I wrote in my first post the mower turns and turns in the 180° ODO test and did not stop. I guess (really not sure) I did this test after mowing. When I reboot now and run this test the mower stops at about 170° in gras and 180° on hard ground.
 
Hi, I tryed something else than looking into the states. I had the idea to reduce the Ticks per revolution and I changed the Interrupts for the ODOMETRY from CHANGE to RISING:
attachInterupt(pinOdometrieLeft, PCINT2_vect, RISING);
( For all 4 Interrupts)
With that the count should be half(?).
After that I found a really unexpected behavior. In Test ODO, 1 revolution forward, the left wheel turns about one revolution but the right one did not stop turning. When I Turn the left wheel a little further, the right one Stopps (!?).
Anhang anzeigen VID-20220613-WA0001.mp4
 
attachInterupt(pinOdometrieLeft, PCINT2_vect, RISING);
( For all 4 Interrupts)
With that the count should be half(?).
Not usefull for you and only 200 ticks per rev (usefull only when you have more than 3500 ticks/rev). You simply have a half count.
How did the odo hardware is build ? 3.3V / 5V modul ????
 
Sorry for the late reply ... I'm back to CHANGE for the interrupts of the ODOMETRY. The encoder have 1200 ticks per revolution which is less than 3500.
Thanks
 
I do not longer belive that the issue is located in STATE_PERI_OUT_ROLL.
After some trials I'm sure the STATE _PERI_OUT_ROLL is OK with Tempovar = 36000 / AngleRotate. AngleRotate ist calculated in the preseted range and
the stateEndOdometryRight and stateEndOdometryLeft are calculated correctly according to the AngleRotate.

Therefore I belive, Tempovar = 2*36000 / AngleRotate is not the solution for this issue. The factor ist not always 2.
My mower does rotate in most cases about 90°. Sometimes less, down to about 30°, sometimes more than 180°. This is the case even If I set the angle limits to 20 and 21°.
The function OdoRampCompute() works perfectly with all other states (so no issue here?).
It seems, that to change the <Speed Odo min> does have an effect to the rotation angle(?). The angle gets sometimes much bigger with lower speed settings.
I would like to localize the issue, but where else should I look?
 
Use a 3 ml USB cable to follow mower and uncomment line 1990 to 2038 into robot.cpp.
It's very fast debug incomming data ,so not easy to see but:

Check that :

ShowMessage(" ODO Start/Actual/End ");
ShowMessage(stateStartOdometryLeft);
ShowMessage("/");
ShowMessage(odometryLeft);
ShowMessage("/");
ShowMessage(stateEndOdometryLeft);
ShowMessage(" ************************* Rspeed= ");

change correctly and at the end of rotation stateEndOdometryLeft is near to odometryLeft
 
Hi Bernard,
The Result of the Test ist shown on the picture. The Numbers are pretty close.
My settings where 20 to 21° AngleRotate, Speed max pwm 240. The real rotation was >90°.
By reducing Speed max pwm to 200, I got a real rotation of about 70°
Best Regards
Jens
Screenshot_20220718-215812.png
 
Oben