Arctic Hare mod by Jussi

I'll try again.. IMU front of pcb box
What do perimeter mowing in timer? Mow trough perimeter and stop?
2019-05-2615.22.33.jpg

Attachment: https://forum.ardumower.de/data/media/kunena/attachments/4741/2019-05-2615.22.33.jpg/
 
Zuletzt bearbeitet von einem Moderator:
Yes but not dev for the moment .
The easy part:
Leave station now the full perimeter wire by skiping rfid tag and record the distance .
More complex
Again but at 30cm inside the area with the previous distance
 
My friend has commercial mower (robomow I think) and it mowes once per week along wire. It does nothing else than tracking whole wire with blades running and go back to station
 
Rfid PN5180 connected to ESP32 show a perfect result Inside the mower with drive and Wheel motor (15 CM reading distance):)
The perimeter is not perturbate at all so for the moment all is OK and this solution can work Inside your platform.;)
Next step is to connect the ESP to Raspberry using USB and see if the USB power is OK for all (normaly easy) and find Iso15693 tag.
It's also possible to connect the ESP32 directly to PCB1.3,but need change in the code (maybe later if i have time) and the code is already OK in the raspberry.
Connect directly reader to Raspberry (not Ok for me because the screen) and can't find Pi library.
Connect directly reader to DUE (not OK because reading duration is 50ms and it's not possible while tracking)


For your Compass avoid the metal screw to fix it (i use adhesive VELCRO).
 
I'm allready printing new sensor box with place for imu. Place is just above perimeter box, should be working much better there.

PN5180 is wirelessly connected to esp32?
 
It is SPI with only wire and no other component. But 9 wires.
See it at 17:30
I have tested all the other module and none of them are OK in reading distance or frequency.
https://m.youtube.com/watch?v=98GXrixOM4c
 
Something happen and now compass show only 'nan'. It was working and I tried recalibrate it in new place and now it wont work.
Pitch and roll are correct, yaw's not

Code:
19:49:59 Calibration address Stop = 650
19:49:59 Calibration address Start = 600
19:49:58 Save Calibration
19:49:58 com calib completed
19:49:46 x:737.00,804.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:46 x:737.00,803.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:46 x:737.00,802.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:46 x:737.00,801.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:46 x:737.00,800.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,797.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,796.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,795.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,791.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,775.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,768.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:45 x:737.00,763.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:44 x:737.00,741.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:32 x:738.00,741.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:26 x:738.00,740.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:26 x:739.00,740.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:26 x:739.00,739.00	  y:-4096.00,-4096.00	  z:-4096.00,-4096.00	
19:49:26 rotate sensor 360 degree around all three axis until NO new data are coming
19:49:26 com calib...
 
nan is value out of range so maybe a very bad calibration can do this ??
Use Pfod to start the compass calib and Try to delete the calib before.
Into pfod.cpp add g20 to delete calib and reboot before restart calib

Code:
serialPort->print(F("|g18~Accel Gyro Initial Calibration more than 30sec duration"));
  serialPort->print(F("|g19~Compass calibration click to start and again to stop"));
  //bber18
  serialPort->print(F("|g20~Delete Compass calibration"));
  
  serialPort->println("}");


and

Code:
else if (pfodCmd == "g19") robot->imu.calibComStartStop();
  //bber18
  else if (pfodCmd == "g20") robot->imu.deleteCompassCalib();  
  sendImuMenu(true);


I try tomorrow in my mower to see if it's work but i never have this kind of error
Is the IMU is orientate like before ?
 
It's Strange.
My test is OK.
Here the arduino ide console result of
start up
Delete compass calib
Compass calib
Gyro accel calib.

Reboot
After into Pfod Result of 4 times 90 deg rotation show
Gyro / Compass
-178.19 / -178.80
-88.28 / -101.68
3.36 / -18.39
93.54 /82.46
-178.3 /-178.26


Are you sure the JC2 is OK.

You need to check the startup part from IMU initialisation to IMU ready.

And show your Console result.
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/3545/consoleGY88.txt/
 
Zuletzt bearbeitet von einem Moderator:
How I get startup to console? Now raspberryuse is false and arduinoIDE serial console open on serialUSB port but nothing comes until I press d for menu or v for sensor values
Got it.. had to be quick enough :)

Code:
--> ++++++++++++++++++++++++++++++++++* Start Robot Setup at 3292 --> +++++++++++++++++++++++++++
Load ErrorCounters
ErrorCounters address Start=500
ErrorCounters address Stop=522
Load EEprom User Setting
UserSettings address Start=2000
UserSettings address Stop=2514
Load Robot Stats
Robot Stats address Start = 800
Robot Stats address Stop = 826
--------------------------------- IMU INITIALISATION -------------------
COMPASS HMC5883L ID NEED TO BE 72 IF ALL IS OK ------>  ID=72
IMU: found calib data
Load Calibration
Calibration address Start = 600
Calibration address Stop = 650
-------- IMU CALIBRATION  --------
ACCEL GYRO MPU6050 OFFSET ax: -3515 ay: 292 az: 1902 gx: 119 gy: 22 gz: -14
COMPASS OFFSET X.Y.Z AND SCALE X.Y.Z   --> comOfs=649.50,-2879.00,-4096.00
comScale=937.00,2434.00,0.00
.
MPU6050 connection successful
Initializing DMP...
Enabling DMP...  Packet size 42
Wait 3 secondes to stabilize the Drift
AccelGyro Yaw: -0.01  Compass Yaw: nan  Diff between compass and accelGyro in Radian and Degnan / nan
--------------------------------- IMU READY ------------------------------
START
Ardumower 1.1-Azurit-ber
Config: LawnMower
press...
  d for menu
  v to change console output (sensor counters, values, perimeter etc.)
off

        Free memory is :   81855
 
arduinoIDE serial console open on serialUSB
It's normal if you have not change the mower.h console def.

My config:
Programing Due USB is out of the mower and i connect my PC to update the code or test ,but when i want to see the console i need to swap the console define into mower.h

Code:
#define Console Serial
#define CONSOLE_BAUDRATE    115200       // baudrate used for PC
//#define Console SerialUSB
//#define CONSOLE_BAUDRATE    250000       // baudrate used for Raspberry PI console


NATIVE USB is connected on the PI
 
Calibration goes this way

Code:
AccelGyro calibration deleted 
Reading sensors for first time... without any offset
Reading ax: 30769 ay: -2608 az: -242 gx: -60 gy: -13 gz: 9

Calculating offsets...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
Wait ...
FINISHED reading Value with new offset,If all is OK need to be close 0 exept the az close to 16384 New reading ax: 6 ay: -1 az: 16379 gx: -1 gy: -1 gz: 1
THE NEW OFFSET ax: -3515 ay: 295 az: 1901 gx: 119 gy: 24 gz: -14
Save Calibration
Calibration address Start = 600
Calibration address Stop = 650
Compass calibration deleted
com calib...
rotate sensor 360 degree around all three axis until NO new data are coming
x:896.00,896.00	  y:-1992.00,-1992.00	  z:-4096.00,-4096.00	
x:896.00,896.00	  y:-1993.00,-1992.00	  z:-4096.00,-4096.00	
x:895.00,896.00	  y:-1993.00,-1992.00	  z:-4096.00,-4096.00	
x:895.00,896.00	  y:-1994.00,-1992.00	  z:-4096.00,-4096.00	
x:895.00,897.00	  y:-1994.00,-1992.00	  z:-4096.00,-4096.00	
x:895.00,897.00	  y:-1995.00,-1992.00	  z:-4096.00,-4096.00	
x:895.00,897.00	  y:-1996.00,-1992.00	  z:-4096.00,-4096.00	
x:894.00,897.00	  y:-1996.00,-1992.00	  z:-4096.00,-4096.00	
x:894.00,897.00	  y:-1997.00,-1992.00	  z:-4096.00,-4096.00	
x:894.00,897.00	  y:-1999.00,-1992.00	  z:-4096.00,-4096.00	
x:893.00,897.00	  y:-1999.00,-1992.00	  z:-4096.00,-4096.00	
x:892.00,897.00	  y:-1999.00,-1992.00	  z:-4096.00,-4096.00	
x:838.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:835.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:834.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:827.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:177.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:176.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:175.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:172.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:166.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:158.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:151.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:101.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:99.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:97.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:96.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:93.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:92.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:88.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:75.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:72.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:70.00,897.00	  y:-4096.00,-1992.00	  z:-4096.00,-4096.00	
x:70.00,897.00	  y:-4096.00,-1990.00	  z:-4096.00,-4096.00	
x:70.00,1210.00	  y:-4096.00,-1990.00	  z:-4096.00,-4096.00	
x:70.00,1218.00	  y:-4096.00,-1990.00	  z:-4096.00,-4096.00	
x:70.00,1218.00	  y:-4096.00,-1489.00	  z:-4096.00,-4096.00	
x:70.00,1218.00	  y:-4096.00,-1480.00	  z:-4096.00,-4096.00	
x:70.00,1218.00	  y:-4096.00,-1476.00	  z:-4096.00,-4096.00	
com calib completed
Save Calibration
Calibration address Start = 600
Calibration address Stop = 650
-------- IMU CALIBRATION  --------
ACCEL GYRO MPU6050 OFFSET ax: -3515 ay: 295 az: 1901 gx: 119 gy: 24 gz: -14
COMPASS OFFSET X.Y.Z AND SCALE X.Y.Z   --> comOfs=644.00,-2786.00,-4096.00
comScale=1148.00,2620.00,0.00
.
 
It's the compass, Don't need more calib on Gyro.
The calibration with -4096 is really Strange.
Can you try to move only the IMU out of the mower during calibration to check if it's not magnet or metal near the compass.
 
The error is in the comScale.z, value 0 can 't work because it's use later with a division
So it's div/0--> nan result

z /= comScale.z * 0.5;

Maybe try to not reboot after delete calibration
 
I thing there is bug in the calib parts of the code.
missing the compass init value here so try to add them by this way .

Code:
void IMUClass::loadCalib() {
  short magic = 0;
  int addr = ADDR;
  eeread(addr, magic);
  if (magic != MAGIC) {
    Console.println(F("IMU error: no calib data"));
    ax_offset=376;
    ay_offset=-1768;
    az_offset=1512;
    gx_offset=91;
    gy_offset=12;
    gz_offset=-2;
    comOfs.x = comOfs.y = comOfs.z = 0;
    comScale.x = comScale.y = comScale.z = 2;
    useComCalibration = false;
    return;
  }
  calibrationAvail = true;
  useComCalibration = true;
  Console.println(F("IMU: found calib data"));
  loadSaveCalib(true);
}


For the IMU location be carreful on the front wheel metal axes.To check rotate the Wheel witout move mower to see if compass is affected.
 
IMU moved to other side of the box and seems to be working now. I can't figure out why but now I don't touch it anymore :D
 
Btw when i check the code it is not ok to have a value 0 here, so certainly there is a bug in the initilisation variable before start calibration.
And maybe i tell you something wrong when reboot after delete calibration. Possible it was OK if restart calib immediatly after delete calib without rebooting.
The issue is that now you certainly can not reproduce the bug condition, so it is difficult to understand exactly what 's appened
 
Oben