Umfrage Odometrie

Hi Reiner.

i view exactly the same thing and can't make the compass of the IMU work correctly.
It work out of the mower on a breadboard but not into the mower and the compass of my Samsung mobile phone show exactly the same problem near the mower.

So for the moment i don't use IMU.

Thanks.
 
Hi Boilevin,

I try to test your code on weekend with the shop motors in my mower.
Maybe the magnetic fields from the motors are the reason for your problems with IMU.
I have a piece of mumetall wrapped around the motors. It seems to work better.

kind regards
Reiner
 
Thanks Reiner.
What is mumetal ?
Agree with you for the magnetics field but I read the IMU compass with the motor OFF or ON ,no change maybee the problem is the Calibration .
I think i try again but it's difficult to find a good explanation in English of the compass calibration.

Anyway the IMU is not necessary for me because the ODO work so why (ODO and IMU).
Better is (ODO or IMU) and good tracking Wheel (no slips).
Maybee in sunray the two option can help but i'm not certain.

For me the IMU is better with high slope in area when the Wheel slips but in this case the mowing area is destroy by the Wheel so !!!.

If you use the two option in your mower can you tell me if there is a difference between with or whithout IMU use ?

Thanks if you can test the code and the 'c' option at low speed.

By.
 
So ich habe heute mal die letzte Version aus dem GIT aufgspielt. Damit läuft er jetzt ohne Odometriefehle aber
er fährt nicht geradeaus.

Ich habe ihn mal ca 11 mtr geradeaus fahren lassen. Dabei viel mir dann auf das die Odometrie, mir genau die Kurve Anzeigt. Odometrie Zähler Links 4320 Rechts 4387 da reichen dann meine Ticks wohl nicht aus um das auzugleichen.

r läuft jetzt auch stabil mit dem IMU zusammen, allerdings sind da die Bögen die er fährt noch stärker.

Bei der Gelegenheit fand ich es Nervig, jedesmal mower.cpp anpassen zu müssen. Deswegen habe ich mal die ganze Konfiguration in eine config-mower.h ausgelagert. Lief den ganzen Nachmittag ohne Auffälligkeiten.

Hat den Vorteil, das man die config-mower.h einfach nur in die nächste Version kopieren muss und alle Einstellungen hat.



Ich hoffe ich hab das diff richtig erstellt. Wenn es euch gefällt könnt ihr es ja vielleicht aufnehmen.

Stefan
 
Hello Boilevin,

this is the result of your test "c" in my mower:


Code:
Non stop 1 Meter       PWM = 75.00  left=1  right=1 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = 75.00  left=11  right=12 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = 75.00  left=25  right=27 Left Cible 2120 Right Cible 2120
...
Non stop 1 Meter       PWM = 75.00  left=2061  right=2078 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = 75.00  left=2077  right=2095 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = 75.00  left=2094  right=2111 Left Cible 2120 Right Cible 2120
Stop Right wheel
Non stop 1 Meter       PWM = 75.00  left=2114  right=4 Left Cible 2120 Right Cible 2120
Stop left wheel
Non stop 1 Meter       PWM = -75.00  left=4  right=1 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=4  right=-12 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=4  right=-28 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=4  right=-44 Left Cible 2120 Right Cible 2120
...
Non stop 1 Meter       PWM = -75.00  left=4  right=-622 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=4  right=-638 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=4  right=-654 Left Cible 2120 Right Cible 2120
Restart Right
Non stop 1 Meter       PWM = -75.00  left=2  right=-673 Left Cible 2120 Right Cible 2120
Restart left
Non stop 1 Meter       PWM = -75.00  left=-14  right=-693 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=-31  right=-709 Left Cible 2120 Right Cible 2120
Non stop 1 Meter       PWM = -75.00  left=-47  right=-726 Left Cible 2120 Right Cible 2120


Do you have higher differences between the two wheels?
 
Hallo Stefan,
bei mir sieht der ODO Plot in der PfodApp so aus:

Screenshot_2016-10-15-14-28-12.png

Attachment: https://forum.ardumower.de/data/media/kunena/attachments/3561/Screenshot_2016-10-15-14-28-12.png/
 
Zuletzt bearbeitet von einem Moderator:
Hi reiner
Thanks for the test.
In fact in this test i want the mower to move in straight line (Forward reverse forward reverse etc.....)

I add the millis in the console to understand.

it's this 3 lines.


Code:
if ((odometryLeft != lastLeft) || (odometryRight != lastRight)) {
      Console.print(F("Time = "));
      Console.print(millis());
      Console.print(F("  "));
      if (testCurrent == 'f') Console.print(F("Non Stop Forward       "));


My result is.


Code:
Time = 19320  Non stop 1 Meter        PWM = 76.00  left=1360  right=1419 Left Cible 1439 Right Cible 1439
Time = 19349  Non stop 1 Meter        PWM = 76.00  left=1371  right=1429 Left Cible 1439 Right Cible 1439
Time = 19377  Non stop 1 Meter        PWM = 76.00  left=1379  right=1439 Left Cible 1439 Right Cible 1439
Stop Right wheel
Time = 19404  Non stop 1 Meter        PWM = 76.00  left=1389  right=-3 Left Cible 1439 Right Cible 1439
Time = 19436  Non stop 1 Meter        PWM = 76.00  left=1399  right=-3 Left Cible 1439 Right Cible 1439
Time = 19464  Non stop 1 Meter        PWM = 76.00  left=1407  right=-3 Left Cible 1439 Right Cible 1439
Time = 19490  Non stop 1 Meter        PWM = 76.00  left=1417  right=-3 Left Cible 1439 Right Cible 1439
Time = 19518  Non stop 1 Meter        PWM = 76.00  left=1426  right=-3 Left Cible 1439 Right Cible 1439
Time = 19546  Non stop 1 Meter        PWM = 76.00  left=1435  right=-3 Left Cible 1439 Right Cible 1439
Stop left wheel
Time = 19584  Non stop 1 Meter        PWM = -76.00  left=-2  right=-5 Left Cible 1439 Right Cible 1439
Time = 19604  Non stop 1 Meter        PWM = -76.00  left=-2  right=-11 Left Cible 1439 Right Cible 1439
Time = 19632  Non stop 1 Meter        PWM = -76.00  left=-3  right=-19 Left Cible 1439 Right Cible 1439
Time = 19658  Non stop 1 Meter        PWM = -76.00  left=-3  right=-27 Left Cible 1439 Right Cible 1439
Time = 19686  Non stop 1 Meter        PWM = -76.00  left=-3  right=-35 Left Cible 1439 Right Cible 1439
Time = 19714  Non stop 1 Meter        PWM = -76.00  left=-3  right=-43 Left Cible 1439 Right Cible 1439
Time = 19740  Non stop 1 Meter        PWM = -76.00  left=-3  right=-51 Left Cible 1439 Right Cible 1439


As you can see the Right motor stop 169 ms before the left one so the mower didn't make a straight line.
I view you have a better result with your motor.

I think i try to add an offset in the code to help the 2 motors to have exactely the same speed at same PWM so it's help the PID.compute
I also change the test to restart the motor only when the 2 motor are stopped.

Thanks.
 
Hi.
I also test the Odometry 2D but in my case after 5 minutes the result is not the copy of the real path of the mower in the mowing area (Whithout IMU).
Hope for you it's correct but not sure ??
By.
 
Da mein Mower sich ja beim Fahren mit Odometry immer noch merkwürdig verhält, er fährt einen Bogen und wenn er auf die Schleife trifft, versucht er sich in die Ursprüngliche Richtungs auszurichten in dem er eine anhält und dann eine kleine drehung macht.

Um dem Verhalten weiter auf dem Grund zu gehen habe ich mir die Werte :
Console.print(F("Odo left right tick "));
Console.print(ticksLeft);
Console.print(F(" "));
Console.print(ticksRight);
Console.print(F("Odo left right cm "));
Console.print(left_cm);
Console.print(F(" "));
Console.println(right_cm);
aus der void Robot::calcOdometry()
ausgeben lassen und erwartungsgemäß ist die Strecke rechts größer als links.

Um weiter zu suchen woran das liegt ist mir aufgefalle aus der Interrupt zwei mal definiert wird ?

Einmal in der mega.cpp

Code:
ISR(PCINT2_vect, ISR_NOBLOCK){
  unsigned long timeMicros = micros();
  boolean odometryLeftState = digitalRead(pinOdometryLeft);
//  boolean odometryLeftState2 = digitalRead(pinOdometryLeft2);
  boolean odometryRightState = digitalRead(pinOdometryRight);  
//  boolean odometryRightState2 = digitalRead(pinOdometryRight2);  
  boolean motorMowRpmState = digitalRead(pinMotorMowRpm);
  robot.setOdometryState(timeMicros, odometryLeftState, odometryRightState, odometryLeftState2, odometryRightState2);   
  robot.setMotorMowRPMState(motorMowRpmState);  
}


und in der mower.cpp


Code:
ifdef __AVR__
  // Neu Alex: 06.10.16
  volatile byte oldOdoPins = 0;
  ISR(PCINT2_vect, ISR_NOBLOCK)
  {
    const byte actPins = PINK;                				// read register PINK
    const byte setPins = (oldOdoPins ^ actPins);
    if (setPins & 0b00010000)                 				// pin left has changed 
    {
      if (robot.motorLeftPWMCurr >= 0)						// forward
        robot.odometryLeft++;
      else
        robot.odometryLeft--;									// backward
    }
    if (setPins & 0b01000000)                  				// pin right has changed
    {
      if (robot.motorRightPWMCurr >= 0)
        robot.odometryRight++;								// forward
      else
        robot.odometryRight--;								// backward
    }  
    oldOdoPins = actPins;
  }

#else


Ist das richtig so ?
 
Hi Stephan.
I think that if in config.h you choose
#define USE_MOWER
and not
//#define USE_MEGA or MINI

The Mega.cpp is never call.
To be sure you can remove the Mega.h and the Mega.cpp from your sketch and try to test.

By
 
Hi Stefan, Hi Boilevin,

yes the mega.cpp is never call.
In the current GIT version, the mega.cpp is no longer included.

@Stefan:
Es ist ja eigentlich auch Aufgabe der Regelung die unterschiedlichen Geschwindigkeiten der Räder auszuregeln.
Vielleicht reichen bei Dir tatsächlich die Anzahl der Impulse nicht aus... Alexander hat da mal was zu geschrieben.

Ich denke auch nicht das man das 100% "weggeregelt" bekommt. Denn um etwas auszuregeln brauche ich erst einmal eine Regeldifferenz. Mit dieser Regeldifferenz fahre ich aber schon eine Kurve => anderer Kurs. Den kann ich ohne Kompass auch nicht mehr korrigieren.
Also muss diese Regeldifferenz so klein sein, dass sie uns nicht mehr stört = viele Impulse = genaue Drehzahl ermitteln.

Man möge mich korrigieren wenn ich da falsch liege. B)

VG
Reiner
 
Das die mega.cpp nicht aufgerufen wird hatte ich nicht gesehen.

Mit der zu kleinen Regeldifferenz war auch meine Vermutung. Deswegen hatte ich ja die Ausgabe, wie oben geschrieben mal bei mir eingefügt. Hier ist das Ergebniss :


Code:
t     3 l 78 v0 FORW odo 2141 1084 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 15 cm 4.17
Odo right tick 16 cm 4.44
Odo left tick 48 cm 13.33
Odo right tick 50 cm 13.89
Odo left tick 53 cm 14.72
Odo right tick 51 cm 14.17
Odo left tick 52 cm 14.44
Odo right tick 53 cm 14.72
 t     4 l 77 v0 FORW odo 2308 1253 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 56 cm 15.56
Odo right tick 57 cm 15.83
Odo left tick 53 cm 14.72
Odo right tick 58 cm 16.11
Odo left tick 56 cm 15.56
Odo right tick 56 cm 15.56
 t     5 l 77 v0 FORW odo 2489 1438 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 59 cm 16.39
Odo right tick 58 cm 16.11
Odo left tick 61 cm 16.94
Odo right tick 58 cm 16.11
Odo left tick 58 cm 16.11
Odo right tick 58 cm 16.11
 t     6 l 78 v0 FORW odo 2681 1629 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 55 cm 15.28
Odo right tick 59 cm 16.39
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
Odo left tick 56 cm 15.56
Odo right tick 58 cm 16.11
Odo left tick 56 cm 15.56
Odo right tick 57 cm 15.83
 t     7 l 78 v0 FORW odo 2867 1822 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 58 cm 16.11
Odo right tick 58 cm 16.11
Odo left tick 55 cm 15.28
Odo right tick 58 cm 16.11
Odo left tick 55 cm 15.28
Odo right tick 58 cm 16.11
pfod cmd= 
pfod cmd=r
 t     8 l 78 v0 FORW odo 3053 2016 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 53 cm 14.72
Odo right tick 57 cm 15.83
Odo left tick 54 cm 15.00
Odo right tick 54 cm 15.00
Odo left tick 56 cm 15.56
Odo right tick 56 cm 15.56
 t     9 l 78 v0 FORW odo 3234 2201 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 55 cm 15.28
Odo right tick 58 cm 16.11
Odo left tick 55 cm 15.28
Odo right tick 58 cm 16.11
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
 t    10 l 78 v0 FORW odo 3415 2390 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 61 cm 16.94
Odo right tick 62 cm 17.22
Odo left tick 54 cm 15.00
Odo right tick 57 cm 15.83
Odo left tick 57 cm 15.83
Odo right tick 59 cm 16.39
Odo left tick 52 cm 14.44
Odo right tick 53 cm 14.72
 t    11 l 78 v0 FORW odo 3595 2576 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 57 cm 15.83
Odo right tick 59 cm 16.39
Odo left tick 54 cm 15.00
Odo right tick 55 cm 15.28
Odo left tick 54 cm 15.00
Odo right tick 56 cm 15.56
 t    12 l 77 v0 FORW odo 3776 2762 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 55 cm 15.28
Odo right tick 56 cm 15.56
Odo left tick 52 cm 14.44
Odo right tick 56 cm 15.56
Odo left tick 54 cm 15.00
Odo right tick 56 cm 15.56
pfod cmd= 
 t    13 l 78 v0 FORW odo 3952 2946 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
pfod cmd=r
Odo left tick 54 cm 15.00
Odo right tick 56 cm 15.56
Odo left tick 55 cm 15.28
Odo right tick 55 cm 15.28
Odo left tick 55 cm 15.28
Odo right tick 56 cm 15.56
Odo left tick 56 cm 15.56
Odo right tick 54 cm 15.00
 t    14 l 78 v0 FORW odo 4134 3128 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 57 cm 15.83
Odo right tick 57 cm 15.83
Odo left tick 55 cm 15.28
Odo right tick 56 cm 15.56
Odo left tick 54 cm 15.00
Odo right tick 56 cm 15.56
 t    15 l 76 v0 FORW odo 4318 3314 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 55 cm 15.28
Odo right tick 55 cm 15.28
Odo left tick 56 cm 15.56
Odo right tick 56 cm 15.56
Odo left tick 57 cm 15.83
Odo right tick 59 cm 16.39
 t    16 l 78 v0 FORW odo 4500 3500 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 54 cm 15.00
Odo right tick 57 cm 15.83
Odo left tick 56 cm 15.56
Odo right tick 57 cm 15.83
Odo left tick 56 cm 15.56
Odo right tick 53 cm 14.72
 t    17 l 78 v0 FORW odo 4683 3682 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 56 cm 15.56
Odo right tick 56 cm 15.56
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
Odo left tick 56 cm 15.56
Odo right tick 55 cm 15.28
Odo left tick 55 cm 15.28
Odo right tick 54 cm 15.00
 t    18 l 77 v0 FORW odo 4865 3864 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
pfod cmd= 
pfod cmd=r
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
Odo left tick 55 cm 15.28
Odo right tick 56 cm 15.56
Odo left tick 51 cm 14.17
Odo right tick 57 cm 15.83
 t    19 l 78 v0 FORW odo 5042 4051 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 57 cm 15.83
Odo right tick 57 cm 15.83
Odo left tick 56 cm 15.56
Odo right tick 52 cm 14.44
Odo left tick 56 cm 15.56
Odo right tick 55 cm 15.28
 t    20 l 76 v0 FORW odo 5227 4229 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 58 cm 16.11
Odo right tick 58 cm 16.11
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
Odo left tick 55 cm 15.28
Odo right tick 55 cm 15.28
Odo left tick 55 cm 15.28
Odo right tick 55 cm 15.28
 t    21 l 77 v0 FORW odo 5407 4412 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 53 cm 14.72
Odo right tick 57 cm 15.83
Odo left tick 55 cm 15.28
Odo right tick 57 cm 15.83
Odo left tick 53 cm 14.72
Odo right tick 53 cm 14.72
 t    22 l 77 v0 FORW odo 5585 4595 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 56 cm 15.56
Odo right tick 56 cm 15.56
Odo left tick 56 cm 15.56
Odo right tick 59 cm 16.39
Odo left tick 54 cm 15.00
Odo right tick 55 cm 15.28
 t    23 l 78 v0 FORW odo 5767 4781 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 54 cm 15.00
Odo right tick 55 cm 15.28
pfod cmd= 
Odo left tick 52 cm 14.44
Odo right tick 54 cm 15.00
Odo left tick 48 cm 13.33
Odo right tick 46 cm 12.78
 t    24 l 78 v0 FORW odo 5936 4951 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 55 cm 15.28
Odo right tick 54 cm 15.00
pfod cmd=r
Odo left tick 52 cm 14.44
Odo right tick 58 cm 16.11
Odo left tick 59 cm 16.39
Odo right tick 53 cm 14.72
Odo left tick 57 cm 15.83
Odo right tick 59 cm 16.39
 t    25 l 78 v0 FORW odo 6120 5138 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 58 cm 16.11
Odo right tick 59 cm 16.39
Odo left tick 55 cm 15.28
Odo right tick 52 cm 14.44
Odo left tick 57 cm 15.83
Odo right tick 56 cm 15.56
 t    26 l 76 v0 FORW odo 6305 5321 spd   42   42    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 per r
 
Odo left tick 59 cm 16.39
Odo right tick 59 cm 16.39
Odo left tick 56 cm 15.56
Odo right tick 59 cm 16.39
 t     0 l 78 v0 POUTREV odo 6444 5461 spd  -33  -33    0 sen    0    0    0 bum    0    0 dro    0    0 son   0 yaw 122 pit  -2 rol  -1 pr


Es sind sschon deutliche Unterschiede zwischen rechts und links, kann aber sein das die Differenz, zum regeln nicht ausreicht, noch dazu das die Werte immer wieder zurück gesetzt werden, wodurch sich die, bei mir zu kleine Differenz,, zum regeln nicht ausreicht.

Ich verwende ja One Way Odometry, ich werde mal versuchen, den zweiten Kanal mit auf den ersten aufzuschalten, damit er mehr Werte erhält.
 
Hi Stefan,

wie sind den Deine Reglerparameter (P, I, D) vom Motor? Hast Du damit mal gespielt.

Bei Dir ist der gefahrene Bogen immer in die gleiche Richtung stimmts?

Kannst Du mal die Motoren tauschen? Rechter Motor inkl. Encoder nach links / linker Motor inkl. Encoder nach rechts. Und Anschlüsse vom Motor und ODO tauschen.
Das dürfte eigentlich keinen Einfluss haben, es sei denn mit den Encodern stimmt was nicht. Dann sollte der Bogen in die andere Richtung gehen.

VG
Reiner
 
Hi Stephan.
I think the ODO is not your problem, you need to check the motor parameter.

The main test.
Disable the IMU.
Enable the ODO.

More easy with The 2 Wheels free (not on the ground) .

With PFOD (hope you use it).
Go to Manual, set motor forward to make the PID working and don't stop it.
Go to Setting Motor , verify that Speed l,r are under the Speed max in pwm (for example Speed l,r 100.00,110.00 and Speed max in pwm need to be at min 130 to allow the PID work)

Set the Speed max in pwm just upper the Speed l,r value to smooth the move of the robot ,because when the mower rotate it use PWM Max and not The RPM max

If the PWM is near 250 you need to reduce the Speed max in rpm (42 is fast so maybee the pwm is 255 and the PID can't work).

Check also the Power by manualy breaking a wheel (the Power increase but need to stay under Maximum).

Go to Setting Odometry and verify that the two value of Odo are the same and increase in continue.

If all this is correct normaly the mower move in straight line.

Hope it can Help
 
@Rainer da es gebraucht Motoren sind, gehe ich auch davon aus die Kurve von Unterschieden in den Motoren kommt. Die Motoren sind aber identisch.

Ich werde erst mal Bolivens Tip probieren.

@Boliven
Thanks for you advise, that makes sens if the motor can't step up if it is to pwm ist to High so it cant regulate it.
I will try it at the Weekend.

I think it is important for other how have Problems with the odometry
 
With Wifi Shield i can look from the Living Room to the Mower :)

Max Power is set to 9,5 that works great.
Speed map rpm is 38
Speed max in pwn is 157
Accel 1516 i dont know what that is ?
RPM_P 0,92
RPM_I 0,18
RPM_D 0,14

When motor is running Speed l,r 143-146, 133-144
if try to set the Max pwm to 183 and will see if it better.

Sorry for my english ;)
 
Ich habe die ganze Zeit mein Augenmerk auf die Odometrie gerichtet, dabei aber ausser acht gelassen, das dem gleichen Interrupt auch die die Drehzahlmessung für die Messer Modulation hängt. Selbst wenn ich diese in der Konfiguration deaktivieren, wird Sie trotzdem im Code eingebunden und löst dann 50 Interrupts in Sekunde aus.

Ich werde das mal rausnehmen und weiter Probieren ob dann die Odometrie besser läuft.
 
Hi Stephan.
I am going to view your post and No problem with your english.
All param are correct ;) .
What is the exact problem of your ODO :dry: .
Did you try the code of my precedent post to test ODO 1 ml 5 ml Rotate etc...

I think The Accel (Acceleration) is use when you don't have Odometry so not for You.
In code you can find it in Robot.cpp in motorControl() the setMotorPWM( leftSpeed, rightSpeed, false or True ) . if ODO is used we don't use accel and if not we use accel.

For the diff in Rpm and PWM.
The rpm value (38 for you associate with a PWM>146) is use in FORWARD mode with odo and PID to be sure the mower goes in straight line.
The max PWM value (157 or 183) make a change only in Reverse or Roll or perimeter tracking but not in Forward.
If you put 255 the problem is that the mower roll or reverse very fast and go forward slowly(38Rpm)
If you put less than 146 the PID in Forward mode don't work well and the 38Rpm is never reach.

Hope you understand.

By


Google translate (maybe correctly :lol: )

Hallo Stephan.
Ich werde Ihren Beitrag zu sehen und kein Problem mit Ihrem Englisch.
Alle Parameter sind korrekt.
Was ist das genaue Problem Ihrer ODO.
Haben Sie versuchen, den Code meines Präzedenzfall Post zu testen ODO 1 ml 5 ml drehen etc ...

Ich denke, dass die Beschleunigung (Beschleunigung) Gebrauch ist, wenn Sie nicht Odometry also nicht für Sie haben.
In Code finden Sie es in Robot.cpp in motorControl () die setMotorPWM (leftSpeed, rightSpeed, false oder True). Wenn ODO verwendet wird, verwenden wir nicht accel und wenn nicht wir verwenden accel.

Für die diff in RPM und PWM.
Der Drehzahlwert (38 für die Verbindung mit einem PWM> 146) wird im FORWARD-Modus mit odo und PID verwendet, um sicherzustellen, dass der Mäher in gerader Linie geht.
Der maximale PWM-Wert (157 oder 183) ändert sich nur im Reverse- oder Roll- oder Perimeter-Tracking, nicht aber im Forward.
Wenn Sie setzen 255 das Problem ist, dass der Mäher rollen oder umgekehrt sehr schnell und nach vorne langsam (38Rpm)
Wenn Sie weniger als 146 die PID in Forward-Modus nicht gut funktionieren und die 38Rpm ist nie zu erreichen.

Ich hoffe du verstehst.

Durch
 
Oben