Raindancer Firmware (English): Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(config.h)
(Overview)
 
(95 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
!!! I am currently translating this side. !!!
+
Folks, English is not my native language. If you don't understand something or find a mistake, please inform me on the forum (name: Roland) or correct the mistake by yourself. Thank you very much.
  
 +
 +
'''This documentation is for firmware version 2.x.x.'''
 +
 +
 +
'''The documentation of version 1.1.1 you can find here [[Raindancer Firmware V1.x.x (English) | Raindancer Firmware V1.1.1]]'''
  
  
Attention! The software is still changing and can be changed / extended at any time.
 
  
 
=Download=
 
=Download=
 
[https://github.com/Ardumower/Raindancer Github Download]
 
[https://github.com/Ardumower/Raindancer Github Download]
  
(Auf Github mit dem grünen Button das Zip-File herunterladen)
+
(On Github download the Zip-File with the green button)
  
 
The Raindancer firmware is located in the directory code\Raindancer
 
The Raindancer firmware is located in the directory code\Raindancer
Zeile 17: Zeile 21:
 
The Raindancer firmware is based on the code of the Nucleomower which was realized with the development board STM32 Nuleo 411RE in 2016/2017. The firmware was then converted to Ardumower PCB 1.3 in 2017/2018. It pursues the goal of getting a stable system with as little hardware as possible, which works all year round and provides a good mowing result with the chaos principle.
 
The Raindancer firmware is based on the code of the Nucleomower which was realized with the development board STM32 Nuleo 411RE in 2016/2017. The firmware was then converted to Ardumower PCB 1.3 in 2017/2018. It pursues the goal of getting a stable system with as little hardware as possible, which works all year round and provides a good mowing result with the chaos principle.
  
The firmware has following '' 'Workflow' '':
+
The firmware has the following '' 'Workflow' '':
 
The Mower is in the charging station. The Mower drives from the charging station a predetermined distance along the perimeter to an area and then begins to mow after the chaos principle. The mowing time is approx. 130min-150min with the original Ardumowerkomponents. After the battery voltage has dropped to 23.7V, the robot looks for the perimeter cable and drives it to the charging station. Once in the charging station, the battery is charged. The next mowing operation is restarted via the mobile phone with a range command. (The robot can also be operated without a charging station.)
 
The Mower is in the charging station. The Mower drives from the charging station a predetermined distance along the perimeter to an area and then begins to mow after the chaos principle. The mowing time is approx. 130min-150min with the original Ardumowerkomponents. After the battery voltage has dropped to 23.7V, the robot looks for the perimeter cable and drives it to the charging station. Once in the charging station, the battery is charged. The next mowing operation is restarted via the mobile phone with a range command. (The robot can also be operated without a charging station.)
  
The firmware was developed for robots with the drive motor rear, but can also be used for the original Ardumower chassis. Optimizations for the original Ardumower chassis will be made later. The Mower turns on the perimeter. If a coil has passed over the perimeter cable, the robot will continue driving for approx. 20cm. Then both coils are turned into the loop and from then on it will be further rotated at a random angle. Since the original Ardumower chassis has a short distance between spools and wheels, here is the workaround: In the config.h can be set that the Mower drive back a certain way, then turns a fixed angle (rotation simulated on the perimeter) and after the turning the fixed angle, the random angle is rotated.
+
The firmware was developed for robots with the drive motor rear, but can also be used for the original Ardumower chassis.  
 +
If the mower reaches the perimeter wire it will continue driving for approx. 20cm. Then the rmower drives back and will be further rotated at a random angle.  
  
 
Internally in the firmware, distances are traveled in cm. This means that encoders are needed.
 
Internally in the firmware, distances are traveled in cm. This means that encoders are needed.
  
For the '' 'Perimetererkennung' '' a 128-bit signal is used. Therefore, the Raindancer transmitter (sender) software must be installed on the transmitter. 2 perimeter receivers are needed. As you approach the perimeter cable, the robot slows down.
+
For the '' 'Perimeterrecognition' '' a 128-bit signal is used. Therefore, the Raindancer transmitter (sender) software must be installed on the transmitter. 2 perimeter receivers are needed. As you approach the perimeter cable, the robot slows down.
If the robot does not recognize the signal for 2 seconds, it stops and switches off the motors. If it recognizes the signal again, it continues.
+
If the robot does not recognize the signal for 2 seconds, it stops and switches off the motors. If it recognizes the signal again, it continues. If the perimeter signal is too weak in the middle of the lawn, a GPS area can be configured. If the robot is in this area, it is assumed to be within the perimeter loop.
  
In the current version, the firmware supports a pass through charging station (supporting a single-sided charging station follows at a later date). Using the charging station can be switched off in the software. Then the robot stops at the perimeter when the battery voltage drops below 23.7V. For charging, the robot can then be switched off, connected to the charging cable and switched on again. The robot then goes into charging mode. If the voltage drops below 21.7V, the undervoltage trip will trip if it is not bypassed.
+
The firmware supports a head charging station and a through charging station. Using the charging station can be switched off in the software. Then the robot stops at the perimeter when the battery voltage drops below 23.7V. For charging, the robot can then be switched off, connected to the charging cable and switched on again. The robot then goes into charging mode. If the voltage drops below 21.7V, the undervoltage trip will trip if it is not bypassed.
  
 
With the original motors and wheels, the robot drives at a speed of approx. 1200m / h.
 
With the original motors and wheels, the robot drives at a speed of approx. 1200m / h.
Zeile 37: Zeile 42:
 
The firmware was optimized for '' 'not with the perimeter wire fenced obstacles' '' on the lawn. Instead of driving at full speed against the obstacle, the speed is reduced from a certain distance and drove gently against the obstacle. Prerequisite for this are sonar sensors. This feature is optional.
 
The firmware was optimized for '' 'not with the perimeter wire fenced obstacles' '' on the lawn. Instead of driving at full speed against the obstacle, the speed is reduced from a certain distance and drove gently against the obstacle. Prerequisite for this are sonar sensors. This feature is optional.
 
The robot supports a self-made Bumperduino with two MaxSonar sonar sensors and an MPX5010DP FREESCALE pressure sensor for a pressure wave hose.
 
The robot supports a self-made Bumperduino with two MaxSonar sonar sensors and an MPX5010DP FREESCALE pressure sensor for a pressure wave hose.
  https://github.com/kwrtz/Raindancer/blob/master/DipTrace/DistanceBumperSensor/DistanceBumperSensor.pdf  
+
  https://github.com/Ardumower/Raindancer/tree/master/DipTrace/DistanceBumperSensorDistanceBumperSensor.pdf  
The evaluation is done by an Arduino Nano, which is connected to the PinUserSwitch2 / 3 of the PCB1.3. Upon detection of an obstacle with the sonar sensors, the robot slows down and bumped gently against the obstacle where the bumper or bumper duo triggers.
+
The evaluation is done by an Arduino Nano, which is connected to the PinUserSwitch2 / 3 of the PCB1.3. Upon detection of an obstacle with the sonar sensors, the robot slows down and bumped gently against the obstacle where the bumper or bumper duino triggers.
 
The board is relatively simple. This allows them to be easily soldered together on a laboratory board. The MaxSonar sensors can be omitted and a separate solution can be connected to the Nano.
 
The board is relatively simple. This allows them to be easily soldered together on a laboratory board. The MaxSonar sensors can be omitted and a separate solution can be connected to the Nano.
 
The sensor for the pressure wave hose can be omitted and only the sonar sensor is used. Another option for an approach solution is to expand the current Raindancer software.
 
The sensor for the pressure wave hose can be omitted and only the sonar sensor is used. Another option for an approach solution is to expand the current Raindancer software.
 
The original Ardumower ultrasonic sensors are currently not supported.  
 
The original Ardumower ultrasonic sensors are currently not supported.  
  
The serial interface is used for the operation. On the mobile phone is the software Arduino Central is used (free with advertising or without advertising for a few euros). In Arduino Central, buttons can be configured with commands. The operation is via command line commands. The send line must be terminated with CR. The output is automatic shown on the console or on the mobile phone, depending on where the command was just entered.
+
The serial interface is used for the operation. On the mobile phone is the software Arduino Centrale is used (free with advertising or without advertising for a few euros). In Arduino Centrale, buttons can be configured with commands. The operation is via command line commands. The send line must be terminated with CR. The output is automatic shown on the console or on the mobile phone, depending on where the command was just entered.
 
Most commands are grouped by services. The group corresponds to the services mentioned in the software. The command following the service is then separated by a dot. Spaces are skipped and have no meaning.
 
Most commands are grouped by services. The group corresponds to the services mentioned in the software. The command following the service is then separated by a dot. Spaces are skipped and have no meaning.
 
This is useful when using the mobile phone, where a space is inserted after a period.
 
This is useful when using the mobile phone, where a space is inserted after a period.
Zeile 51: Zeile 56:
  
 
Parameters are separated by a comma.
 
Parameters are separated by a comma.
  Example: pc.cm,60,30       //drives 60 cm with speed 30 (//drives... does not belong to the command)
+
  Example: pc.cm,60,60,30,30 //drives left wheel 60cm at 30% speed and right 60cm at 30% speed (//drives... does not belong to the command)
 
This addresses the Positioncontrol service. Drive 60cm at the speed of 30%
 
This addresses the Positioncontrol service. Drive 60cm at the speed of 30%
  
Zeile 60: Zeile 65:
  
 
The software is modular. The individual modules are hardly influence each otherl. This makes it relatively easy to modify or extend something.
 
The software is modular. The individual modules are hardly influence each otherl. This makes it relatively easy to modify or extend something.
  https://github.com/kwrtz/Raindancer/blob/master/Documentation/SoftwareStructure.pdf
+
  https://github.com/Ardumower/Raindancer/tree/master/Documentation/SoftwareStructure.pdf
 
The UMLET software was used to display and edit the Structure software.
 
The UMLET software was used to display and edit the Structure software.
  
Zeile 72: Zeile 77:
 
  https://www.electronic-software-shop.com/support/kostenlose-datei-viewer/?xoid=oep38ca4ehqn37a7dn3rnrpie6
 
  https://www.electronic-software-shop.com/support/kostenlose-datei-viewer/?xoid=oep38ca4ehqn37a7dn3rnrpie6
 
The files of the BHT are here:
 
The files of the BHT are here:
  https://github.com/kwrtz/Raindancer/tree/master/Documentation
+
  https://github.com/Ardumower/Raindancer/tree/master/Documentation
  
 
The robot knows two modes: Manual and Auto. In manual mode, all services are running, but the Behavior Tree (BHT) is off. In auto mode, the BHT is activated.
 
The robot knows two modes: Manual and Auto. In manual mode, all services are running, but the Behavior Tree (BHT) is off. In auto mode, the BHT is activated.
Zeile 81: Zeile 86:
  
 
If the robot is in MANUAL mode, it can be switched to automode using command A. If the robot then recognizes the perimeter signal, it starts mowing.
 
If the robot is in MANUAL mode, it can be switched to automode using command A. If the robot then recognizes the perimeter signal, it starts mowing.
 
==Open points==
 
* Stability of the software in the long term. Stand 28.04.2018 Currently, the current software version mowed 63h, has traveled 59km and has rotated 8426 times
 
* The line tracking algorithm has been recently optimized for the rear wheel drive chassis. Due to the short distance between coil and the wheels of the original Ardumower chassis, it may be necessary to program another algorithm.
 
* Optimization for the original Ardumower chassis (Mowing works very well with the workaround, if necessary, play with the parameters CONF_PER_CORRECTION_ANGLE and CONF_PERIMETER_DRIVE_BACK_CM)
 
* Dodge objects close to the perimeter (SecondReverse2 in the BHT)
 
* Program one-sided accessible charging station
 
* Use RTC to program start at a defined time
 
 
==Other wishes==
 
* Integrate rain sensor
 
* The charging station is currently only counterclockwise approached.
 
* Amplify the signal of the charging station to + -20V voltage stroke
 
* SRF08 integration
 
* Integrate I2C temperature sensors
 
* An external start / stop button that starts or stops mowing
 
* Approachthe charging station with GPS. Drive 15m before the charging station on the perimeter and then drive into the charging station..
 
* GPS map - the mower may not recognize the signal in the middle of the lawn because the signal is too weak. You can then use GPS to see if you are on the lawn area. If you now say that the signal must be detected at least 15m away from the perimeter, you can neglect the signal within the area if the GPS signal indicates that you are on the lawn.
 
* GPS Map - Note where mower has already mowed. Then mow in less mowed areas if necessary.
 
The GPS card will probably have to be outsourced to an external processor
 
  
 
=For minimum commissioning, the following requirements should be met=
 
=For minimum commissioning, the following requirements should be met=
Zeile 129: Zeile 114:
  
 
Select the chassis form. Only one parameter may be set to true.
 
Select the chassis form. Only one parameter may be set to true.
  #define ARDUMOWER_CHASSIS  false
+
  #define ARDUMOWER_CHASSIS  true
 
  #define PARANELLO_CHASSIS  false
 
  #define PARANELLO_CHASSIS  false
  #define RAINDANCER_CHASSIS true
+
  #define RAINDANCER_CHASSIS false
  
 
In config.h go then to the code section, which belongs to your choice and change this section.
 
In config.h go then to the code section, which belongs to your choice and change this section.
Zeile 162: Zeile 147:
 
  #define CONF_DISABLE_PERIMETER_SERVICE         false  // Disables perimeter sensor
 
  #define CONF_DISABLE_PERIMETER_SERVICE         false  // Disables perimeter sensor
 
  #define CONF_DISABLE_RTC_SERVICE true    // Disables rtc sensor
 
  #define CONF_DISABLE_RTC_SERVICE true    // Disables rtc sensor
  #define CONF_DISABLE_EEPROM_SERVICE true   // Disables EEPROM requests
+
  #define CONF_DISABLE_EEPROM_SERVICE true   // Disables EEPROM requests
  #define CONF_DISABLE_BATTERY_SERVICE         true   // Disables battery sensor
+
  #define CONF_DISABLE_BATTERY_SERVICE         true   // Disables battery sensor
  #define CONF_DISABLE_CHARGE_SERVICE true   // Disables charge system service
+
  #define CONF_DISABLE_CHARGE_SERVICE true   // Disables charge system service
 +
#define CONF_DISABLE_RAIN_SERVICE              true    // Disables rain sensor
 +
#define CONF_DISABLE_DHT_SERVICE              true    // Disables temp sensor
 +
#define CONF_DISABLE_GPS                      true    // Disables GPS service
  
  #define CONF_DISABLE_MOTOR_STALL_CHECK true   // Disables the motor stall/encoder check in closed loop control
+
  #define CONF_DISABLE_MOTOR_STALL_CHECK         true   // Disables the motor stall/encoder check in closed loop control
  #define CONF_DISABLE_MOW_MOTOR         false  // Disables the mow motor
+
  #define CONF_DISABLE_MOW_MOTOR                 false  // Disables the mow motor
  
 
  #define CONF_DISABLE_CHARGINGSTATION    true
 
  #define CONF_DISABLE_CHARGINGSTATION    true
Zeile 185: Zeile 173:
  
 
Enter H here. Thereafter, all available commands are displayed. It is a good ideas to copy and save the commands to a file, so that you can look at it when you need.
 
Enter H here. Thereafter, all available commands are displayed. It is a good ideas to copy and save the commands to a file, so that you can look at it when you need.
 +
 +
If after compilation following warning occure, they can be ignored:
 +
pinman.cpp: 18:0: warning: "PWM_FREQUENCY" redefined [enabled by default]
 +
  #define PWM_FREQUENCY 3900
 +
pinman.cpp: 19:0: warning: "TC_FREQUENCY" redefined [enabled by default]
 +
  #define TC_FREQUENCY 3900
  
 
= QUICK START TO MOW =
 
= QUICK START TO MOW =
  
Ziel dieses Kapitels ist, mit der Bedienung etwas vertrauter zu werden, und den Roboter soweit zu konfigurieren, dass die Perimeter Sensoren
+
The aim of this chapter is to become more familiar with the operation, and to configure the robot to the extent that the perimeter sensors
funktionieren und man innerhalb des Perimeters mähen kann.
+
work and you can mow within the perimeter.
  
Der Roboter ist über das Konsolenkabel verbunden. Speed: 115200
+
The robot is connected via the console cable. Speed: 115200
  
 
==Errorhandling==
 
==Errorhandling==
Wenn die Firmware einen Fehler feststellt, geht diese in den Errormode. Der Mower bleibt stehen und der Mähmotor wird abgeschaltet. Die Services laufen weiter. Der als erstes aufgetretene Error wird gelatched.  
+
If the firmware detects an error, this goes into the Errormode. The Mower stops and the mow motor is switched off. The services continue to run. The first error occurred is latched.
Der Error wird dann alle 2 Sekunden an die Konsole bzw. BT ausgegeben. Je nachdem was als letztes aktiv war oder aktiviert wird durch senden eines Zeichens. Wenn man z.B. den Mower über Bluetooth gestartet hat, wird der Fehler auch auf über BT ausgegeben.
+
The error is then sent to the console or bluetooth (BT) every 2 seconds, depending on what was last active or activated by sending a character. If you has started the mower via Bluetooth, the error is then shown on BT.
  
Zum deaktivieren des Error müssen folgende Befehle nacheinander eingegeben werden:
+
To disable the error, the following commands must be entered one after the other:
 
  reset    //reset error and motor faults
 
  reset    //reset error and motor faults
 
  M        //activate manual mode
 
  M        //activate manual mode
  
Mit dem Befehl error kann sich das Errorlog angezeigt werden. Das Errorlog zeigt die History der durchlaufenen Running Nodes des BHT sowie diverse andere Ereignisse. Es ist 5000 Zeichen groß.
+
The error command can be used to display the error log. The error log shows the history of the traversed running nodes of the BHT as well as various other events. It is 5000 characters tall.
 
  error    //show errormessage
 
  error    //show errormessage
  
Mit dem Befehl show.hist werden die letzten Drehrichtungen und andere Parameter angezeigt.
+
The show.hist command displays the last direction of rotation and other parameters.
 
  show.hist  //show history
 
  show.hist  //show history
Die letzten eingetragenen Werte, werden als erstes ausgegeben, so das diese oben stehen!
+
The last entered values will be displayed first, so that they are above!
 +
 
  
Nach dem deaktivieren des Error kann der Mower wieder mit
+
After disabling the error, the Mower can be started again with:
 
  A
 
  A
gestartet werden. Dabei müssen sich allerdings beide Spulen im Perimeter befinden.
+
However, both coils must be in the perimeter for that.
  
==Zum warm werden: Konfiguration des Batterie Service==
+
==To get warm: Configuration of the battery service==
Der Batterie Service ermittelt die Spannung der Batterie und stellt diese dem BHT zur Verfügung.
+
The battery service determines the voltage of the battery and makes it available to the BHT.
  
In config.h den Batterieservice aktivieren und danach die Software neu aufspielen.
+
Activate the battery service in config.h and then re-install the software.
  
 
  #define CONF_DISABLE_BATTERY_SERVICE false
 
  #define CONF_DISABLE_BATTERY_SERVICE false
  
Den Befehl
+
Enter the command:
bat.show  
+
  bat.show
eingeben. Es sollte die richtige Batteriespannung angezeigt werden.
+
It should display the correct battery voltage.
  
Sollte diese um mehr als 0.2V abweichen, so kann diese mit den Konstanten
+
If this deviates by more than 0.2V, then this can be adjusted with the constants
#define BATTERYFACTOR_BS   11.0f   //Entspricht (100+10)/10 Voltagedivider
+
  #define BATTERYFACTOR_BS 11.0f // Equivalent to (100 + 10) / 10 Voltagedivider
#define DIODEDROPVOLTAGE_BS 0.4f
+
  #define DIODEDROPVOLTAGE_BS 0.4f
justiert werden.
+
These constants are defined in batterySensor.h.
Diese Konstanten sind in batterySensor.h definiert.
+
  
Berechnet wird die Spannung in batterySensor.h folgendermaßen
+
The voltage in batterySensor.h is calculated as follows
  
 
  sensorValue = aiBATVOLT.getVoltage();  
 
  sensorValue = aiBATVOLT.getVoltage();  
 
  float readVolt = sensorValue * BATTERYFACTOR_BS + DIODEDROPVOLTAGE_BS; // The diode sucks 0.4V
 
  float readVolt = sensorValue * BATTERYFACTOR_BS + DIODEDROPVOLTAGE_BS; // The diode sucks 0.4V
  
==Inbetriebnahme der Motoren==
+
== Commissioning of the motors ==
Als erstes wird geprüft ob die Motoren sich drehen und ob diese auch in die richtige Richtung drehen.
+
The first thing to check is whether the motors are turning and whether they are turning in the right direction.
Dazu werden die Motoren direkt mit einer PWM Vorgabe angesteuert. D.h es erfolgt keine Regelung der Geschwindigkeit anhand der Encoder. Die Regelschleife für die Geschwindigkeit ist offen (open loop);
+
For this purpose, the motors are controlled directly with a PWM specification. This means, there is no control of the speed based on the encoder. The speed control loop is open (open loop);
  
Der Befehl clc.mt,1,150 veranlasst den clc Service die eingegebene PWM von 150 direkt an den Motor zu schicken. Maximum für die PWM ist 255.
+
The command clc.mt, 1,150 causes the clc service to send the input PWM of 150 directly to the motor. Maximum for the PWM is 255.
Die 1 steuert den linken Motor an, die 2 den rechten.
+
A 1 controls the left engine, a 2 the right.
  
Den Befehl
+
Enter the command:
 
  clc.mt,1,150  
 
  clc.mt,1,150  
eingeben.
 
  
Damit wird der Motor (1) links direkt mit einer PWM von 150 angesteuert.
+
This activates the motor (1) on the left directly with a PWM of 150.
Gestoppt wird das Rad dann mit
+
The wheel is then Stopped with:
 
  clc.mt,0,0
 
  clc.mt,0,0
  
Das Rad links sollte sich vorwärts drehen. Falls es sich rückwärts dreht muss das Kabel am Stecker umgepolt werden.
+
The wheel on the left should turn forward. If it turns backwards, the cable at the plug must be reversed.
Sollten sich das Rad nicht drehen, kann man es noch mit einer höheren PWM von z.B. 200 versuchen.  
+
Should the wheel not turn, it can still be tried with a higher PWM of e.g. 200.
Bei Rad sollte sich auf jeden Fall noch bei einer PWM von 50 (besser weniger) drehen.
+
The wheel should definitely turn even at a PWM of 50 (better less).
  
Das gleiche für das rechte Rad (2):
+
The same for the right wheel (2):
 
  clc.mt,2,150  
 
  clc.mt,2,150  
  
Gestoppt wird das Rad dann mit
+
The wheel is then Stopped with:
 
  clc.mt,0,0
 
  clc.mt,0,0
  
Zeile 267: Zeile 260:
 
Achtung: Wenn die PWM zu hoch gesetzt wird, z.B. 18000Hz, dann drehen sich die Räder bei niedriger PWM von z.B. 60 nicht mehr. Es kommt dann ein Fehler, dass bei Vorgegebener PWM von 60 die Geschwindigkeit 0 ist.
 
Achtung: Wenn die PWM zu hoch gesetzt wird, z.B. 18000Hz, dann drehen sich die Räder bei niedriger PWM von z.B. 60 nicht mehr. Es kommt dann ein Fehler, dass bei Vorgegebener PWM von 60 die Geschwindigkeit 0 ist.
  
==Inbetriebnahme der Encoder==
+
== Commissioning the encoder ==
Es wird geprüft, ob die Encoder funktionieren und ob diese auch in die richtige Richtung zählen.
+
It it checked if the encoders work and if they count in the right direction.
  
Die Encoderroutine hat pro Rad zwei Zähler. Einmal einen Absolutzähler (absEnc), der zählt immer positive egal wie rum sich das Rad dreht.
+
The encoder routine has two counters per wheel. Once an absolute counter (absEnc), which always counts positive no matter in which direction the wheel turns.
Und einmal einen positiv/negative Zähler (enc), der bei Vorwärtsfahren hochzählt und bei Rückwärtsfahren runterzählt.
+
And a positive / negative counter (enc), which counts up when driving forward and counts down when reversing.
  
Den Befehl
+
Enter the command
  clc.mt,1,150  
+
  clc.mt, 1,150
eingeben, damit sich das linke Rad dreht.
+
to make the left wheel turn.
  
Dann
+
Enter then
  clc.enc  
+
  clc.enc
eingeben. Damit werden die Encoderwerte vom linken und rechten Rad angezeigt.
+
This will display the encoder values ​​from the left and right wheels.
  
Die Ausgabe wird mit dem Befehl: h beendet.
+
The output is terminated with the command: h.
  
Beide angezeigten Zähler des linken Rades (1) müssen nun hochzählen.
+
Both displayed counters of the left wheel (1) must now count up.
  
Beispiel:
+
Example:
  motor 1 = links  -sollte nicht zählen, wenn nur der rechte Motor läuft.
+
  Engine 1 = left - should not count if only the right engine is running.
  motor 2 = rechts -sollte nicht zählen, wenn nur der linke Motor läuft.
+
  Engine 2 = right - should not count if only the left engine is running.
  !03,motor 1 enc: 972 absEnc: 972 rpm: 2.596326 m/h: 125.773315 deltaTicks: 2 deltaTime: 32986us
+
  ! 03, motor 1 enc: 972 absEnc: 972 rpm: 2.596326 m / h: 125.773315 deltaTicks: 2 deltaTime: 32986us
  !03,motor 2 enc: 974 absEnc: 974 rpm: 3.325853 m/h: 161.113647 deltaTicks: 2 deltaTime: 33445us
+
  ! 03, motor 2 enc: 974 absEnc: 974 rpm: 3.325853 m / h: 161.113647 deltaTicks: 2 deltaTime: 33445us
  !03,motor 1 enc: 974 absEnc: 974 rpm: 2.923552 m/h: 141.625061 deltaTicks: 2 deltaTime: 33156us
+
  ! 03, motor 1 enc: 974 absEnc: 974 rpm: 2.923552 m / h: 141.625061 deltaTicks: 2 deltaTime: 33156us
  !03,motor 2 enc: 975 absEnc: 975 rpm: 2.678638 m/h: 129.760696 deltaTicks: 1 deltaTime: 33144us
+
  ! 03, motor 2 enc: 975 absEnc: 975 rpm: 2.678638 m / h: 129.760696 deltaTicks: 1 deltaTime: 33144us
  !03,motor 1 enc: 976 absEnc: 976 rpm: 3.132316 m/h: 151.738159 deltaTicks: 2 deltaTime: 32857us
+
  ! 03, motor 1 enc: 976 absEnc: 976 rpm: 3.132316 m / h: 151.738159 deltaTicks: 2 deltaTime: 32857us
  !03,motor 2 enc: 976 absEnc: 976 rpm: 2.296233 m/h: 111.235962 deltaTicks: 1 deltaTime: 32859us
+
  ! 03, motor 2 enc: 976 absEnc: 976 rpm: 2.296233 m / h: 111.235962 deltaTicks: 1 deltaTime: 32859us
  !03,motor 1 enc: 978 absEnc: 978 rpm: 3.251686 m/h: 157.520752 deltaTicks: 2 deltaTime: 32998us
+
  ! 03, motor 1 enc: 978 absEnc: 978 rpm: 3.251686 m / h: 157.520752 deltaTicks: 2 deltaTime: 32998us
Das Beispiel Zeigt, dass die Encoder hoch zählen. '''Beispiel motor 1''': enc:972 dann enc:974, dann enc:976 ... '''Beispiel motor 2''': enc:972 dann enc:975, dann enc:976 ...
+
The example shows that the encoders are counting up. '' 'Example motor 1' '': enc: 972 then enc: 974, then enc: 976 ... '' 'Example motor 2' '': enc: 972 then enc: 975, then enc: 976 ...
  
Falls der enc Wert negative beim Vorwärtsfahren zählt kann man das in der config.h konfigurieren:
+
If the enc value counts negative when driving forward you can configure it in the config.h:
  #define CONF_LEFT_ENCODER_INVERSE false
+
  #define CONF_LEFT_ENCODER_INVERSE false
  #define CONF_RIGHT_ENCODER_INVERSE false
+
  #define CONF_RIGHT_ENCODER_INVERSE false
Dazu CONF_LEFT_ENCODER_INVERSE für das linke Rad auf true setzen. Für das rechte Rad CONF_RIGHT_ENCODER_INVERSE auf true setzen.
+
To do this, set CONF_LEFT_ENCODER_INVERSE to true for the left wheel. Set CONF_RIGHT_ENCODER_INVERSE to true for the right wheel.
  
Das gleiche für das rechte Rad durchführen:
+
Do the same for the right wheel:
  clc.mt,2,150
+
  clc.mt, 2,150
  
Befehl wird mit clc.mt,0,0 gestoppt.
+
Command is stopped with clc.mt, 0,0.
  
Nachdem die Zeilen in der config.h richtig eingestellt wurden, neu kompilieren, aufspielen und neu testen!
+
After the lines in the config.h have been set correctly, recompile, play and retest!
  
==Check des closed loop control services==
+
== Check of the closed loop control service ==
Der closed loop control (clc) service regelt die Geschwindigkeit eines Rades und damit auch das Geradeausfahren des Roboters. Für jedes Rad gibt es einen Service also insgesamt zwei Services. Der Service berechnet intern die die Geschwindigkeit des Rades mit Hilfe der Encoderwerte und stellt dann die notwendige PWM ein um die vorgegebene Geschwindigkeit zu erreichen (closed loop). Die Geschwindigkeit wird in % angegeben. Dabei beziehen sich 100% auf die Konstante CONF_MAX_WHEEL_RPM in der config.h.
+
The closed loop control (clc) service controls the speed of a wheel and thus also the straightforward movement of the robot. There is one service for each wheel so there are two services in total. The service internally calculates the speed of the wheel with the aid of the encoder values and then sets the necessary PWM to reach the specified speed (closed loop). The speed is given in%. 100% refering to the constant CONF_MAX_WHEEL_RPM in the config.h.
  
Mit dem Befehl clc.v,30 wird beiden Services gesagt, drehe das Rad mit einer Geschwindigkeit(v) von 30%. Somit sollten sich beide Räder vorwärts drehen.
+
With the command clc.v,30 both services are commanded to turn the wheel at a speed (v) of 30%. Thus, both wheels should turn forward.
  
Eingeben:
+
Enter:
  clc.v,30   Fährt vorwärts mit Geschwindigkeit 30%  
+
  clc.v, 30 Moving forward with speed 30%
dann
+
then
  clc.v,s     Motor stoppen
+
  clc.v, s stop engine
dann
+
then
  clc.v,-30   Fährt Rückwärts mit Geschwindigkeit 30%  
+
  clc.v, -30 drives reverse with speed 30%
  
Hat alles funktioniert, dann weiter. Ansonsten nochmal die Encoder und Drehrichtung überpürfen.
+
If everything is working, then continue. Otherwise check encoders and drivedirection again.
  
  mot.cur   Zeigt den Motorstrom an.
+
  mot.cur Shows the motor current.
  
==Check des position control services==
+
== Check the position control services ==
Der Position Control Service (pc) dient dazu, das Rad einen bestimmten Weg zu fahren oder das Rad einen bestimmten Winkel zu drehen. Pro Rad gibt es einen Service.
+
The Position Control Service (pc) is used to drive the wheel a certain way or to turn the wheel a certain angle. There is one service per wheel.
Mit dem Befehl pc.a,360,80 werden beide Räder angesprochen: Drehe die Räder einen Winkel von 360 Grad mit einer Geschwindigkeit von maximal 80%.
+
With the command pc.a,360,80 both wheels are comanded to: Turn the wheels an angle of 360 degrees with a maximum speed of 80%.
  
An einem Rad eine Markierung anbringen, damit man sieht, wie weit es sich dreht
+
Make a mark on a wheel to see how far it turns.
+
 
  pc.a,360,80   Rotiert beide Räder vorwärts um 360 Grad mit 80% Speed wenn alles richtig konfiguriert ist.
+
  pc.a, 360,80 Rotates both wheels forward by 360 degrees with 80% speed if everything is configured correctly.
  pc.a,-360,80 Rotiert beide Räder rückwärts um 360 Grad mit 80% Speed wenn alles richtig konfiguriert ist.
+
  pc.a, -360,80 Rotates both wheels backwards by 360 degrees with 80% speed if everything is configured correctly.
  
Die Position Control kann mit dem Befehl
+
The Position Control can be stoped with the command
 
  pc.s
 
  pc.s
gestoppt werden.
 
 
  
Sollte sich das Rad nicht um 360 Grad gedreht haben, scheint der Wert CONF_ENCTICKSPERREVOLUTION in config.h falsch zu sein. Für die original Motoren aus dem Ardumower Shop ist der Wert von 1060 vorgegeben.
 
Zusätzlich ist die Konstante CONF_RADUMFANG_CM wichtig, damit die Berechnung für das Fahren eines bestimmten Weges in cm stimmt.
 
  
Da am Anfang in der config.h die Motorüberwachung ausgeschaltet wurde, wird diese nun wieder eingeschaltet.
+
If the wheel does not turn 360 degrees, the value CONF_ENCTICKSPERREVOLUTION in config.h appears to be wrong. For the original engines from the Ardumower shop, the value of 1060 is given.
Die Motorüberwachung prüft, ob die Encoder bei Drehung der Motoren Werte liefern, ob in die richtige Richtung gedreht wird oder ob der Motor überhaupt dreht wenn eine PWM anliegt.
+
In addition, the constant CONF_RADUMFANG_CM is important for the calculation to be correct to drive a particular path in cm.
  
Zum Einschalten der Morotüberwachung in der config.h den Wert CONF_DISABLE_MOTOR_STALL_CHECK auf false setzen.
+
Since the engine monitoring was switched off in the beginning in the config.h, it is now time to switch on again.
 +
Motor monitoring checks whether the encoders deliver values ​​when the motors are turning, whether they are turning in the right direction, or whether the motor is actually turning when a PWM is applied.
  
  #define CONF_DISABLE_MOTOR_STALL_CHECK false
+
To enable motor monitoring in config.h, set the value CONF_DISABLE_MOTOR_STALL_CHECK to false.
 +
  #define CONF_DISABLE_MOTOR_STALL_CHECK false
  
Neu kompilieren und aufspielen. Dann nochmal probieren.
+
Recompile and upload. Then try again.
Es dürfen keine Fehler angezeigt werden.
+
No errors should be displayed.
  
  
Wenn alles funktioniert hat, kann der Roboter auf die Räder gestellt werden.  
+
If everything works, the robot can be put on the wheels.
  
Weiter Tests können noch durchgeführt werde (Achtung, das USB Kabel sollte lang genug sein. Am besten eine Verlängerung verwenden);
+
Further tests can still be performed (note that the USB cable should be long enough, preferably use an extension);
  
Zurücklegen einer bestimmten Streck in cm
+
Drive a certain way in cm
  
  pc.cm,60,30  Fahre 60cm vorwärts mit der Geschwindigkeit von 30%
+
  pc.cm,60,60,30,30  drives 60cm forward with the speed of 30%
  
  pc.cm,-60,30   Fahre 60cm rückwärts mit der Geschwindigkeit von 30%
+
  pc.cm,-60,-60,30,30 drives 60cm backwards with the speed of 30%
  
  
  
Drehen eines bestimmten Winkels. Voraussetzung: CONF_ENCTICKSPERREVOLUTION, CONF_RADUMFANG_CM, und CONF_DISTANCE_BETWEEN_WHEELS_CM sind richtig konfiguriert.
+
Turning a certain angle. Prerequisite: CONF_ENCTICKSPERREVOLUTION, CONF_RADUMFANG_CM and CONF_DISTANCE_BETWEEN_WHEELS_CM are configured correctly.
  
  turnto,360,30   Drehe den Roboter um 360 Grad CW (clockwise)
+
  turnto, 360,30 Turn the robot 360 degrees CW (clockwise)
  
  turnto,-360,30 Drehe den Roboter um 360 Grad CC (counter clockwise)
+
  turnto, -360.30 Turn the robot 360 degrees CC (counter clockwise)
  
Sollte der Roboter nicht 360 Grad drehen, so ist vermutlich die Konstante CONF_DISTANCE_BETWEEN_WHEELS_CM in config.h falsch eingestellt.
+
If the robot does not turn 360 degrees, the constant CONF_DISTANCE_BETWEEN_WHEELS_CM in config.h is probably wrong.
  
==Mähmotor Inbetriebnahme==
+
==Mowmotor commissioning==
Der Mähmotor verwendet keinen Encoder. Er wird mit einer PWM von 255 betrieben. Die PWM von 255 wird nicht sofort auf den Motor gegeben. Es wird über eine Rampe die PWM von 0 auf 255 erhöht.
+
The mowing motor does not use an encoder. It is operated with a PWM of 255. The PWM of 255 is not immediately given to the engine. It ramps up the PWM from 0 to 255.
Das gleiche gilt für das Abbremsen des Motors. Es kann vorkommen, das bei dem Abbremsen des Motors ein Motorfault angezeigt wird. Dies liegt daran, dass die Motorscheibe durch die Trägheit versucht den Motor weiter zu drehen und dieser somit einen Storm in den Motortreiber rückwirkend einspeist, welcher die Limits überschreitet so dass die Tri State Ausgänge des des Treibers in den hochohmige Zustand gehen. Sollte das passieren kann der Fehler mit dem Befehl reset zurückgesetzt werden.
+
The same applies to the braking of the engine. It may happen that a motor fault is displayed when the engine is decelerating. This is because the inertia of the mowmotor disc tends to continue to rotate the motor, thus retroactively injecting a current into the motor driver that exceeds the limits such that the tri-state outputs of the driver go to high-impedance. If this happens, the error can be reset with the reset command.
  
 
Befehl eingeben:
 
Befehl eingeben:
Zeile 383: Zeile 374:
 
  t          //mow motor stop
 
  t          //mow motor stop
  
Es kann sein, dass beim stoppen ein  motorfault kommt. Diesen mit reset zurücksetzen.
+
It may be that when stopping the motor a fault comes up. Reset this with the command reset.
  
  mot.curm  //zeigt den Mähmotorstrom an.
+
  mot.curm  //indicates the mowing motor current.
  
  
Wenn das PCB1.3 verwendet wird, wird hier der Mähmotorstrom vermutlich falsch angezeigt. Siehe dazu: Mähmotorstrom einstellen in Tune Up
+
If the PCB1.3 is used, the mower motor current is probably displayed incorrectly here. See: Adjusting the mower motor current in Tune Up
Dies kann später durchgeführt werden und ist für den ersten Mähbetrieb nicht so wichtig.
+
This can be done later and is not so important for the first mowing operation.
  
==Perimeter Inbetriebnahme==
+
==Perimeter Commissioning==
Die Raindancer Firmware arbeitet mit zwei Spulen. Damit wird festgestellt, in welchem Winkel der Roboter auf den Perimeter triff. Dementsprechend wird entschieden, ob CC oder CW gedreht wird. Das Perimetersignal muss die ganze Zeit während des Mähens empfangen werden. Wird für 2 Sekunden das Signal nicht empfangen, stoppt der Roboter und fährt weiter, sobald das Signal wieder empfangen wird. Die Zeit, die ein nicht Empfang toleriert wird, wird mit dem Parameter CONF_PER_SIGNAL_LOST_TIME in der config.h festgelegt. So kann mann ggf. "Empfangslöcher" in der Mitte des Rasen überbrücken. Nachteil ist, falls der Sender genau dann ausfällt wenn sich der Roboter am Perimeter befindet, kann es sein, dass der Roboter diese eingestellte Zeit außerhalb der Perimeterschleife fährt.
+
The Raindancer firmware works with two coils. This determines the angle at which the robot meets the perimeter. Accordingly, it is decided whether CC or CW is rotated. The perimeter signal must be received all the time while mowing. If the signal is not received for 2 seconds, the robot will stop and continue as soon as the signal is received again. The time that a non-receive is tolerated is set with the parameter CONF_PER_SIGNAL_LOST_TIME in the config.h. With this it is possib to bridge "Receiving holes" in the middle of the lawn. Disadvantage is, if the transmitter fails exactly when the robot is at the perimeter, it may be that the robot travels this set time outside the perimeter loop.
  
Voraussetzung zur Inbetriebnahme:
+
Prerequisite for commissioning:
Die Spulen des Roboters müssen für die Inbetreibnahme innerhalb der Perimeterschleife sein.
+
The spools of the robot must be within the perimeter loop for commissioning.
Die Raindancer Sender Firmware muss auf dem Sender installiert sein.
+
The Raindancer transmitter firmware must be installed on the transmitter.
  
Als erstes wird geprüft, ob das Signal erkannt wird.
+
First check is if the signal is detected.
  
Man kann sich die berechneten Wert der einzelnen Spulen folgendermaßen anzeigen lassen:
+
You can see the calculated value of the individual coils as follows:
per.resultl für linke Spule und per.resultr für rechte Spule.  
+
per.resultl for left coil
Am Beispiel unten kann man am BAD erkennen, dass kein gültiges Signal empfangen wurde.
+
and
Wichtig ist hier, dass kein BAD angezeigt wird. Die empfangene Amplitude steht hinter mag:. Die Signalqualität kann man an der Peak Signal Noise Ratio psnr sehen.
+
per.resultr for right coil.
 +
The example below shows that the BAD has not received a valid signal.
 +
It is important here that no BAD is displayed. The received amplitude is behind mag :. The signal quality can be seen on the Peak Signal Noise Ratio psnr.
  
 
  Beispiel per.resultl
 
  Beispiel per.resultl
Zeile 419: Zeile 412:
 
  mag:    5  peak @  11 :    5  peak2 @ 153 :    5  MSE:    3.286  psnr:    7.607  psnr2:    7.607  ratio:    1.000    BAD
 
  mag:    5  peak @  11 :    5  peak2 @ 153 :    5  MSE:    3.286  psnr:    7.607  psnr2:    7.607  ratio:    1.000    BAD
  
Mit h Ausgabe beenden.
+
End the output with h.
  
Beide Spulen sollten das Signal erkennen, also kein BAD anzeigen. Auch nicht sporadisch!
+
Both coils should detect the signal, so do not indicate a BAD. Also not sporadicly!
  
  
Als nächstes muss die Polarität des Signals konfiguriert werden.
+
Next, the polarity of the signal must be configured. Enter:
  
  per.show eingeben. (mit h Ausgabe ausschalten)
+
  per.show. (switch off output with h)
  
Wenn die Spule innerhalb des Perimetes ist, muss die Amplitude der Spule positive sein.
+
If the coil is inside the perimeter, the amplitude of the coil must be positive.
  
Es werden nun die erkannten Perimeteramplituden ausgegeben.
+
The detected perimeter amplitudes are now shown.
ML zeigt die Amplitude der linken Spule an, MR die Amplitude der rechten Spule.
+
ML indicates the amplitude of the left coil, MR the amplitude of the right coil.
  
 
  !03, ML: -305  MR: 331 magMax:332 magMedL%: 0 magMedR%: 102
 
  !03, ML: -305  MR: 331 magMax:332 magMedL%: 0 magMedR%: 102
Zeile 440: Zeile 433:
 
  !03, ML: -326  MR: 324 magMax:332 magMedL%: 0 magMedR%: 102
 
  !03, ML: -326  MR: 324 magMax:332 magMedL%: 0 magMedR%: 102
  
Allerdings sieht man hier, dass die Magnetude links negative ist.  
+
However, one can see here that the magnetude on the left coil is negative.
In der Perimeterschleife muss diese positive sein.  
+
Inside the perimeter loop, this must be positive.
  
Dies kann in der config.h eingestellt werden:
+
This can be set in the config.h:
 
  #define CONF_LEFT_COIL_INVERSE true
 
  #define CONF_LEFT_COIL_INVERSE true
  #define CONF_RIGHT_COIL_INVERSE         false
+
  #define CONF_RIGHT_COIL_INVERSE       false
  
Nach neuem aufspielen, sollten die Werte positive sein.
+
After new compiling, the values should be positive.
  
  
Achtung, bei per.resultl und per.resultr wird das Vorzeichen der Amplitude wie tatsächlich empfangen angezeigt unabhängig von den Einstellungen in CONF_LEFT_COIL_INVERSE und CONF_RIGHT_COIL_INVERSE.  
+
Attention, with per.resultl and per.resultr, the sign of the amplitude is displayed as actually received, regardless of the settings in CONF_LEFT_COIL_INVERSE and CONF_RIGHT_COIL_INVERSE.
Es kann sein, dass  per.resultl eine positive Amplitude liefert und per.resultr eine negative. Das ist OK, da es von dem Anschluss der Spulen abhängt. Die Umrechnung  mit CONF_LEFT_COIL_INVERSE/CONF_RIGHT_COIL_INVERSE findet in der Software später statt.  
+
It may be that per.resultl provides a positive amplitude and per.resultr a negative amplitude inside the perimeter. That's OK, since it depends on the connection of the coils. Conversion with CONF_LEFT_COIL_INVERSE / CONF_RIGHT_COIL_INVERSE takes place later in the software.
Wichtig ist, das CONF_LEFT_COIL_INVERSE und CONF_RIGHT_COIL_INVERSE so konfiguriert werden, dass per.show innerhalb der Spule positive Amplituden anzeigt.
+
It is important to configure CONF_LEFT_COIL_INVERSE and CONF_RIGHT_COIL_INVERSE so that per.show displays positive amplitudes within the perimeter.
  
==Konfiguration Bluetooth==
+
==Configure Bluetooth==
  
Wurde das Modul bereits mir der original Arduower Software konfiguriert, kann
+
If the module has already been configured with the original Ardumower software, can CONF_BT_SERIAL_SPEED=19200 be set.
  #define CONF_BT_SERIAL_SPEED 19200  
+
  #define CONF_BT_SERIAL_SPEED 19200
eingestellt werden.
+
(The perimeter outputs are extremely large.) It may be that the software faltered at this transfer rate when viewing perimeter data over BT at that baud rate.)
(Die Perimeterausgaben sind extrem umfangreich. Es kann sein, das die Software bei dieser Übertragungsrate ins Stocken gerät, wenn man sich Perimeterdaten über BT bei dieser Baudrate anzeigen läßt.)
+
This would be the configuration then done.
Damit wäre dann die Konfiguration fertig.
+
  
  
Da es häufiger Probleme mit der Konfiguration von BT Modulen gibt, schlage ich vor ein funktionierendes BT Modul nur dann umzuprogrammieren, wenn man noch ein anderes funktionierendes BT Modul als Reserve hat.
+
Since there are sometimes problems with the configuration of BT modules, I suggest to reprogram a working BT module only if you have another working BT module in reserve.
  
  
Für die Konfiguration des BT wird die original Ardumower Routine verwendte. Allerdings wird die Baudrate auf 115200 gesetzt.
+
For the configuration of the BT the original Ardumower routine is used. However, the baud rate is set to 115200.
Daher kann man die zur Fehlersuche verwendeten Tips im Forum verwenden.
+
Therefore, you can use the tips used for troubleshooting in the forum.
  
Also los:
 
Platine stromlos schalten (auch USB vom DUE abziehen). Knopf auf BT Modul drücken und gedrückt halten. Platine anschalten.
 
Das BT Module sollte nun alle 2Sek blinken.
 
  
Knopf loslassen. USB an den DUE wieder anschließen. Das BT Modul sollte immer noch im 2Sek. Takt blinken.
+
Lets start:
 +
De-energize the PCB (also disconnect USB from the DUE). Press and hold button on BT module. Turn on the board.
 +
The BT module should now flash every 2 seconds.
  
Nun als erste mit bt.show versuchen, ob das BT Modul gefunden wird:
+
Release the button. Reconnect the USB to the DUE. The BT module should still be flashing every 2 seconds.
bt.show
+
  
Wenn erfolgreich gefunden:
+
Now try bt.show first, to see if the BT module is found:
 +
bt.show
  
 +
If found successfully put in the command:
 
  bt.set  
 
  bt.set  
eingeben. Das BT Modul wird konfiguriert.
+
The BT module will now be configured.
  
==Einstellen Arduino Central==
+
==Configure Arduino Centrale ==
Die Software läuft auf einem Android Mobilephone oder Tablet.
+
The software runs on an Android mobile phone or tablet.
Arduino Central kann aus dem Play Store heruntergeladen werden. Eine andere Software die auch funktioniert ist Serial Bluetooth Terminal.
+
Arduino Centrale can be downloaded from the Play Store. Another software that works is Serial Bluetooth Terminal.
  
In Arduino Central kann oben rechts das Menü (drei Punkte) aufgemacht werden. Dort Settings aufrufen.
+
In Arduino Centrale, the top right menu (three points) can be opened. Call Settings there.
  
Dann Button layout Configuratin öffnen. Hier wird eingestellt, welche Buttons angezeigt werden.
+
Then open the button layout Configuration. Here you can set which buttons are displayed.
Nur folgendes soll angewählt sein:
+
Only the following should be selected:
 
  Show Control Button
 
  Show Control Button
 
  Show Standard Button set 1
 
  Show Standard Button set 1
Zeile 496: Zeile 488:
 
  Show Standard Button set 3
 
  Show Standard Button set 3
  
Zurückgehen und Serial Terminal Settings öffnen
+
Go back and open Serial Terminal Settings
Terminal View Character Limit auf 10000 setzen
+
Set Terminal View Character Limit to 10000
  
Zurückgehen und Line Ending for Commands auswählen
+
Go back and select Line Ending for Commands
  Hier CR auswählen
+
  Select CR
  
Zurückgehen und Line Ending for Incomming Data auswählen
+
Go back and select Line Ending for Incoming Data
  Hier NL auswählen.
+
  Select NL
  
Dann erstmal ganz aus dem Menü rausgehen.
+
Then first go out completely from the menu.
  
Als erstes muss nun das BT Modul mit dem Handy gekoppelt werden.
+
First, the BT module must now be paired to work with the mobile phone.
Das heißt am Handy BT Aktivieren.  
+
That means on the phone enable BT.
Dann in das BT Menue am Handy gehen und nach neuen Geräten suchen.  
+
Then go to the BT menu on the phone and look for new devices.
Dort sollte dann eine neues Gerät auftauchen. Dieses Geräte auswählen und paaren bzw koppeln.
+
There should then appear a new device. Select this device and pair.
Es kommt zu einer Passwortabfrage die 1234 ist oder auch 0000
+
There is a password query which is 1234 or 0000
Danach wird das Modul in der Gerätelist aufgenommen.
+
Thereafter, the module is included in the device list
  
Jetzt in Arduino Cnetral im Menü auf connect to Device gehen und das BT des Robbis  klicken.
+
Now in the menu of Arduino Centrale go to connect to device and click the BT of the mower.
Wenn alles erfolgreich war, sollte oben rechts BT connect angezeigt werden.
+
If everything was successful, BT connect should be displayed at the top right.
  
  In der Befehlszeile dann H eingeben und Senden. Es sollte dann die Hilfe angezeigt werden.
+
  At the command line, type H and Send. Then the help should be displayed.n.
 
   
 
   
In Arduino Central können unter dem Menüpunkt Standard Button Setup Befehle hinterlegt werden.
+
In Arduino Centrale commands can be stored under the menu item Standard Button Setup.
Aktuell habe ich bei mir folgende Befehle hinterlegt:
+
Currently I have deposited the following commands with me:
 
  Button 1 Text: Manual Command: M
 
  Button 1 Text: Manual Command: M
 
  Button 2 Text: Auto  Command: A
 
  Button 2 Text: Auto  Command: A
Zeile 528: Zeile 520:
 
  Button 6 Text: per Command: per.show
 
  Button 6 Text: per Command: per.show
 
  Button 7 Text: mowense Command: mot.curm
 
  Button 7 Text: mowense Command: mot.curm
  Button 8 Text: bat Command: bat,show
+
  Button 8 Text: bat Command: bat.show
 
  Button 9 Text: charge Command: charge.show
 
  Button 9 Text: charge Command: charge.show
  
Diese Befehle können je nach Bedarf angepasst werden.
+
These commands can be customized as needed.
  
==Erste Testfahrt==
+
== First test drive ==
Dazu zur Sicherheit für den ersten Test den Mähmotor in config.h ausschalten.
+
For safety reasons, switch off the mowmotor in config.h for the first test.
  
 
  #define CONF_DISABLE_MOW_MOTOR          true
 
  #define CONF_DISABLE_MOW_MOTOR          true
  
Danach neu kompilieren und Software aufspielen.
+
Then recompile and upload software.
  
Achtung, es sind noch keine Bumper aktiv! D.h. die Fläche innerhalb des Perimeters muss frei sein.
+
Attention, there are still no bumpers active! That the area inside the perimeter must be free.
  
Das USB Kabel abziehen und eine Verbindung mit Arduino Central herstellen.
+
Disconnect the USB cable and connect to Arduino Centrale.
  
Roboter in die Schleife stellen.
 
Mit show.per nochmal das Perimetersignal überprüfen. Mit h oder show.per Ausgabe deaktivieren.
 
  
A für Auto eingeben um das mähen zu starten.
+
Put the robot inside the perimeter loop.
 +
Check the perimeter signal again with per.show. Disable perimeter output with h or per.show
  
Es kann nun 5 Sek. dauern bis sich etwas tut. Der Roboter fährt erst den Mähmotor hoch. Da dieser abgeschaltet ist, kann es so aussehen, als ob nicht passiert.
+
A enter for auto mode to start the mowing.
  
  M eingeben für manuellen mode, um den Roboter zu stoppen.
+
It may take 5 seconds for something to happen. The robot first drives up the mowmotor. Since this one is turned off, it may look like it does not happen.
 +
 
 +
  M enter for manual mode to stop the robot.
  
 
=TUNE UP =
 
=TUNE UP =
  
==Konfiguration der Bumper an den Bumperanschlüssen==
+
== Configure the bumpers on the bumper connectors ==
Das original Ardumower Chassis liefert keine standardmäßige Lösung für Bumper mit. Da die meisten Anwender sich hier eigene Lösungen schaffen, muss die Software auf die entsprechende Anforderung des jeweiligen Anwenders angepasst werden. Durch die Modularisierung der Services ist dies sehr einfach anzupassen.
+
The original Ardumower chassis does not provide a standard solution for bumpers. Since most users create their own solutions here, the firmware has some options to configure the bumper service for their own needs.
  
Die Bumper Pins sind standardmäßig als Eingänge mit Pullup Widerstand konfiguriert in hardware.cpp:
+
To enable the bumper, the following line must be configured in config.h:
 +
#define CONF_DISABLE_BUMPER_SERVICE    false
  
DigitalIn diBumperL(pinBumperLeft, true);
+
To test bumpers, you can use the bumper.show command. The bumper service then plays its activity on the console or mobile phone, depending on where that command was sent from.
 +
bumper.show
  
DigitalIn diBumperR(pinBumperRight, true);
 
  
Das bedeutet, der Eingang ist standardmäßig auf HIGH, wenn der Pin nicht auf GND gezogen wurde.
+
The bumper pins are configured by default as inputs with pullup resistor. This means, the input is high by default as long as the pin is not connected to GND by a switch for example.
  
 +
The bumper service can be configured with following parameters in config.h:
  
''Möchte man die Pullupwiderstände ausschalten, müssen die Zeilen folgendermaßen geändert werden''
 
  
''DigitalIn diBumperL(pinBumperLeft, false);''
+
Using the left or/and right bumper
  
  ''DigitalIn diBumperR(pinBumperRight, false);''
+
  #define CONF_USE_LEFT_BUMPER            true    // left bumper is used
 +
#define CONF_USE_RIGHT_BUMPER          true    // right bumper is used
  
  
 +
Determine if the bumper is active if the pin is connected to GND:
  
Zum aktivieren der Bumper muss in der config.h folgende Zeile konfiguriert werden:
+
#define CONF_LEFT_BUMPER_LOW_ACTIVE    true    // left bumper is activated when pin is low
  #define CONF_DISABLE_BUMPER_SERVICE   false
+
  #define CONF_RIGHT_BUMPER_LOW_ACTIVE   true    // right bumper is activated when pin is low
  
Zum Testen der Bumper kann man den Befehl bumper.show verwenden. Der Bumper Service gibt dann auf der Konsole oder dem Mobile Phone seine Aktivität aus, je nachdem von wo dieser Befehl gesendet wurde.
 
bumper.show
 
  
 +
If one uses a left and a right bumper, there is still the possibility to configure that the direction of rotation is determined by the activated bumper after driving back. That means, that when the left bumper is pressed, the robot then turns right after driving back.
  
Da je nach Anwendung beide Bumper Pins oder nur einer benutzt wird, muss man den Bumper Service ggf. noch umprogrammieren auf die eigenen Anforderungen.
+
#define CONF_ESCAPEDIR_DEPENDING_ON_BUMPER false  // if set to true, the robot rotates in the opposite direction of the activated bumper. If false, the escape direction is random.
Der Bumper Service ist in bumperSensor.cpp programmiert.
+
                                                  // only set to true if you use a bumper for left and a bumper for right.
  
Dabei sind folgende Zeilen zu berücksichtigen.
 
  
// Orignal Ardumower Bumper  Pins
 
#if CONF_DISABLE_BUMPER_SERVICE == false
 
  if (( /*diBumperL == LOW &&*/ diBumperR == LOW) && _bumperActivated) {
 
    if (flagShowBumper) {
 
      errorHandler.setInfo("!03,Bumper deactivated\r\n");
 
    }
 
    _bumperActivated = false;
 
      //motor.hardStop();
 
  }
 
  if ((/*diBumperL == HIGH ||*/ diBumperR == HIGH) && !_bumperActivated) {
 
    if (flagShowBumper) {
 
      errorHandler.setInfo("!03,Bumper activated\r\n");
 
    }
 
    _bumperActivated = true;
 
    //motor.hardStop();
 
  }
 
#endif
 
  
Die obigen Zeilen aktivieren den Bumper wenn der Bumperpin auf HIGH geht und deaktivieren ihn wieder wenn er auf LOW geht.
+
The bumper pins are configured by default as inputs with pullup resistor in hardware.cpp:
Dies ist die Konfiguration für einen Hall Sensor. Wenn der Magnet über dem Hallsensor ist, schaltet dieser den Open Collector Ausgang durch. Der Pin ist somit auf GND. In der aktuellen Konfiguration bedeutet das, der Bumper ist '''nicht''' betätigt.
+
  
Weiterhin wird nur der Rechte Bumperanschluss verwendet. Möchte man den linken Anschluss auch verwenden, so muss man "diBumperL == LOW &&" sowie "diBumperL == LOW ||" einkommentieren.
+
DigitalIn diBumperL(pinBumperLeft, true);
  
Möchte man einen Schalter am rechten Bumperanschluss anschließen, der bei ausgelöstem Bumper geschlossen ist (also PIN auf GND bedeutet Bumper aktiv), muss man folgenden Code verwenden (aktuell nicht getestet)
+
DigitalIn diBumperR(pinBumperRight, true);
  
// Orignal Ardumower Bumper Pins
+
This means the input is high by default if the pin is not pulled to GND.
#if CONF_DISABLE_BUMPER_SERVICE == false
+
  if (( /*diBumperL == HIGH &&*/ diBumperR == HIGH) && _bumperActivated) {
+
    if (flagShowBumper) {
+
      errorHandler.setInfo("!03,Bumper deactivated\r\n");
+
    }
+
    _bumperActivated = false;
+
    //motor.hardStop();
+
  }
+
  if ((/*diBumperL == LOW ||*/ diBumperR == LOW && !_bumperActivated) {
+
    if (flagShowBumper) {
+
      errorHandler.setInfo("!03,Bumper activated\r\n");
+
    }
+
    _bumperActivated = true;
+
    //motor.hardStop();
+
  }
+
#endif
+
  
Bei zwei Schaltern:
 
  
// Orignal Ardumower Bumper Pins
+
''If you want to switch off the pull-up resistors, the lines must be changed as follows''
#if CONF_DISABLE_BUMPER_SERVICE == false
+
    if (( diBumperL == HIGH && diBumperR == HIGH) && _bumperActivated) {
+
      if (flagShowBumper) {
+
          errorHandler.setInfo("!03,Bumper deactivated\r\n");
+
      }
+
      _bumperActivated = false;
+
      //motor.hardStop();
+
    }
+
    if ((diBumperL == LOW || diBumperR == LOW && !_bumperActivated) {
+
      if (flagShowBumper) {
+
        errorHandler.setInfo("!03,Bumper activated\r\n");
+
      } 
+
      _bumperActivated = true;
+
      //motor.hardStop();
+
    }
+
#endif
+
  
Die Zeile //motor.hardStop(); wird aktuell nicht mehr verwendet, da bei Verwendung eines schwingenden Bumperchassis nicht sofort der Motorstrom auf 0 gesetzt werden muss, da immer noch 1-2cm Spiel vorhanden sind. Kann aber eingefügt werden wenn der Bumper ausgelöst wird, falls die Räder beim Anstoßen durchdrehen. (aktuell nicht getestet)
+
''DigitalIn diBumperL(pinBumperLeft, false);''
 +
 
 +
''DigitalIn diBumperR(pinBumperRight, false);''
  
 
==Charge Service==
 
==Charge Service==
Der Charge Service stellt dem BHT die Charge Voltage und den Charge Current zur Verfügung. Er enthält Funktionen zum Ein-/Ausschalten des Laderelais.
+
The charge ervice provides the BHT with the charge voltage and the charge current. It contains functions for switching the charger relay on / off.
  
Anmerkung:
 
Wenn den Mower ausgeschaltet ist (also Batterie nicht angeklemmt) und dann an P42 Charger eine Ladespannung angeschlossen wird,
 
wird das Board über D73 direkt mit Spannung versorgt. Das Problem ist, das die Kondensatoren auf dem Board keine Spannung haben und beim Anklemmen einen Kurzschluss liefern. Dann wird eine 1,6A Sicherung in EF1 durchschlagen.
 
Daher sollte EF1 5A betragen.
 
Ich habe bei mir die D73 entfernt, da ich diese nur dann für sinnig halte, wenn die Batterie so leer ist, dass das Board und Relay nicht mehr mit der Batterie funktioniert. Falls dies mal wirklich
 
passiert, werde ich die Batterie direkt mit dem Ladegerät laden. Sowas sollte nur im Fehlerfall passieren und nicht die Regel sein (Ich möchte aber niemanden überreden dies auch zu tun).
 
Weiterhin hat die D73 ein anders Potential auf der Hinterseite, als die Dioden die hinter dieser eingelötet sind. Da ist es sinnig, diese mit Heißkleber zu trennen, nicht das diese aneinander geraten.
 
  
[[Im Folgenden wir beschrieben, wie man den Roboter laden kann]]
+
Annotation:
 +
If the Mower is switched off (battery not connected) and then a charging voltage is connected to P42 Charger,
 +
the board is directly supplied with voltage via D73. The problem is that the capacitors on the board have no voltage and supply a short circuit when connected. Then a 1.6A fuse will break through in EF1.
 +
Therefore, EF1 should be 5A.
 +
I've removed the D73 from my board, because I think it's only reasonable if the battery is so empty that the board and Relay no longer works with the battery. If this really
 +
happens, I will charge the battery directly with the charger. This should be happen only in case of an error and should not be the rule (but I would not persuade anyone to do this too).
 +
Furthermore, the D73 has a different potential on the back, as the diodes are soldered behind this. Since it makes sense to separate them with hot glue, not that they come together.
  
'''Selbstständiges Fahren in die Ladestation'''
+
[[The following describes how to load the robot.]]
  
Wenn der Roboter in die Ladestation fährt, ist das Laderelais ausgeschaltet. Zu diesem Zeitpunkt liegt nur die Spannung der Ladestation an den Kontakten.
+
'''Independent driving in the charging station'''
Hat der Roboter dies festgestellt, stoppt er, wartet zwei Sekunden und überprüft die Ladespannung nochmal. Wenn diese OK ist, fährt er 3cm vorwärts, 3cm rückwärts und wieder 2cm vorwärts.
+
Dies dient dazu die Verbindung zu den Ladekontakten zu optimieren (die aktuell als Schleifkontakte ausgeführt sind). Danach wird das Relay eingeschaltet und die Ladespannung erneut geprüft.
+
(Dieses Verhalten kann ohne großen Aufwand im BHT umprogrammiert werden.) Das Relay bleibt solange angezogen und damit die Batterie mit dem Ladegerät verbunden, bis der Roboter den Befehl bekommt zu einem Bereich (area) zu fahren oder der Roboter in den manuellen Mode geschaltet wurde oder in den auto Mode geschaltet wird.
+
  
'''Verwenden ohne Ladestation'''
+
When the robot moves into the charging station, the charging relay is switched off. At this time, only the voltage of the charging station is at the contacts.
 +
If the robot has detected this, it stops, waits two seconds and checks the charging voltage again. If this is OK, it moves 3cm forward, 3cm backwards and again 2cm forward.
 +
This serves to optimize the connection to the charging contacts (which are currently designed as sliding contacts). Then the relay is switched on and the charging voltage checked again.
 +
(This behavior can easily be reprogrammed in the BHT.) The relay remains energized and thus the battery is connected to the charger until the robot is commanded to go to an area or the robot is switched to manual mode or switched to auto mode.
  
Um den Roboter zu laden  sollte dieser sich im Manual mode befinden (Befehl M eingeben). Danach kann man mit charge.relay,1 das Relay einschalten und mit charge.relay,0 das Relay ausschalten. Das Relay schaltet automatisch aus, wenn man den Auto Modus aktiviert. '''Das Relay schaltet nur ein, wenn an den Ladekontakten die Ladespannung anliegt!'''.
+
'''Use without charging station'''
Eine andere Möglichkeit ist, die Ladekontakte im ausgeschaltetem Zustand anzuschließen und den Roboter dann einzuschalten. Der Roboter geht dann in den Auto mode uns schaltet das Behaviour Charging Station ein. Damit denkt er nun, er ist in der Ladestation.
+
  
'''Einstellen in die Ladestation'''
+
To load the robot it should be in manual mode (enter command M). Then you can use charge.relay,1 to switch on the relay and with charge.relay,0 to switch off the relay. The relay automatically turns off when the Auto mode is activated. '''The relay only switches on if the charging voltage is applied to the charging contacts!'''.
 +
Another possibility is to connect the charging contacts when switched off and then turn on the robot. The robot then goes into auto mode and turns on the Behavior Charging Station. He now thinks he is in the charging station.
  
Hier den Roboter im ausgeschalteten Zustand in die Ladestation stellen, so dass die Ladekontakte Kontakt haben. Dann einschalten. Der Roboter geht dann in den Auto mode in das Behaviour Charging Station. Damit denkt er nun, er ist in der Ladestation, schaltet das Relais ein und lädt.
+
'''Put in the charging station'''
  
 +
Here, put the robot in the switched off state in the charging station, so that the charging contacts have contact. Then turn it on. The robot then enters the charging mode in the Behavior Charging Station. He now thinks he is in the charging station, turns on the relay and charges.
  
Um den Chargingservice zu aktivieren inder config.h CONF_DISABLE_CHARGE_SERVICE auf false setzen und Software neu aufspielen.
+
 
 +
To enable the charging service, set the config.h CONF_DISABLE_CHARGE_SERVICE to false and re-install the software.
  
 
  #define CONF_DISABLE_CHARGE_SERVICE false
 
  #define CONF_DISABLE_CHARGE_SERVICE false
  
[[Manuelles Testen:]]  
+
[[Manual testing:]]  
  
Den Befehl
+
Enter the command:
 
  charge.show  
 
  charge.show  
eingeben. Damit werden die Spannungen und Ströme kontinuierlich angezeigt. Aktuell sollte alles mit  0 angezeigt werden.
+
This continuously displays the voltages and currents. Currently everything should be displayed with 0.
  
Ladegerät an P42 oder Ladekontakte anschließen.
+
Connect charger to P42 or charging contacts.
  
Nun sollten die Chargevoltage (CV) angezeigt werden.
+
Now you should see the Charge Voltage (CV)..
  
Relay einschalten:
+
Enable relay:
 
  charge.relay,1
 
  charge.relay,1
  
Damit fließt nun ein Strom vom Ladegerät zur Batterie und ein Charge Current wird angezeigt (CC).  
+
Now a current flows from the charger to the battery and a charge current is displayed (CC).
  
Relay ausschalten.
+
Disable relay:
 
  charge.relay,0  
 
  charge.relay,0  
  
  
[[Testen im ausgeschaltetem Zustand über die Konsole:]]
+
[[Testing in the off state via the console:]]
  
Roboter einschalten und USB anschließen. Warten bis Software hochgelaufen ist.  
+
Turn on the robot and connect USB. Wait until software has started up.
Ladekontakte verbinden.  
+
Connect charging contacts.  
Serielle Konsole öffnen. Der DUE startet neu. Das Relay sollte angezogen werden und die Konsolenausgabe beim Booten sollte "Charging station detected" anzeigen.
+
Open the serial console. The DUE restarts. The relay should be energized and the console output at boot should show "Charging station detected".
Der Roboter hat nun in das Chargingbehaviour geschaltet.
+
The robot has now switched to the Chargingbehaviour.
  
  M eingeben um wieder in manuellen mode zu gelangen und das Relay abzuschalten.
+
  Enter M to return to manual mode and switch off the relay.
  
 
==Watchdog==
 
==Watchdog==
Der Watchdog dient ausschließlich zur Sicherheit.
+
The watchdog is solely for safety.
Falls sich die Software aufhängt, soll der Watchdog verhindern, dass der Roboter unkontrolliert weiterläuft.  
+
If the software hangs, the watchdog should prevent the robot from running unchecked.
Der Watchdog ist hardwaretechnisch im DUE realsiert. Er wird in der config.h mit
+
The watchdog is hardware implemented in the DUE. It is activated in the config.h with:
 
  #define CONF_ENABLEWATCHDOG  true
 
  #define CONF_ENABLEWATCHDOG  true
aktiviert.
 
  
Jedesmal wenn der Loop durchlaufen wird, wird der Watchdog mit dem Funktionsaufruf watchdogReset(); reseted.
 
Wenn watchdogReset(); innerhalb von 3 Sek. nicht aufgerufen wird (weil die Software irgendwo hängt), wird der DUE neu gestartet, die Motoren gestoppt und die Software geht in den Modus Manual.
 
  
Anmerkung:
+
Each time the loop is traversed, the watchdog will be reseted with the function call watchdogReset ();.
Da die Variablen der Firmware beim Reboot neu initialisiert werden, ist es schwer herauszufinden, was die Ursache des Fehlers ist.  
+
If watchdogReset (); is not called within 3 seconds  (because the software hangs somewhere), the DUE is restarted, stopped the engines and the software goes into manual mode.
Der Mower bleibt einfach stehen, und man wundert sich beim Öffnen der BT Verbindung, das alles in Ordnung ist und kein Fehler ausgegeben wird - außer das die Software im Manual Mode ist.
+
 
 +
Annotation:
 +
Since the variables of the firmware are reinitialized during the reboot, it is difficult to find out what the cause of the error is.
 +
The Mower simply stops, and one wonders when opening the BT connection, that everything is fine and no error is issued - except that the software is in manual mode.
  
== Unterspannungsabschaltung ==
+
== Undervoltage Shutdown ==
Die Unterspannungsabschaltung dient dazu zu verhindern, dass die Batterie unter eine bestimmte Spannung fällt und dann Tiefen entladen wird. Die Umsetzung der Unterspannungsabschaltung ist im Batterie Service implementiert.  
+
The undervoltage shutdown is used to prevent the battery from falling below a certain voltage and then deeply discharged. The implementation of the undervoltage shutdown is implemented in the battery service.
Voraussetzung ist, das Hardwareseitig der Jumper 8 UV-Abschaltung auf PCB 1.3 auf Auto gestellt ist. Wenn man dann Spannung auf das Board gibt, bekommt dieses erstmal keinen Strom. Daher muss beim Einschalten der Spannung die UV-Abschaltung mit dem P20 Button überbrückt werden. Dann bekommt das PCB1.3 Spannung. Dieser Button sollte so für 4 Sekunden gehalten werden. Dann übernimmt die Software die Steuerung der UV-Abschaltung. Der P20 Button muss danach wieder offen sein, ansonsten kann die Software die Spannung nicht abschalten.
+
Prerequisite is, that the jumper 8 UV shutdown on PCB 1.3 is set to Auto. If you then put voltage on the board, this gets no electricity first. Therefore, when switching on the voltage, the UV shutdown must be bridged with the P20 button. Then the PCB1.3 gets voltage. This button should be held for 4 seconds. Then the software takes control of the UV shutdown. The P20 button must then be open again, otherwise the software can not switch off the voltage.
  
  
In der config.h ist die Schwelle eingestellt, bei der die Spannung abgeschaltet wird
+
In config.h the threshold is set at which the voltage is switched off
 
  #define CONF_VOLTAGE_SWITCHOFF_BS  21.7f   
 
  #define CONF_VOLTAGE_SWITCHOFF_BS  21.7f   
Wenn die Batteriespannung für eine Minute unter diese Spannung abfällt, wird die Spannung zum PCB1.3 und den Motoren abgeschaltet.
+
If the battery voltage falls below this voltage for one minute, the voltage to PCB1.3 and the motors will be cut off.
Das gesamte PCB1.3 ist dann dunkel.
+
The entire PCB1.3 is then dark.
  
Möchte man die Unterspannungsabschaltung überbrücken, kann man Jumper 8 auf Dauer-An stellen oder P20 überbrücken. Ich habe am P20 einen Ein-/Ausschalter angeschlossen, so das ich für Testzwecke diesen überbrücken kann. Der Jumper 8 steht weiterhin auf Auto.
+
If you want to bridge the undervoltage cut-off, you can set jumper 8 to permanent-on or bypass P20. I have an on / off switch connected to the P20, so that I can bridge this for testing purposes. The jumper 8 is still on auto.
  
 
==I2C Bus==
 
==I2C Bus==
Der I2C Bus kann mit dem Befehl i2c.scan gescannt werden. Es werden dann alle gefundenen Adressen angezeigt.
+
The I2C bus can be scanned with the command i2c.scan. All found addresses will be displayed.
  
 
  i2c.scan
 
  i2c.scan
  
Die Adressen des RTC Moduls und des EEPROM können in der hardware.cpp angepasst werden. Zur Zeit sind die Standardadressen konfiguriert:
+
The addresses of the RTC module and the EEPROM can be adjusted in the hardware.cpp. Currently the following default addresses are configured:
  
 
  byte DS1307_ADDRESS = B1101000;
 
  byte DS1307_ADDRESS = B1101000;
Zeile 751: Zeile 697:
  
 
==RTC==
 
==RTC==
Das RTC Modul wird zur Zeit nicht verwendet. Es ist vorgesehen, später dieses für einen zeitlichen Mähstart zu verwenden.
+
The RTC module is currently not used. It is intended to use this later for a time mowing start.
Das RTC Modul kann aber bereits programmiert und getestet werden.
+
However, the RTC module can already be programmed and tested.
  
Das RTC Modul wird mit folgender Zeile in der config.h aktiviert:
+
The RTC module is activated with the following line in the config.h:
  
 
  define CONF_DISABLE_EEPROM_SERVICE  false
 
  define CONF_DISABLE_EEPROM_SERVICE  false
  
Es stehen folgende Befehle zur Verfügung:
+
The following commands are available:
 
  rtc.show          //show rtc values every rtc read (10sec)
 
  rtc.show          //show rtc values every rtc read (10sec)
 
  rtc.config        //show rtc service config
 
  rtc.config        //show rtc service config
Zeile 765: Zeile 711:
  
 
==EEPROM==
 
==EEPROM==
Es wird das EEPROM auf dem RTC verwendet. Zur Zeit wird es verwendet um Statistiken abzuspeichern. Es werden folgende Statistiken abgespeichert: Gesamte Mähzeit, Gesamte gefahrene Strecke, Gesamte Anzahl an Rotationen, Anzahl Ladevorgänge.
+
The EEPROM is used on the RTC. Currently it is used to store statistics. The following statistics are stored: total mowing time, total distance traveled, total number of rotations, number of loading operations.
  
Die Verwendung des EEPROM wird mit folgender Zeile in der config.h eingeschaltet:
+
The use of the EEPROM is switched on with the following line in the config.h:
  
 
  #define CONF_DISABLE_EEPROM_SERVICE false
 
  #define CONF_DISABLE_EEPROM_SERVICE false
  
Folgende Befehle stehen für das EEPROM zu Verfügung:
+
The following commands are available for the EEPROM:
  
 
  eep.config          //show EEPROM service config
 
  eep.config          //show EEPROM service config
Zeile 782: Zeile 728:
 
  eep.erase            //erase the eeprom
 
  eep.erase            //erase the eeprom
  
Zum testen des EEPROM z.B. folgenden Befehl eingeben:
+
To test the EEPROM e.g. enter the following command:
 
  eep.set.f,10,7.3
 
  eep.set.f,10,7.3
Damit wird der float Wert 7.3 an die Adressen 10,11,12,13 in das EEPROM geschrieben.
+
This writes the float value 7.3 to the addresses 10, 11, 12, 13 in the EEPROM.
  
Mit dem Befehl
+
With the command
 
  eep.f,10
 
  eep.f,10
kann der Wert dann wieder ausgelesen werden.
+
the value can then be read out again.
  
Der Befehl eep.erase löscht die ersten 3 Pages des EEPROM. Die anderen Pages werden aktuell nicht gelöscht, da diese nicht verwendet werden.
+
The command eep.erase deletes the first 3 pages of the EEPROM. The other pages are currently not deleted because they are not used.
 
  eep.erase
 
  eep.erase
  
Es ist sinnvoll das EEPROM nach dem enablen zu löschen, damit die Speicherzellen initialisiert werden.
+
It makes sense to erase the EEPROM after the enable the service so that the memory cells are initialized.
  
==Geschwindigkeit am Perimeter verlangsamen==
+
== Slow down the speed at the perimeter ==
Der Mower fährt mit einer Geschwindigkeit von 1200m/s. Um das Abbremsen beim Überfahren des Perimeters etwas sanfter durchzuführen, verringert der Roboter kurz vor dem Perimeter (ca. 20cm) die Geschwindigkeit.  
+
The Mower drives at a speed of 1200m / s. In order to make the deceleration a bit gentler when driving over the perimeter, the robot reduces the speed just before the perimeter (about 20 cm).  
  
Folgende Konstanten in der config.h beeinflussen das Erkennen nahe am Perimeter:
+
The following constants in the config.h affect recognition near the perimeter:
 
  #define CONF_NEAR_PER_UPPER_THRESHOLD  80.0L    // Threshold of one coil where Perimetersignal is detected as near perimeter
 
  #define CONF_NEAR_PER_UPPER_THRESHOLD  80.0L    // Threshold of one coil where Perimetersignal is detected as near perimeter
 
  #define CONF_NEAR_PER_LOWER_THRESHOLD  70.0L    // Threshold of the other coil where Perimetersignal is detected as near perimeter
 
  #define CONF_NEAR_PER_LOWER_THRESHOLD  70.0L    // Threshold of the other coil where Perimetersignal is detected as near perimeter
 
   
 
   
  
Um festzustellen, ob der Roboter nahe am Perimeter ist, wird die Amplitude der linken und rechten Spule ausgewertet. Dazu ermittelt die Firmware die aktuelle maximale Amplitude über die gesamte Fahrzeit des Mower. Wenn nun die linke Spule eine Amplitude von 80% (CONF_NEAR_PER_UPPER_THRESHOLD) oder höher des Maximalwertes erreicht und die rechte Spule über 70% (CONF_NEAR_PER_LOWER_THRESHOLD) oder höher  des Maximalwertes erreicht, so wird angenommen, dass der Roboter nahe am Perimeter ist. Das Gleiche gilt, wenn die rechte Spule 80% erreicht und die linke 70%.
+
To determine if the robot is close to the perimeter, the amplitude of the left and right coils are evaluated. For this purpose, the firmware determines the current maximum amplitude over the entire travel time of the Mower. Now, when the left coil reaches an amplitude of 80% (CONF_NEAR_PER_UPPER_THRESHOLD) or higher of the maximum value and the right coil reaches above 70% (CONF_NEAR_PER_LOWER_THRESHOLD) or higher of the maximum value, it is assumed that the robot is close to the perimeter. The same applies if the right coil reaches 80% and the left 70%.
  
Diese Werte sind abhängig von der verwendeten Spule und von der eingestellten Signalstätke des Sender und müssen daher ggf. nachjustiert werden.
+
These values depend on the kind of coil used and on the signal strength of the transmitter and therefore may need to be readjusted.
  
Um dies zu justieren, den Befehl per.show eingeben während der Mower fährt.
+
To adjust this, enter the command per.show while the Mower is driving.
 
  per.show  
 
  per.show  
Wenn er dann über den Perimeter fährt den gleichen Befehl eingeben oder h drücken. Dann in der Anzeige zurück scrollen und sich die Werte angucken.
+
If the mower then runs over the perimeter wire enter the same command or press h. Then scroll back in the display and look at the values.
  
Beispiel:
+
Example:
 
!03, ML: 305  MR: 331 magMax:332 magMedL%: 73 magMedR%: 87
 
!03, ML: 305  MR: 331 magMax:332 magMedL%: 73 magMedR%: 87
  
Die Werte  magMedL%: 73 magMedR%: 87 zeigen hier die gemessene Prozentzahl der Spulen an. Hiernach dann CONF_NEAR_PER_UPPER_THRESHOLD und CONF_NEAR_PER_LOWER_THRESHOLD einstellen. Es sollten mehrere Versuche zur Bestimmung durchgeführt werden. Besser etwas früher langsamer werden, als zu spät. Der Unterschied zwischen High und Low wurde eingeführt, da die Spulen nicht den gleiche Wert haben, z.B. wenn der Mower schräg oder fast parallel zum Perimeter fährt.
+
The values magMedL%: 73 magMedR%: 87 indicate here the measured percentage of the coils 20cm before the  perimeter wire. Use this percentage as starting point to set CONF_NEAR_PER_UPPER_THRESHOLD and CONF_NEAR_PER_LOWER_THRESHOLD. Several tests should be carried out for the determination. Better to slow down a little earlier than to slow down too late. The difference between UPPER and LOWER has been introduced because the coils do not have always the same value, e.g. when the Mower is running obliquely or almost parallel to the perimeter.  
  
Es kann sein, dass magMedL% und magMedR% mehr als 100% anzeigen. Dies beruht auf der Art der magMax Ermittlung und ist OK.
+
It may be that magMedL% and magMedR% show more than 100%. This is based on the type of magMax determination and is OK.
  
Die Berechnung ist in der Funktion '''bool TPerimeterThread::isNearPerimeter()''' in der Datei perimeter.cpp hinterlegt.
+
The calculation is stored in the function '' 'bool TPerimeterThread :: isNearPerimeter ()' '' in the file perimeter.cpp.
  
==Mähmotorstrom einstellen==
+
== Set mower motor current ==
Es ist zu berücksichtigen, dass die Ausgänge des Mähmotordrivers auf dem PCB1.3 zusammengeschaltet wurden.  
+
It should be noted that the outputs of the mowing motor driver on PCB1.3 have been interconnected.
  
Bei mir wird bei einer PWM von 255 am Mähmotor fast kein Strom gemessen. Habe dann mal mit einem Multimeter nachgemessen. Am M2 FB liegen tatsächlich im vollen Leerlauf nur 0.04V an. Richtig wären ca. 0.22V da der Motor hier 0,41A zieht. Am M1 FB1 messe ich eine Spannung von 0.007V. Es scheint so, dass durch das parallel Schalten die Strommessung nicht mehr stimmt. Man könnte meinen diese sollte sich halbieren. Ist aber nicht so.  
+
With a PWM of 255 at the mower motor almost no current is measured on my board. I have then remeasured the value with a multimeter. I measure at M2 FB at full speed and free-wheel only 0.04V. Correct value would be about 0.22V because the engine pulls here 0.41A. On M1 M1 I measure a voltage of 0.007V. It seems that the current measurement is no longer correct due to the parallel connection. One might think that this should be halved. But it is not like that.
  
  
Eine Zusammenschaltung der beiden MC33926 wird vom Hersteller nicht ausdrücklich empfohlen und liefert scheinbar eine falsche Strommessung.
+
An interconnection of the two MC33926 is not recommended by the manufacturer and seems to provide an incorrect current measurement.
  
 
https://www.nxp.com/docs/en/application-note/AN4833.pdf
 
https://www.nxp.com/docs/en/application-note/AN4833.pdf
  
Zitat:"If two independent H-bridges are used (separate MC33926 or similar), the load sharing may not be quite as even,
+
Quote:"If two independent H-bridges are used (separate MC33926 or similar), the load sharing may not be quite as even,
  
 
resulting in a reduction in maximum drive capability. This configuration will latch any fault until the EN pin is toggled."
 
resulting in a reduction in maximum drive capability. This configuration will latch any fault until the EN pin is toggled."
  
  
Ich habe dann vom Mowmotortreiber die Pins M1 OUT1 und M1 OUT2 abgeklemmt (gebogen und neben die Buchsenleist geführt, so das diese keinen Kontakt haben). Und siehe da, die Strommessung funktioniert richtig, wobei unter 1A diese nicht wirklich genau ist. Erst ab 1A ist der Wert zuverlässig.
 
  
Forumseintrag:
+
I have then disconnected from the Mowmotor driver pins M1 OUT1 and M1 OUT2 (bent and guided next to the socket connector, so that they have no contact). Now the current measurement works properly, but under 1A this is not really accurate. Only from 1A the value is reliable.
 +
 
 +
Forum Posts:
 
https://www.ardumower.de/index.php/de/forum/ardumower-1-3-mainboard/1461-pcb1-3-motorstrom-wird-vermutlich-falsch-gemessen#13904
 
https://www.ardumower.de/index.php/de/forum/ardumower-1-3-mainboard/1461-pcb1-3-motorstrom-wird-vermutlich-falsch-gemessen#13904
  
  
Wenn M1 OUT1 und M1 OUT2 nicht abgeklemmt werden wird der Strom zu gering angezeigt.
+
If M1 OUT1 and M1 OUT2 are not disconnected, the measured and displayed current too low.
Daher muss der scale Wert für die richtige Strommessung in der setup Funktion der Klasse TMowMotorSensor in der Datei mowmotorSensor.h angepasst werden.
+
Therefore, the scale value for the correct current measurement must be adjusted in the setup function of the class TMowMotorSensor in the file mowmotorSensor.h.
Der scale factor sollte bei Strömen um die 1A oder mehr eingestellt werden. D.h. die Mähscheibe muss belastet werden, wenn man mit dem Multimeter den Strom misst.
+
The scale factor should be set at currents around 1A or more. Therefore he mower disc must be loaded with resitance when measuring the current with the multimeter.
  
Wenn M1 OUT1 und M1 OUT2 abgeklemmt werden ist der Faktor den ich durch Messen eingestellt habe vermutlich einigermaßen richtig. Dies kann aber nur durch Nachmessen von Stromstärken ab 1A überprüft werden.
+
If M1 OUT1 and M1 OUT2 are disconnected, the factor whih is set by default and find out by measuring is probably reasonably correct. However, this can only be checked by measuring current levels of 1A.
  
Der gemessene Strom und die Wattzahl wird mit dem Befehl
+
The measured current and wattage are displayed with the command:
  mot.curm  
+
  mot.curm
angezeigt.
+
  
==Langsamer fahren, wenn Mähmotor belastet==
+
== Slow down when mower engine is loaded ==
Wenn der Mähmotor belastet ist, wird der Mower langsamer.  
+
When the mower motor is loaded, the mower slows down.
  
Ab welcher Wattzahl des Mähmotors langsamer gefahren wird, wird in der config.h mit dem Parameter
+
From which wattage of the mower motor the mower is slowed down, can be configured in the config.h with the parameter
 
  #define CONF_MOW_MOT_UNDER_LOAD 30.0f  
 
  #define CONF_MOW_MOT_UNDER_LOAD 30.0f  
eingestellt. Wenn der Mähmotor über 30W benötigt, wird die Geschwindigkeit verlangsamt.
+
If the mower needs more than 30W, the speed will slow down.
  
Die aktuelle Watt Zahl beim Mähen kann mit dem Befehl
+
The current watts number when mowing can be displayed with the command:
 
  mot.curm  
 
  mot.curm  
angezeigt werden. Danach kann der Wert nach eigenem Ermessen eingestellt werden.
+
Thereafter, the value can be set at its discretion.
  
Achtung, die Motordriver liefern eine genaue Strommessung erst ab 1A (lt. Datenblatt 0.5A).  
+
Attention, the motor drivers deliver an accurate current measurement only from 1A on (according to data sheet 0.5A).
D.h. Werte wo der Strom unter 1A angezeigt wird sind ungenau und sollten nicht verwendet werden.
+
That Values where the current is displayed under 1A are inaccurate and should not be used.
Die Genauigkeit beträgt lt. Datenblatt bei einem Strom von über 0.5A +-20%.  
+
The accuracy is according to data sheet at a current of over 0.5A + -20%.
  
Der Code für die Geschwindigkeitseinstellung befindet sich in der Klasse class TCruisePerimeterNear : public Node in der Datei bCruise.h.
+
The speed setting code is in the class class TCruisePerimeterNear: public Node in the bCruise.h file.
  
Weiterhin ist zu berücksichtigen, dass die Ausgänge des Mähmotordrivers zusammengeschaltet wurden. Dies wird vom Hersteller nicht empfohlen und liefert eine falsche Strommessung.
+
Furthermore, it must be taken into account that the outputs of the mower motor driver have been interconnected. This is not recommended by the manufacturer and provides incorrect current measurement.
 
+
==Spiralfahrt==
+
Wenn der Mähmotor belastet wird, kann eine archimedische Spiralfahrt aktiviert werden. Dabei wird beim Start bereits mit einer kleinen Kurve begonnen, so dass das innere Rad sich dreht. Daher bleibt in der Mitte der Spirale ein kleiner Grasbüschel stehen.
+
 
+
Die Spirale wird in der config.h mit folgender Zeile aktiviert:
+
#define CONF_ACTVATE_AUTO_SPIRAL        true
+
 
+
Die unten aufgeführten Prameter können nach eigenem wünschen angepasst werden. Wenn die Spirale zu häufig gedreht wird, kommt der Roboter nicht von der Stelle und bearbeitet nur einen Bereich des Rasen.
+
 
+
Folgende Parameter in der config.h beeinflussen die Aktivierung der Spirale:
+
#define CONF_MOW_MOT_UNDER_HEAVY_LOAD_ON  45.0f  //If mow motor Watt is over this value, it is assumed that the motor is under heavy load.
+
#define CONF_MOW_MOT_UNDER_HEAVY_LOAD_OFF  30.0f  //If the mow moter is under heavy load, the measured watt must come under this value to reset heavy load.
+
#define CONF_MOW_MOT_UNDER_LOAD            30.0f  //The mow motor is under load, if this Watt is measured.
+
 
+
 
+
Die Implementierung der Aktivierung der Spirale befindet sich in der Datei: bCruise.h Klasse: class TCruisePerimeterNear: public Node
+
 
+
Der Code für die Aktivierung ist folgendermaßen:
+
if(CONF_ACTVATE_AUTO_SPIRAL) {
+
(a) if(bb.mowMotorSensor.motorUnderHeavyLoad) {
+
        if(millis()-bb.lastTimeSpiralStarted  > 60000ul) {
+
            bb.flagCruiseSpiral = true;
+
        }
+
    }
+
(b) if( (millis()-bb.lastTimeSpiralStarted  > 180000ul) &&    bb.mowMotorSensor.checkIfUnderLoad() ) { // Alle 3 Minuten Spirale starten wenn motor belastet
+
        bb.flagCruiseSpiral = true;
+
    }
+
}
+
 
+
Es gibt zwei unabhängige Bedingungen, für das Aktivieren einer Spiralfahrt (a) und (b).
+
 
+
(b) Eine Spirale wird aktiviert, wenn bb.mowMotorSensor.checkIfUnderLoad() true zurückgibt und die letzten 3 Minuten keine Spirale gefahren wurde. Die Berechnung in  bb.mowMotorSensor.checkIfUnderLoad() wird durch die die Konstante
+
#define CONF_MOW_MOT_UNDER_LOAD  30.0f
+
beeinflusst. Benötigt der Mähmotor mehr Leistung als CONF_MOW_MOT_UNDER_LOAD  definiert, gibt die Funktion bb.mowMotorSensor.checkIfUnderLoad() true zurück ansonsten false.
+
CONF_MOW_MOT_UNDER_LOAD beeinflusst auch "Langsamer fahren, wenn Mähmotor belastet" wie oben beschrieben.
+
 
+
(a)  Eine Spirale wird aktiviert, wenn bb.mowMotorSensor.motorUnderHeavyLoad() true zurückgibt und die letzten 60 Sekunden keine Spirale gefahren wurde. Die Berechnung in  bb.mowMotorSensor.checkIfUnderLoad() wird durch die die Konstante
+
#define CONF_MOW_MOT_UNDER_HEAVY_LOAD_ON  45.0f
+
#define CONF_MOW_MOT_UNDER_HEAVY_LOAD_OFF  30.0f
+
beeinflusst. Zum bestimmen ob der Motor under heavy load ist, wird eine Hysterese verwendet. Sobald die  Mähmotor Wattzahl über CONF_MOW_MOT_UNDER_HEAVY_LOAD_ON    geht, gibt bb.mowMotorSensor.checkIfUnderHeavyLoad() true zurück. Doch erst wenn die Wattzahl wieder unter CONF_MOW_MOT_UNDER_HEAVY_LOAD_OFF  geht wird false zurückgegeben.
+
 
+
Die Funktionen checkIfUnderHeavyLoad () und checkIfUnderLoad () sind in der Datei: mowmotorSensor.h Klasse: class TMowMotorSensor : public Thread definert.
+
 
+
Die Implementierung der Spirale selber befindet sich in der Datei: bCruise.h Klasse: class TCruiseSpiral: public Node
+
 
+
folgende Werte beeinflussen das Fahren der Spirale:
+
#define CONF_DISTANCE_BETWEEN_WHEELS_CM        36.0f // Distance where the wheels hits the ground do not measure on top of the wheels!!!
+
#define CONF_MAX_SPIRAL_RADIUS_CM 150.0f
+
#define CONF_START_SPIRAL_RADIUS_CM 27.0f
+
#define CONF_SPIRAL_SEGMENTS 16.0f
+
 
+
Anmerkung: Im BHT wird angezeigt, das die Spirale in der Klasse TCruiseMowMotHeavyLoad gestartet wird. Dies ist nicht der Fall, da die Implementierung sehr einfach ist. Die Klasse TCruiseMowMotHeavyLoad gibt es nicht. Die Funktion wurde in die Klasse TCruisePerimeterNear mit implementiert.
+
<gallery>
+
  File:RaindancerBHTSpiralfahrt.JPG | Spiralaktivierung designed im BHT
+
</gallery>
+
  
 
==Perimeter Tracking==
 
==Perimeter Tracking==
Hier wird der Perimetertrackingalgorithmus erklärt, mit dem Ziel genügend Informationen zu liefern, dass dieser durch den Anwender auf sein Chassis optimiert werden kann. Es fiel die Wahl auf diesen Algorithmus, da dieser unabhängig von der Perimeteramplitude ist. Weiterhin ist der Algorithmus extrem stabil und nicht von seinem Vorhaben abzubringen dem Perimeter zu folgen. [https://www.youtube.com/watch?v=RdufyzkYSPU '''Video Beispiel''']
+
Here, the perimeter tracking algorithm is explained, with the aim of providing enough information to be optimized by the user on its chassis. The choice fell on this algorithm, since it is independent of the perimeter amplitude. Furthermore, the algorithm is extremely stable and is to be diverted from its intention to follow the perimeter. [https://www.youtube.com/watch?v=RdufyzkYSPU '' 'Video Example' '']
  
Als Perimetertrackingalgorithmus wird ein one bounce Algorithmus verwendet. Der Algorithmus fährt counter clockwise den Perimeter ab. Dabei bounced die rechte äußere Spule immer gegen den Perimeter von außen. Wenn diese gegen den Perimeter stößt, wird die Spule erstmal vom Perimeter abgestoßen. Danach bewegt sich die Spule in einem Bogen zum Perimeter hin. [https://www.youtube.com/watch?v=Y3wxURV0qtw '''Video Beispiel''']
+
The perimeter tracking algorithm uses a one bounce algorithm. The algorithm move off counterclockwise on the perimeter. The right outer coil bounce always against the perimeter from the outside. When it hits the perimeter, the coil is first repelled by the perimeter. Thereafter, the coil moves in an arc towards the perimeter. [https://www.youtube.com/watch?v=Y3wxURV0qtw '' 'Video Example' '']
  
 
[[Datei:OneBounce.png]]
 
[[Datei:OneBounce.png]]
  
Der Algorithmus ist in der Datei: bGotoAreaX.h Klasse: TlineFollow implementiert.  
+
The algorithm is in the file: bGotoAreaX.h class: TlineFollow implemented.
Die folgende Darstellung zeigt die if Abfragen in einer anderen chronologischen Reihenfolge zur besseren Erklärung, als diese tatsächlich im Programmcode stehen. Daher nicht verwirren lassen, wenn man den Programmcode ansieht.
+
The following diagram shows the "if" queries in a different chronological order for a better explanation than they actually are in the program code. Therefore, do not be confused when looking at the program code.
  
Ablauf:
+
Procedure:
Die rechte Spule befindet sich immer außerhalb des Perimeter.
+
The right coil is always outside the perimeter.
Wenn diese den Perimeter nach innen überschreitet, wird als erstes eine aggressive Drehung clockwise ausgeführt mit:
+
If this exceeds the perimeter inwards, an aggressive rotation is first executed clockwise with:
 
  bb.motor.L->setSpeed((bb.cruiseSpeed + 5));
 
  bb.motor.L->setSpeed((bb.cruiseSpeed + 5));
 
  bb.motor.R->setSpeed((bb.cruiseSpeed - 20));  
 
  bb.motor.R->setSpeed((bb.cruiseSpeed - 20));  
  
Sollte die Spule dann nach 1 Sekunde nicht außerhalb sein, wird die Drehung aggressiver:
+
Should the coil not be outside after 1 second, the rotation becomes more aggressive:
 
  if ((millis() - lastTransitionTime) > 1000) { // If more than 1sec inside rotate aggressive
 
  if ((millis() - lastTransitionTime) > 1000) { // If more than 1sec inside rotate aggressive
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + 10));  
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + 10));  
Zeile 947: Zeile 838:
 
  }
 
  }
  
Sollte die Spule dann nach 1,5sek Sekunde nicht außerhalb sein, wird gedreht
+
If the coil is not outside after 1.5 seconds, the mower will turn
 
  if ((millis() - lastTransitionTime) > 1800) {
 
  if ((millis() - lastTransitionTime) > 1800) {
 
   bb.cruiseSpeed = 25;
 
   bb.cruiseSpeed = 25;
Zeile 955: Zeile 846:
 
}
 
}
  
Wenn die Spule nun nach außen gedreht wurde, fährt der Roboter eine seichte Kurve counter clockwise, bis er den Perimeter erreicht.
+
When the coil is now turned out, the robot moves a shallow counter clockwise curve  until it reaches the perimeter.
Für die Berechnung der Kurve, wird ein Integral verwendet, das mit dem Faktor Ki gesteuert werden kann.
+
For the calculation of the curve, an integral is used, which can be controlled by the factor Ki.
(Anmerkung: Das Integral wird auf 0 gesetzt, sobald die Spule den Perimeter überschreitet.)
+
(Note: The integral is set to 0 as soon as the coil crosses the perimeter.)
 
   
 
   
  integral = integral + (Ki*error); // der Wert error ist eine Konstante und hat den Wert -1 wenn die Spule außerhalb des Perimeters ist.
+
  integral = integral + (Ki*error); // the value error is a constant and has the value -1 if the coil is outside the perimeter.
 
  double Output = integral;
 
  double Output = integral;
  
Das Fahren der Kurver erfolg dann folgendermaßen: Dadurch, dass das Integral größer wird, wird die Kurve mit zunehmender Integralgröße kleiner.
+
The move of the curve is then carried out as follows: As the integral increases, the curve becomes smaller as the integral becomes larger.
  bb.motor.L->setSpeed((bb.cruiseSpeed + Output));  // beachte: Output ist negative
+
  bb.motor.L->setSpeed((bb.cruiseSpeed + Output));  // note: output is negative
 
  bb.motor.R->setSpeed((bb.cruiseSpeed));
 
  bb.motor.R->setSpeed((bb.cruiseSpeed));
  
Wenn nach 1 Sekunde der Perimeter nicht überschritten wurde, wird aggressiver die Kurve gefahren;
+
If the perimeter is not exceeded after 1 second, the curve is driven more aggressively;
 
  if ((millis() - lastTransitionTime) > 1000) { // If more than 2sec Outside rotate aggressive
 
  if ((millis() - lastTransitionTime) > 1000) { // If more than 2sec Outside rotate aggressive
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
 
   bb.motor.R->setSpeed((bb.cruiseSpeed +5));
 
   bb.motor.R->setSpeed((bb.cruiseSpeed +5));
 
  }
 
  }
Wenn nach 1.5 Sekunde der Perimeter nicht überschritten wurde, wird noch aggressiver die Kurve gefahren:
+
If after 1.5 seconds the perimeter was not exceeded, the curve is driven even more aggressive:
 
  if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
 
  if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
 
   bb.motor.R->setSpeed((bb.cruiseSpeed +10));
 
   bb.motor.R->setSpeed((bb.cruiseSpeed +10));
 
  }
 
  }
Wenn nach 2 Sekunde der Perimeter nicht überschritten wurde, wird gedreht:
+
If after 2 seconds the perimeter has not been exceeded, the following is rotated:
 
  if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
 
  if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
 
   bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
Zeile 989: Zeile 880:
  
  
Sollte die linke Spule außerhalb des Perimeters sein, wird sofort counter clockwise gedreht:
+
If the left coil is outside the perimeter, immediately counter clockwise is turned:
 
  if (bb.perimeterSensoren.isLeftOutside() == true) {
 
  if (bb.perimeterSensoren.isLeftOutside() == true) {
 
   bb.cruiseSpeed = 25;
 
   bb.cruiseSpeed = 25;
Zeile 999: Zeile 890:
  
  
Zum Einstellen des Algorithmus sollte als erstes versucht werden eine gerade Strecke zu fahren. Dabei ist das erste Rausdrehen zu konfigurieren und Ki für den Bogen zum reinfahren.
+
To set the algorithm, the first thing you should try to do is drive straight. Here is the first turn out to configure and Ki for the curve to drive in.
  
Testen des Algorithmus:
+
Testing the algorithm:
Den Roboter auf den Perimeter stellen, so das die linke Spule außen ist und die rechte Spule innen. Mit dem Befehl
+
Place the robot on the perimeter so that the right coil is on the outside and the left coil on the inside. Start the perimeter tracking with the command.
 
  tpt    //test perimeter tracking to dock. Mower stands on perimeter
 
  tpt    //test perimeter tracking to dock. Mower stands on perimeter
das Perimetertracking starten.
+
Der Befehl
+
The command
 
  M
 
  M
stoppt den Test.
+
stops the test.
 +
 
 +
With the command
 +
set.lfki, 1.1
 +
the Ki value can be set during testing. If satisfactorily determined, the value must be assigned in the TlineFollow class in the constructor.
 +
 
 +
When the drive wheels are rear, the distance to the coils is greater and the coils can be located off center. The original Ardumower chassis has front drive wheels. Here, the right coil must be placed close to the center, otherwise the rotation is too asymmetrical. Due to the short distance, the bounce interval of 1 sec is probably to be shortened, so that on a straight line probably all 0.3sec must be bounced. (Currently not tested)
  
Mit dem Befehl
+
== Fast return ==
set.lfki,1.1
+
On the way back to the charging station, it may happen that the Mower drives at one point onto the perimeter so that it has to drive the entire perimeter wire to the charging station. To shorten this way, there is the fast return.
kann der Ki Wert während des Testen eingestellt werden. Der Wert muss wenn zufriedenstellend ermittelt, in der Klasse TlineFollow im Konstructor zugewiesen werden.  
+
The user has to lay the perimeter cable so that it results in a square. This quadrilateral is then recognized by the robot during perimeter tracking. When he recognizes the square, he turns 90 degrees from the perimeter into the interior, and moves to the other side of the lawn. When he discovers the perimeter cable, he picks up the perimeter tracking again.
  
Wenn die Antriebsräder hinten sind, ist der Abstand zu den Spulen größer und die Spulen können außerhalb der Mitte angeordnet werden. Bei dem original Ardumower Chassis sind die Antriebsräder vorne. Hier muss die rechte Spule nah der Mitte angeordnet werden, ansonsten ist die Drehung zu asymmetrisch. Aufgrund der kurzen Distanz ist vermutlich auch das Bounce-Intervall von 1 Sek. zu verkürzen, so dass auf gerader Strecke vermutlich alle 0.3Sek gebounced werden muss.(aktuell nicht getestet)
+
To enable the fast return you have to set following option in config.h.
 +
#define CONF_DISABLE_FAST_RETURN  false
  
==Schnelle Rückkehr==
+
For the square, the following dimension has been found to be favorable. However, it depends on the dimensions of the Mower. The Mower should come while tracking in the turning mode. Turn at the first left curve. Then turn at the next right curve. Then drive left curve. [Video:https://youtu.be/ipdVJzQn5Tc]
Auf dem Rückweg zu Ladestation kann es sein, dass der Mower an einer Stelle auf das Perimeter fährt, so dass er den gesamten Perimeterdraht bis zur Ladestation abfahren muss. Um diesen Weg zu verkürzen, gibt es die schnelle Rückkehr.
+
Der Anwender muss dazu das Perimeterkabel so verlegen, dass es ein Viereck ergibt. Diese Viereck wird dann vom Roboter beim Perimetertracking erkannt. Wenn er das Viereck erkannt hat, dreht er sich um 90 Grad vom Perimeter weg in den Innenbereich, und fährt auf die andere Seite des Rasens. Wenn er dort das Perimeterkabel entdeckt, nimmt er von dieser Stelle das Perimetertracking wieder auf.
+
  
Für das Viereck hat sich folgende Abmessung als günstig herausgestellt. Es kommt allerdings auch auf die Abmessungen des Mowers an. Der Mower sollte bei dem Tracking in den Drehmodus kommen. Drehen bei der ersten Linkskurve. Dann drehen bei der nächsten Rechtskurve. Dann Linkskurve fahren. [Video:https://youtu.be/ipdVJzQn5Tc]
 
  
Das Viereck kann auf zwei Arten verlegt werden. Einmal mit Ecken und einmal mit abgeflachten Ecken. Die Abgeflachten Ecken sind dazu da, dass der Mower an der Ecke besser erkennt, in welche Richtung er sich vom Perimeter wegdrehen soll, wenn er fast parallel zum Perimeter fährt. Dadurch ist die Perimeternahe Spule als erstes draußen und er dreht vom Perimeter weg anstatt zum Perimeter hin. Das ist notwendig, falls hinter dem Perimeter ein Beet kommt in das sich der Mower reindrehen könnte.
+
The square can be laid in two ways. Once with corners and once with flattened corners. The flattened corners are there for the mower to better recognize at the corner in which direction it should turn away from the perimeter when it is almost parallel to the perimeter. As a result, the perimeter nearest coil is the first outside and it turns away from the perimeter rather than toward the perimeter. This is necessary if there is a bed behind the perimeter into which the mower could turn.
  
 
[[Datei:ViereckSchnelleRückkehr.JPG]]   
 
[[Datei:ViereckSchnelleRückkehr.JPG]]   
Zeile 1.028: Zeile 923:
  
 
<gallery>
 
<gallery>
   File:Raindancer FastReturn.png |  Beispiel, wie ich meine Vierecke angebracht habe
+
   File:Raindancer FastReturn.png |  Example, how I lay down my squares
 
</gallery>
 
</gallery>
  
  
Die Erkennung ist abhängig von der Position der Spulen und vom Abstand der Spulen zum Antriebsrad.
+
The detection depends on the position of the coils and the distance between the coils and the drive wheels.
  
Die Implemetierung steht in der Datei: bPerimeterTracking.h Klasse: class TfindTriangle : public Node
+
The implemetation is in the file: bPerimeterTracking.h Class: class TfindTriangle: public Node
  
Die Erkennung erfolgt anhand des jeweils gedrehten Winkels. Sie wurde mit einer Statemachine umgesetzt.
+
Detection is based on the rotated angle. It was implemented with a state machine.
  
Den Ablauf der Statmachine und die berechneten Winkel kann man sich mit dem Befehl bht.tri  anzeigen lassen.
+
The procedure of the statmachine and the calculated angles can be displayed with the command:
 
  bht.tri  
 
  bht.tri  
  
Die entsprechenden Winkel und maximal Distanzen muss man dann im Code in der Klasse: class TfindTriangle anpassen.
+
The corresponding angles and maximum distances must then be adapted in the code in class: class TfindTriangle.
Im Folgenden die leicht ausgedünnte Klasse um einen besseren Überblick zu bekommen. Die Zeilen errorHandler.setInfoNoLog(..) sind die Ausgabe, wenn der Befehl bht.tri aktiviert wurde. Diese wurden hier mit aufgeführt um die Ausgabe besser interpretieren zu können.
+
Below Ishow slightly thinned class to get a better overview. The lines errorHandler.setInfoNoLog (..) are the output if the command bht.tri has been activated. These were listed here to better interpret the issue.
  
  
 
   virtual NodeStatus onUpdate(Blackboard& bb) {
 
   virtual NodeStatus onUpdate(Blackboard& bb) {
 
     ...
 
     ...
Der gefahrene Winkel wird vor dem Case Statement alle 500ms ermittelt.
+
The driven angle is determined every 500ms before the case statement.
 
     //============================================
 
     //============================================
 
     // Calculate driven angle every 500ms.
 
     // Calculate driven angle every 500ms.
Zeile 1.059: Zeile 954:
 
       }
 
       }
 
     }
 
     }
Abfrage der States
+
Query the States
 
     // Check for left curve / right curve / second left curve
 
     // Check for left curve / right curve / second left curve
 
     switch (state)
 
     switch (state)
 
     {
 
     {
  
Im case 0 wird nach eine Linkskurve gesucht. Ein negativer Winkel bedeutet eine Linkskurve/-drehung. Wenn der Winkel z.B. <-25 Grad ist, wurde diese gefunden und es wird in den case 1 geschaltet.  
+
In case 0, a left turn is searched. A negative angle means a left curve/turn. If the angle is e.g. <-25 degrees, a curve was found and it will branched into case 1.  
 
     case 0:  // search for left curve
 
     case 0:  // search for left curve
 
       if (angle < -25) {  
 
       if (angle < -25) {  
Zeile 1.076: Zeile 971:
 
       break;
 
       break;
  
In case 1 wird ständig überprüft, ob eine bestimmte Strecke nach der Linkskurve überschritten wurde. Im Beispiel 55cm. Wenn ja, ist das zu weit und es wird wieder zurück in den case 0 gesprungen, da es nicht sein kann, das das Dreieck so lang ist. Wenn innerhalb der Strecke von 55cm dann ein  Winkel > 50 gefunden wurde, wird in den case 2 gesprungen. Ein positiver Winkel bedeutet eine Rechtskurve/-drehung.  
+
In case 1, it is constantly checked whether a certain distance has been exceeded after the left turn. In the example 55cm. If so, that is too far and it jumps back into the case 0, since it can not be that the first way is so long. If an angle> 50 has been found within the distance of 55cm, the case 2 is jumped. A positive angle means a right turn.
 
     case 1: // search for right turn
 
     case 1: // search for right turn
 
       distance = bb.motor.getDistanceInCMForTriangle();
 
       distance = bb.motor.getDistanceInCMForTriangle();
Zeile 1.095: Zeile 990:
 
       break;
 
       break;
  
In case 2 wird als erstes wieder die gefahrene Distanz nach dem Rechtswinkel überprüft. Solange die Distanz von 50 cm nicht überschritten wurde, wird auf eine Linkskurve geprüft. Wenn der Winkel <-25 Grad ist, wurde diese erkannt und es wird in den State 3 gesprungen.  
+
In case 2, the distance traveled after the right angle is checked first again. As long as the distance of 50 cm has not been exceeded, a left turn is checked. If the angle is <-25 degrees, a curve was detected and jumped into state 3.  
 
     case 2:  // search for second left curve
 
     case 2:  // search for second left curve
 
       distance = bb.motor.getDistanceInCMForTriangle();
 
       distance = bb.motor.getDistanceInCMForTriangle();
Zeile 1.114: Zeile 1.009:
 
       break;
 
       break;
  
Case 3 gibt BH_SUCCESS an den BHT zurück und es wird auf die andere Seite des Rasens gefahren.
+
Case 3 returns BH_SUCCESS to the BHT and the mower drives to the other side of the lawn.
 
     case 3:
 
     case 3:
 
       if (flagShowFindTriangleStates) {
 
       if (flagShowFindTriangleStates) {
Zeile 1.129: Zeile 1.024:
  
  
Testen des Algorithmus: Den Roboter auf den Perimeter stellen, so das die linke Spule außen ist und die rechte Spule innen. Mit dem Befehl
+
Testing the Algorithm: Place the robot on the perimeter so that the left coil is on the outside and the right coil is inside. Start the perimeter tracking with the command.
 
  tpt    //test perimeter tracking to dock. Mower stands on perimeter
 
  tpt    //test perimeter tracking to dock. Mower stands on perimeter
das Perimetertracking starten.
 
  
Mit dem Befehl
+
 
 +
Start the output of the quadrilateral detection with the command.
 
  bht.tri  
 
  bht.tri  
die Ausgabe der Viereckserkennung starten. (tri steht für triangle, da vorher wurde ein Dreieck zur Erkennung verwendet wurde)
+
(tri stands for triangle, since previously a triangle was used for detection)
  
==Mähzonen zwischen aneinander liegenden Flächen==
+
== Mowing zones between adjacent surfaces ==
Mähzonen können eingerichtet werden zwischen aneinander liegenden Flächen die eine direkte Verbindung haben. Dazu wird das Perimeterkabel zwischen den Flächen in einem Abstand von ca. 13cm verlegt. Es wird eine Lücke von ca. 30cm zu dem gegenüberliegenden Perimeterkabel gelassen. Dadurch ist die Wahrscheinlichkeit geringer, dass der Roboter auf die andere Fläche fährt.
+
Mowing zones can be set up between adjacent surfaces that have a direct connection. For this, the perimeter cable between the surfaces is laid at a distance of about 13cm. A gap of about 30cm or less is left to the opposite perimeter cable. This reduces the likelihood that the robot will move to the other area.
  
Siehe Bild:
+
See image:
 
<gallery>
 
<gallery>
 
   File:RaindancerGroundAreas.png |  Beispiel, Mähzonenabgrenzung
 
   File:RaindancerGroundAreas.png |  Beispiel, Mähzonenabgrenzung
Zeile 1.146: Zeile 1.041:
 
</gallery>
 
</gallery>
  
''(Im obigen Bild ist es normal nicht notwendig Mähzonen einzurichten, da der Roboter durch den Algorithmus relative gut alle Bereiche des Rasens abdeckt.)''
+
''(In the picture above, it is not normally necessary to set up mowing zones, as the robot covers relatively well all areas of the lawn by the algorithm.)''
  
Der Abstand des Bereichsabgrenzungskabels zum gegenüberliegenden Perimeterkabel (hier 30cm Abstand) kann durch Tests optimiert werden. Der Abstand hängt von der Funktionalität des Perimetertracking ab. Zum einen von der Position der linken Spule beim Tracken des gebenüberliegenden Kabels, sowie das Tracking des Bereichsabgrenzungskabels selber.
+
The distance of the area delineation cable to the opposite perimeter cable (here 30cm distance) can be optimized by tests. The distance depends on the functionality of the perimeter tracking. Firstly, the position of the left coil when tracking the overlying cable, as well as the tracking of the area delineation cable itself.
  
In der config.h sollte die Konstante CONF_USE_ZONE_RECOGNITION  auf true gesetzt werden.
+
Since the robot travels with the coils about 20 cm over the cable by default, it may be that it stops with the coils within the next range.
#define CONF_USE_ZONE_RECOGNITION true
+
  
Da der Roboter voreingestellt mit den Spulen ca. 20cm über das Kabel fährt, kann es sein, dass er mit den Spulen dann innerhalb des nächsten Bereichs stehen bleibt.
+
Approaching an area from the charging station is done with the command:
Wenn CONF_USE_ZONE_RECOGNITION false ist, würde der Roboter einfach weiterfahren, da er ggf. eine Ecke überfahren hat.  
+
area,x    // where x is the path to be traveled in m.
Wenn CONF_USE_ZONE_RECOGNITION  true ist, wird nach dem Überfahren geprüft, ob beide Spulen wieder innerhalb des Perimeters sind. Falls ja, wird mindestens eine Strecke von (-CONF_PERIMETER_DRIVE_BACK_CM-10) zurückgefahren. Also 10cm mehr als sonst CONF_PERIMETER_DRIVE_BACK_CM zurückfahren würde.
+
If the specified distance x has been covered at the perimeter, the Mower starts mowing.
  
Das Anfahren eines Bereiches aus der Ladestation heraus erfolgt mit dem Befehl:
+
The distance traveled on the perimeter can be displayed or measured with the command.
area,x    //wobei x der zurückzulegende Weg in m ist.
+
Wurde die angegebene Strecke x am Perimeter zurückgelegt, fängt der Mower an zu mähen.
+
 
+
Die gefahrene Distanz auf dem Perimeter kann mit dem Befehl
+
 
  show.distance
 
  show.distance
angezeigt bzw. gemessen werden.
 
  
Achtung: Man sollte sich genau merken, wo die Kabel für die Mähzonenabgrenzung liegen für den Fall, dass der Rasen vertikutiert wird.
 
  
==Verlegung des Perimeterkabels an Ecken==
+
Attention: It is important to remember exactly where the mower zone cables are located in case the grass is scarred.
Der Mower bestimmt in welcher Richtung er sich am Perimter dreht anhand der zuerst rausgefahrenen Spule. Daher ist es wichtig die Ecken nicht im 90 Grad Winkel zu verlegen.
+
Wenn der Mower z.B, mit der rechte Spule nahe am Perimeter langfährt und dann an der Ecke rausfährt, sollte auch die rechte Spule als erstes aus dem Perimeter fahren.
+
  
In den folgenden Bildern sind drei Beispiele zu sehen, wie Ecken verlegt werden sollten.
+
== Laying the Perimeter Cable at Corners ==
 +
The Mower determines in which direction he turns on the perimter on the basis of the coil that was pulled out first. Therefore it is important not to lay the corners at 90 degrees.
 +
For example, if the Mower, with the right spool, moves close parallel to the perimeter and then drives out at the corner, the right spool should also be the first to leave the perimeter.
 +
 
 +
The following pictures show three examples of how corners should be moved..
  
 
<gallery>
 
<gallery>
Zeile 1.179: Zeile 1.069:
 
</gallery>
 
</gallery>
  
=Perimeter Sender=
+
==Temperature Sensor==
Es wir die original Ardumower Sender Hardware verwendet. Die Software wurde etwas abgeändert. Es wird ein 128 Bit Signal gesendet.
+
The temperature sensors DHT11 / DHT21 / DHT22 / AM2301 are supported. Currently only the sensor DHT22 was tested.
 +
The temperature sensor is connected to the designated port of the PCB1.3.
  
Folgendes Perimetersignal wird gesendet:
+
In config.h the used temperature sensor must be configured:
 +
#define DHTTYPE DHT22
 +
 
 +
To enable the service, the following line must be configured:
 +
#define CONF_DISABLE_DHT_SERVICE  false  // Disables temp sensor
 +
 
 +
The sensor is read out with the following command:
 +
temp.show
 +
In manual mode, the sensor is read out directly. Temperature, humidity and the last temperature stored in the service are displayed.
 +
In auto mode, only the temperature stored in the service is displayed. The temperature is updated when the mower drives over the perimeter wire and comes to a stop and time has passed at least 20 seconds since the last measurement.
 +
 
 +
The DHT service turns off the power of the PCB1.3 when a temperature of 50 degrees has been measured twice:
 +
#define CONF_OVERHEATING_TEMP  50.0f  // if this temperature is measured, robot shuts down the complete power for security
 +
 
 +
==Rain Sensor==
 +
When the robot mows in AUTO mode and it starts to rain, the robot returns to the charging station.
 +
The rain sensor is connected to the designated port of PCB1.3.
 +
The sensitivity of the rain sensor is set on the rain sensor with the potentiometer.
 +
 
 +
To enable the service, the following line must be configured:
 +
#define CONF_DISABLE_RAIN_SERVICE false  // Disables rain sensor
 +
 
 +
The rain sensor is read out approx. every 1.7 seconds.
 +
 
 +
The read out can be displayed with
 +
rain.show
 +
 
 +
==Shutdown Service==
 +
 
 +
When the shutdown service is activated, it shuts off the power via the undervoltage protection.
 +
If a Raspberry PI is connected to the USB port,
 +
CONF_WAIT_FOR_PI_SHUTDOWN = true
 +
can be set.
 +
Then the software waits 50 seconds for shutdown.
 +
Every second, $PwrOff and a countdown are sent to the PI so that it can shut down.
 +
 
 +
With the command:
 +
  poweroff
 +
the shutdown can be activated via the user interface or from the PI.
 +
 
 +
The shutdown service is also used by the battery service and the temperature service to shut down.
 +
Thus, the PI is informed that it should shut down if the battery voltage is too low or the temperature too high.
 +
 
 +
==GPS Service==
 +
The GPS service receives the data from the GPS module.
 +
 
 +
There are two ways to process this data. Both options can be used in parallel.
 +
a) The received GPS data will be forwarded to the Raindancer Controlcenter.
 +
b) The received GPS data are evaluated in the Raindancer firmware. You can then define an area on the lawn.
 +
   If the mower is in this area, it is assumed that the mower is inside the perimeter wire. So it is possible to bridge a weak perimeter signal on larger areas.
 +
 
 +
The GPS module is connected to the dedicated connector on PCB1.3. The GPS module periodically sends data to PCB1.3.
 +
If no data is received, please read the following article. It may be that RX3 and TX3 on the PCB1.3 were wired incorrectly.
 +
https://www.ardumower.de/index.php/de/forum/navigation-gps-odmetrie/1737-wait-for-gps-position-data
 +
 
 +
===Send to the Raindancer Controlcenter===
 +
To enable the GPS service, the following must be configured::
 +
#define CONF_DISABLE_GPS false
 +
 
 +
For the first commissioning you can set the following parameters:
 +
#define CONF_GPS_PASS_THROUGH true
 +
#define CONF_DEACTIVATE_GPS_CALCULATION true
 +
The parameter #define CONF_GPS_PASS_THROUGH tells the firmware that all received GPS data should be sent to the control center.
 +
 
 +
 
 +
In order to get this data displayed on the console, the following command must be executed:
 +
set.cco, 1
 +
Now you can see all the data sent to the control center. Including the GPS records.
 +
 
 +
With the following command you stop the output:
 +
set.cco,0
 +
 
 +
 
 +
 
 +
By default, the GPS module sends multiple records in a 1 second interval. These records are not all needed and generate an overhead.
 +
Only the record: $GPRMC for NEO-6M and $GNRMC for NEO-M8N are needed.
 +
Therefore, there is the possibility to configure the module when starting the Raindancer firmware so that it sends only the required record and this only in a 3 second cycle.
 +
For this the following parameter is set:
 +
#define CONF_INIT_GPS_WITH_UBLOX true
 +
Thus the array const char UBLOX_INIT [] (in config.h) is sent to the GPS module during startup. To activate or deactivate you have to comment in or comment out individual lines.
 +
 
 +
 
 +
=== Enable internal calculation ===
 +
Again #define CONF_INIT_GPS_WITH_UBLOX should be true.
 +
To activate the internal calculation CONF_DEACTIVATE_GPS_CALCULATION  must be set.
 +
#define CONF_DEACTIVATE_GPS_CALCULATION false
 +
For the NEO-6M module, the record: $GPRMC is used. The NEO-M8N uses the record $GNRMC.
 +
Therefore, the following lines must be commented in or out depending on the module used:
 +
#define CONF_N_GPRMC_STR            "$GPRMC"    // GPS messagetype begin for $GPRMC for NEO-6M
 +
//#define CONF_N_GPRMC_STR          "$GNRMC"    // GPS messagetype begin for $GPRMC for NEO-M8N
 +
 
 +
With
 +
gps.show
 +
you can display the calculated values.
 +
 
 +
If you have included the "GxGGA on" data set in UBLOX_INIT [], then Quality, Satellites and Altitude will also be displayed. These are not used anymore for other things.
 +
 
 +
 
 +
It is possible to configure a GPS area in which the Mower assumes he is in the perimeter if the perimeter signal is too weak for detection.
 +
 
 +
The area is specified as a polygon.
 +
const float CONF_LAT_POLYGON_Y[] = { 54.083245f, 54.084068f,  54.084679f,  54.085623f,  54.084018f }; // Latitude polygon points
 +
const float CONF_LON_POLYGON_X[] = { 10.447986f, 10.447055f,  10.446015f,  10.447120f,  10.44930f }; // Longitudinal polygon points
 +
const int  CONF_NUMBER_OF_POLYGON_POINTS = 5;  // The number of the ploygon points
 +
Each column belongs to a polygon point. You can at https://www.google.com/maps enter a point in the search: 54.08728,10.448400. Then you can see where this coordinate is. So you can see point by point how the polygon is constructed.
 +
It is important that the number of columns is defined correctly with CONF_NUMBER_OF_POLYGON_POINTS. You can enter 3 to N coordinate points. However, I suggest you use no more than 8 points to make the calculation time as low as possible
 +
 
 +
To find the points, you can set the robot to the appropriate point and enter gps.show. Then, e.g. the following is displayed:
 +
!03,$GPRMC,104503.00,A,5123.24690,N,00812.92063,E,0.094,,290718,,,A*72
 +
!03,$GPRMC speed: 0.094000 course:0.000000
 +
!03,$GPRMC lat: 54.08744800,N lon: 10.44867700,E
 +
!03,$GPRMC date: 29.7.18 time: 11:45:3
 +
 
 +
The point can then be taken from the line! 03,$GPRMC,lat:54.08744800,N lon:10.44867700,E. Here for Latitude = 54.087448 and Longitude = 10.448677.
 +
 
 +
 
 +
The area recognition is switched on with:
 +
  #define CONF_USE_GPS_POLYGON true
 +
 
 +
 
 +
It should be noted that the GPS signal has a tolerance of +-10m. That you should stay far enough away from the perimeter. Because that does sometimes not work, the parameter
 +
#define CONF_PER_THRESHOLD_IGNORE_GPS 300
 +
was introduced. This means that if the amplitude of the perimeter exceeds this value, the perimeter signal will be used in any case and will not be overwritten by the GPS signal, even if the mower is in the GPS range.
 +
The value 300 must be set according to your own requirements..
 +
 
 +
[[File:warning.png]]'''Safety Note: If the perimeter signal fails and the GPS range exceeds the perimeter, the mower will leave the perimeter area'''
 +
 
 +
=Perimeter Sender=
 +
The original Ardumower transmitter hardware is used. The software has been changed slightly. A 128 bit signal is sent.
 +
The following perimeter signal is sent:
 
  1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1,
 
  1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1,
 
  -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1
 
  -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1
  
Die LEDs haben folgende Funktion (von links nach rechts):
+
The LEDs have the following function (from left to right):
*1. 12V vorhanden
+
*1. 12V available
*2. 5V vorhanden
+
*2. 5V available
*3. Grün wenn der Interrupt läuft, der das Signal sendet ( rote LED nicht verfügbar). Aus wenn geladen wird.
+
*3. Green when the interrupt which produces the signal is running (red LED not available because of wrong pin at Nano). Off when charging.
*4. Grün wenn ein Strom durch den Perimeter fließt, rot wenn keine Strom fließt (Perimeter unterbrochen) oder sehr wenig Strom. Aus wenn geladen wird.
+
*4. Green when a current flows through the perimeter, red when no current is flowing (perimeter interrupted) or very little current because of high protective resistor. Off when charging.
*5. Gelb der Roboter wird geladen. Perimetersignal ist ausgeschaltet.
+
*5. Yellow the robot is charging. Perimeter signal is switched off. LED 2 and 4 off.
  
Achtung: die LEDs 3 und 4 sind Duo LEDs. D.h. diese haben zwei Farben. Bei LED 3. ist die rote LED nicht ansprechbar, da auf dem Nano der falsche Pin hardwaretechnisch connected wurde. Desweiteren, können die LEDs falsch herum eingelötet worden sein. Dann wundert man sich z.B., dass LED 4. rot ist obwohl alles in Ordnug ist und ein Strom fließt. Oder eben LED 3. rot anzeigt, obwohl ich hier grün geschrieben habe.
+
When power on, all leds will be tested.
  
'''Wenn der Sender an ist und der Roboter kehrt nach zwölf Stunden nicht in die Ladestation, schaltet der Sender das Signal ab.''' Dann entweder den Sender neu starten, oder den Roboter in der Ladestation laden.
+
Attention: LEDs 3 and 4 are Duo LEDs. These LEDs have two colors. With LED 3. the red LED is not addressable, because on the Nano the wrong pin was hardware-technically connected. Furthermore, the LEDs may have been soldered the wrong way round. Then one wonders, for example, that LED 4 is red even though everything is OK and a current flows. Or just LED 3. shows red, although I have written green here.
 +
 
 +
'''If the transmitter is on and the robot does not return to the charging station after twelve hours, the transmitter will turn off the signal.''' Then either reboot the transmitter or load the robot into the charging station.
 +
 
 +
=Charging Station =
 +
The charging stations are approached counterclockwise.
 +
 
 +
If no charging station is used,  
 +
  CONF_DISABLE_CHARGINGSTATION = true
 +
should be set. Then the Mower drives at low battery voltage to the perimeter and stops.
 +
 
 +
==Head charging station==
 +
 
 +
If a head charging station is used, make sure that the contacts can go back at least 3 cm when the Mower drives against it. It would be better 4 cm. Furthermore, it should be noted that the contact pressure of the contact is sufficient. I suggest using grinding contacts.
 +
 
 +
In order to use a head charging station, the following must be configured in config.h:
 +
#define CONF_DISABLE_CHARGINGSTATION      false
 +
#define CONF_PASS_THROUGH_CHARGING_STATION false //the mower can go through the station
 +
#define CONF_HEAD_CHARGING_STATION        true  //the mower can't go through the station
 +
 
 +
With the command
 +
gohome
 +
the mower is instructed to search the perimeter wire and drive to the charging station.
 +
 
 +
For testing, the mower can be placed on the perimeter wire, 2m in front of the charging station. Then enter
 +
tpt
 +
The Mower then drives to the charging station.
 +
 
 +
To leave the charging station enter
 +
area,0
 +
The Mower then drives 1m backwards, turns 90 degrees and drives 50cm forward. Then turn again a random angle and starts to mow. This process runs without bumper protection. Therefore, make sure that this area is free of obstacles.
 +
 
 +
The distances can be configured with the following parameters:
 +
#define CONF_HEAD_CHARGING_DRIVE_BACK_CM  100  //when the mower leaving the head charging station, how far it should drive back
 +
#define CONF_HEAD_CHARGING_DRIVE_FORW_CM    50  //when the mower drove back and then rotates 90 degree, how far it should run forward that both coils securely inside
 +
 
 +
 
 +
When the Mower has detected the charging contacts, it will travel 3cm back and 3cm forward.
 +
Then the charge relay is turned on. After 10 seconds, it is checked whether a charging current is flowing. If not, docking will be attempted a second time. If this does not work, an error will be issued.
 +
 
 +
==Through  Charging Station==
 +
If a through charging station is used, make sure that the contacts can grind at least 10cm. Furthermore, it should be noted that the contact pressure of the contact is sufficient.
 +
 
 +
In order to use a through charging station, the following must be configured in config.h:
 +
#define CONF_DISABLE_CHARGINGSTATION      false
 +
#define CONF_PASS_THROUGH_CHARGING_STATION true  //the mower can go through the station
 +
#define CONF_HEAD_CHARGING_STATION        false  //the mower can't go through the station
 +
 
 +
With the command
 +
gohome
 +
the mower is instructed to search the perimeter wire and drive to the charging station.
 +
 
 +
For testing, the Mower can be placed on the perimeter wire, 2m in front of the charging station. Then enter
 +
tpt
 +
The Mower then drives to the charging station.
 +
 
 +
To leave the charging station enter
 +
  area,10
 +
The Mower then travels 10m along the perimeter wire and then starts mowing. 10m can be exchanged against any distance.
 +
 
 +
 
 +
When the Mower has detected the charging contacts, it will move forward 4cm, back 3cm and forward 3cm. This is to make the contacts to grind a little for better contact.
 +
Then the charger relay is turned on. After 10 seconds, it is checked whether a charging current is flowing. If not, docking will be attempted a second time. If this does not work, an error will be output.
  
 
=Troubleshooting=
 
=Troubleshooting=
==Mower bleibt stehen==
+
== Mower stops ==
 
[[Problem:]]
 
[[Problem:]]
Mower blieb stehen, Ursache war wohl der Sender. Da leuchteten nur
+
Mower stopped, cause was probably the transmitter. On the transmitter just lights still the two left LEDs. Transmitter turned and on again, 4 LEDs back to green and then it works again.
noch die beiden linken LEDs. Sender ausgeschaltet und wieder
+
eingeschaltet, 4 LEDs wieder auf grün und dann ging es wieder.
+
  
[[Lösungsvorschlag:]]
+
[[Solution:]]
Die dritte grüne Leuchte von links zeigt an, ob der Sender Interrupt im Nano läuft.  
+
The third green light from the left indicates whether the transmitter Interrupt is running in the Nano.
  
Möglichkeit a)
+
Possibility A)
Der Sender ist länger als 3h an, ohne das der Roboter wieder in die Station zurückgekehrt ist. Dann schaltet der Sender das Perimetersignal ab.
+
The transmitter is on for more than 12 hours without the robot returning to the station. Then the transmitter turns off the perimeter signal.
  
Möglichkeit b)
+
Possibility b)
Da diese nicht an war scheint sich der Nano aufgehängt zu haben. Falls das noch mal passiert, würde ich den China Nano gegen einen original Arduino Nano austauschen. Da die Software bei mir seit einem Jahr läuft, gehe ich '''nicht''' davon aus, das diese die Ursache ist. Ich hatte vorher billige Nanos verwendet. Die waren bei mir nicht wirklich Frequenzstabil, was für den Sender aber notwendig ist. Nun habe ich einen Originalen drin.
+
Since this was not on, the nano seems to have hung up. If that happens again, I would swap the China Nano for an original Arduino Nano. Since the software has been running for me for a year, I do not assume that the software is the cause. I had used cheap nanos before. They were not really frequency stable with me, which is necessary for the transmitter however. Now I have an original in it.
  
==Ich bekomme diese Meldung: Out: READ und In: CMD==
+
==I got the message: Out: READ und In: CMD==
 
[[Problem:]] In Arduino Central wird folgendes angezeigt:
 
[[Problem:]] In Arduino Central wird folgendes angezeigt:
 
  Out: READ
 
  Out: READ
Zeile 1.222: Zeile 1.302:
 
  In: CMD: Command not recognized.
 
  In: CMD: Command not recognized.
 
  Out: READ
 
  Out: READ
[[Lösungsvorschlag:]]
+
[[Suggested solution:]]
In den Arduino Central Settings ist "Read Command -> Enable Read Command" eingeschaltet
+
In the Arduino Centrale Settings "Read Command -> Enable Read Command" is activated
  
 
=Understanding the Behaviour Tree=
 
=Understanding the Behaviour Tree=
 
Die Beschreibung steht ausschließlich in Englisch zur Verfügung.
 
  
 
#REDIRECT [[Understanding the Behaviour Tree]]
 
#REDIRECT [[Understanding the Behaviour Tree]]

Aktuelle Version vom 9. August 2020, 14:00 Uhr

Folks, English is not my native language. If you don't understand something or find a mistake, please inform me on the forum (name: Roland) or correct the mistake by yourself. Thank you very much.


This documentation is for firmware version 2.x.x.


The documentation of version 1.1.1 you can find here Raindancer Firmware V1.1.1


Download

Github Download

(On Github download the Zip-File with the green button)

The Raindancer firmware is located in the directory code\Raindancer

The transmitter firmware is located in the directory code\sender

Overview

The Raindancer firmware is based on the code of the Nucleomower which was realized with the development board STM32 Nuleo 411RE in 2016/2017. The firmware was then converted to Ardumower PCB 1.3 in 2017/2018. It pursues the goal of getting a stable system with as little hardware as possible, which works all year round and provides a good mowing result with the chaos principle.

The firmware has the following 'Workflow' : The Mower is in the charging station. The Mower drives from the charging station a predetermined distance along the perimeter to an area and then begins to mow after the chaos principle. The mowing time is approx. 130min-150min with the original Ardumowerkomponents. After the battery voltage has dropped to 23.7V, the robot looks for the perimeter cable and drives it to the charging station. Once in the charging station, the battery is charged. The next mowing operation is restarted via the mobile phone with a range command. (The robot can also be operated without a charging station.)

The firmware was developed for robots with the drive motor rear, but can also be used for the original Ardumower chassis. If the mower reaches the perimeter wire it will continue driving for approx. 20cm. Then the rmower drives back and will be further rotated at a random angle.

Internally in the firmware, distances are traveled in cm. This means that encoders are needed.

For the 'Perimeterrecognition' a 128-bit signal is used. Therefore, the Raindancer transmitter (sender) software must be installed on the transmitter. 2 perimeter receivers are needed. As you approach the perimeter cable, the robot slows down. If the robot does not recognize the signal for 2 seconds, it stops and switches off the motors. If it recognizes the signal again, it continues. If the perimeter signal is too weak in the middle of the lawn, a GPS area can be configured. If the robot is in this area, it is assumed to be within the perimeter loop.

The firmware supports a head charging station and a through charging station. Using the charging station can be switched off in the software. Then the robot stops at the perimeter when the battery voltage drops below 23.7V. For charging, the robot can then be switched off, connected to the charging cable and switched on again. The robot then goes into charging mode. If the voltage drops below 21.7V, the undervoltage trip will trip if it is not bypassed.

With the original motors and wheels, the robot drives at a speed of approx. 1200m / h. In order to get a reasonable cut, the robot has to mow about 6-9 hours a day for a 1000m² area (my experience). Of course, it also depends on the type and shape of the lawn area. For acceleration and deceleration, the Simple Trajection Planner is used by the Linux CNC project. This allows a very smooth start and braking.

If an original Bumperduino, Bumper with switches, Hall Effect sensors, ... are used, they can be connected to the Bumper Pins as before.

The firmware was optimized for 'not with the perimeter wire fenced obstacles' on the lawn. Instead of driving at full speed against the obstacle, the speed is reduced from a certain distance and drove gently against the obstacle. Prerequisite for this are sonar sensors. This feature is optional. The robot supports a self-made Bumperduino with two MaxSonar sonar sensors and an MPX5010DP FREESCALE pressure sensor for a pressure wave hose.

https://github.com/Ardumower/Raindancer/tree/master/DipTrace/DistanceBumperSensorDistanceBumperSensor.pdf 

The evaluation is done by an Arduino Nano, which is connected to the PinUserSwitch2 / 3 of the PCB1.3. Upon detection of an obstacle with the sonar sensors, the robot slows down and bumped gently against the obstacle where the bumper or bumper duino triggers. The board is relatively simple. This allows them to be easily soldered together on a laboratory board. The MaxSonar sensors can be omitted and a separate solution can be connected to the Nano. The sensor for the pressure wave hose can be omitted and only the sonar sensor is used. Another option for an approach solution is to expand the current Raindancer software. The original Ardumower ultrasonic sensors are currently not supported.

The serial interface is used for the operation. On the mobile phone is the software Arduino Centrale is used (free with advertising or without advertising for a few euros). In Arduino Centrale, buttons can be configured with commands. The operation is via command line commands. The send line must be terminated with CR. The output is automatic shown on the console or on the mobile phone, depending on where the command was just entered. Most commands are grouped by services. The group corresponds to the services mentioned in the software. The command following the service is then separated by a dot. Spaces are skipped and have no meaning. This is useful when using the mobile phone, where a space is inserted after a period.

Example: clc.enc   

The service clc contains the command enc. This addresses the closes loop control service and tells it to show the encoder data.

Parameters are separated by a comma.

Example: pc.cm,60,60,30,30 //drives left wheel 60cm at 30% speed and right 60cm at 30% speed (//drives... does not belong to the command)

This addresses the Positioncontrol service. Drive 60cm at the speed of 30%

The command H displays the help..

Many commands shows an output on the console. To disable this output, you can enter h or the same command (which triggered the output). If an error or motor stall is shown, it can be reset with the reset command.

The software is modular. The individual modules are hardly influence each otherl. This makes it relatively easy to modify or extend something.

https://github.com/Ardumower/Raindancer/tree/master/Documentation/SoftwareStructure.pdf

The UMLET software was used to display and edit the Structure software.

There is a hardware abstraction layer. All communication with the hardware is done through objects in hardware.h. Most objects in hardware.h are defined in InOutInterface.h. In hardware.cpp the initialization and pin assignment of the hardware takes place. Services collect data or control the motors and make their service available to the controllogic. A behavior tree is used for the controllogic. The behavior tree accesses the services via the blackboard. Nodes of the Behavior Tree exchange information about the Blackboard.

SPLAN was used for the graphic creation of the BHT.

https://www.electronic-software-shop.com/elektronik-software/splan-70.html?language=de

To view the files of the BHT the following free software can be used:

https://www.electronic-software-shop.com/support/kostenlose-datei-viewer/?xoid=oep38ca4ehqn37a7dn3rnrpie6

The files of the BHT are here:

https://github.com/Ardumower/Raindancer/tree/master/Documentation

The robot knows two modes: Manual and Auto. In manual mode, all services are running, but the Behavior Tree (BHT) is off. In auto mode, the BHT is activated.

Which modes will start when:

MANUAL  Robot is switched on and is not in the charging station
AUTO    The robot is switched on in the charging station and detects a voltage at the charging contacts. Behavior charging is activated. The robot is loading

If the robot is in MANUAL mode, it can be switched to automode using command A. If the robot then recognizes the perimeter signal, it starts mowing.

For minimum commissioning, the following requirements should be met

Warning.pngSafety note: For safety reasons, the mower blades must not be mounted during the first tests!

Warning.pngImportant: For the first gearmotor tests, the robot should be jacked up so that the wheels are not in contact with the ground!


  • PCB1.3 with Arduino DUE
  • Original Ardumower drive motors with encoder
  • Original Ardumower mowing motor
  • Two Ardumower perimeter coils front left / right. Mounted on original Ardumower chassis if necessary: ​​Left / center (depends on which line tracking algorithm one uses)
  • BT module
  • The bridge for the encoders on the PCB1.3 is bridged to the 2-divider.
  • 24V power supply

Optional can be used

  • RTC with EEPROM
  • Ardumower Bumper Pins with switches, Hall effect sensors, original Bumper Duino, ...
  • Pass through charging station
  • Self-built Bumperduino with 2MaxSonar sensors on PinUserSwitch2 / 3

config.h

The file config.h contains the basic configuration of the firmware.

'Before commissioning the parameters must be adjusted.'

Select the chassis form. Only one parameter may be set to true.

#define ARDUMOWER_CHASSIS  true
#define PARANELLO_CHASSIS  false
#define RAINDANCER_CHASSIS false

In config.h go then to the code section, which belongs to your choice and change this section. For the Ardumower chassis the section starts with following:

//======================================================================================================================
// CONFIG FOR ARDUMOWER CHASSIS
//======================================================================================================================

Console Speed:

#define CONF_PC_SERIAL_SPEED			115200 // Speed serial consol

If the Bluetooh module has already been configured with the Azurit firmware, the line

#define CONF_BT_SERIAL_SPEED			115200 

has to be changed to:

#define CONF_BT_SERIAL_SPEED			19200


Setting the wheel circumference and wheel distance. The original Ardumower wheel has a circumference of 78.54f cm

#define CONF_RADUMFANG_CM			80.738f // Wheel circumfence in cm original ardumower: 78.54f 
#define CONF_DISTANCE_BETWEEN_WHEELS_CM		36.0f	// Distance where the wheels hits the ground do not measure on top of the wheels!!!


For the first startup most services should be disabled to prevent error messages:

#define CONF_ENABLEWATCHDOG             	false   // Set to false to disable Watchdog. true to enable.
#define CONF_DISABLE_RANGE_SERVICE		true    // Disables my own range sensor running on bumper duino on pinUserSwitch3 => diNearObsacleSensor
#define CONF_DISABLE_BUMPER_SERVICE		true   // Disables original bumper sensor pins (PCB1.3) on pinBumperLeft => diBumperL and  pinBumperRight => diBumperR
#define CONF_DISABLE_BUMPERDUINO_SERVICE	true   // Disables my own bumper duino sensor on pinUserSwitch2 => diBumperSensor
#define CONF_DISABLE_PERIMETER_SERVICE	        false   // Disables perimeter sensor
#define CONF_DISABLE_RTC_SERVICE		true    // Disables rtc sensor
#define CONF_DISABLE_EEPROM_SERVICE		true    // Disables EEPROM requests
#define CONF_DISABLE_BATTERY_SERVICE	        true    // Disables battery sensor
#define CONF_DISABLE_CHARGE_SERVICE		true    // Disables charge system service
#define CONF_DISABLE_RAIN_SERVICE              true    // Disables rain sensor
#define CONF_DISABLE_DHT_SERVICE               true    // Disables temp sensor
#define CONF_DISABLE_GPS                       true    // Disables GPS service
#define CONF_DISABLE_MOTOR_STALL_CHECK         true    // Disables the motor stall/encoder check in closed loop control
#define CONF_DISABLE_MOW_MOTOR                 false   // Disables the mow motor
#define CONF_DISABLE_CHARGINGSTATION    	true


'ONLY for the original Ardumower chassis design' the following constants should be set to optimize the rotation at the perimeter

#define CONF_PER_CORRECTION_ANGLE       30
#define CONF_PERIMETER_DRIVE_BACK_CM    40.0f  


Since compiling is done more often, it makes sense to jack up the robot so that the drive wheels and the mower motor can rotate freely.

After the first compile, upload and start of the firmware, the last line should be:

Press H for help.


Enter H here. Thereafter, all available commands are displayed. It is a good ideas to copy and save the commands to a file, so that you can look at it when you need.

If after compilation following warning occure, they can be ignored:

pinman.cpp: 18:0: warning: "PWM_FREQUENCY" redefined [enabled by default]
  #define PWM_FREQUENCY 3900
pinman.cpp: 19:0: warning: "TC_FREQUENCY" redefined [enabled by default]
  #define TC_FREQUENCY 3900

QUICK START TO MOW

The aim of this chapter is to become more familiar with the operation, and to configure the robot to the extent that the perimeter sensors work and you can mow within the perimeter.

The robot is connected via the console cable. Speed: 115200

Errorhandling

If the firmware detects an error, this goes into the Errormode. The Mower stops and the mow motor is switched off. The services continue to run. The first error occurred is latched. The error is then sent to the console or bluetooth (BT) every 2 seconds, depending on what was last active or activated by sending a character. If you has started the mower via Bluetooth, the error is then shown on BT.

To disable the error, the following commands must be entered one after the other:

reset     //reset error and motor faults
M         //activate manual mode

The error command can be used to display the error log. The error log shows the history of the traversed running nodes of the BHT as well as various other events. It is 5000 characters tall.

error     //show errormessage

The show.hist command displays the last direction of rotation and other parameters.

show.hist   //show history

The last entered values will be displayed first, so that they are above!


After disabling the error, the Mower can be started again with:

A

However, both coils must be in the perimeter for that.

To get warm: Configuration of the battery service

The battery service determines the voltage of the battery and makes it available to the BHT.

Activate the battery service in config.h and then re-install the software.

#define CONF_DISABLE_BATTERY_SERVICE	false

Enter the command:   bat.show It should display the correct battery voltage.

If this deviates by more than 0.2V, then this can be adjusted with the constants   #define BATTERYFACTOR_BS 11.0f // Equivalent to (100 + 10) / 10 Voltagedivider   #define DIODEDROPVOLTAGE_BS 0.4f These constants are defined in batterySensor.h.

The voltage in batterySensor.h is calculated as follows

sensorValue = aiBATVOLT.getVoltage(); 
float readVolt = sensorValue * BATTERYFACTOR_BS + DIODEDROPVOLTAGE_BS; // The diode sucks 0.4V

Commissioning of the motors

The first thing to check is whether the motors are turning and whether they are turning in the right direction. For this purpose, the motors are controlled directly with a PWM specification. This means, there is no control of the speed based on the encoder. The speed control loop is open (open loop);

The command clc.mt, 1,150 causes the clc service to send the input PWM of 150 directly to the motor. Maximum for the PWM is 255. A 1 controls the left engine, a 2 the right.

Enter the command:

clc.mt,1,150 

This activates the motor (1) on the left directly with a PWM of 150. The wheel is then Stopped with:

clc.mt,0,0

The wheel on the left should turn forward. If it turns backwards, the cable at the plug must be reversed. Should the wheel not turn, it can still be tried with a higher PWM of e.g. 200. The wheel should definitely turn even at a PWM of 50 (better less).

The same for the right wheel (2):

clc.mt,2,150 

The wheel is then Stopped with:

clc.mt,0,0


Anmerkung: Die PWM für die Motoren läuft mit 3900Hz. Wenn man die Originalwerte verwenden möchte, muss man nachfolgende Zeilen in pinman.cpp abändern.

#define PWM_FREQUENCY 3900
#define TC_FREQUENCY 3900

Achtung: Wenn die PWM zu hoch gesetzt wird, z.B. 18000Hz, dann drehen sich die Räder bei niedriger PWM von z.B. 60 nicht mehr. Es kommt dann ein Fehler, dass bei Vorgegebener PWM von 60 die Geschwindigkeit 0 ist.

Commissioning the encoder

It it checked if the encoders work and if they count in the right direction.

The encoder routine has two counters per wheel. Once an absolute counter (absEnc), which always counts positive no matter in which direction the wheel turns. And a positive / negative counter (enc), which counts up when driving forward and counts down when reversing.

Enter the command

clc.mt, 1,150

to make the left wheel turn.

Enter then

clc.enc

This will display the encoder values ​​from the left and right wheels.

The output is terminated with the command: h.

Both displayed counters of the left wheel (1) must now count up.

Example:

Engine 1 = left - should not count if only the right engine is running.
Engine 2 = right - should not count if only the left engine is running.
! 03, motor 1 enc: 972 absEnc: 972 rpm: 2.596326 m / h: 125.773315 deltaTicks: 2 deltaTime: 32986us
! 03, motor 2 enc: 974 absEnc: 974 rpm: 3.325853 m / h: 161.113647 deltaTicks: 2 deltaTime: 33445us
! 03, motor 1 enc: 974 absEnc: 974 rpm: 2.923552 m / h: 141.625061 deltaTicks: 2 deltaTime: 33156us
! 03, motor 2 enc: 975 absEnc: 975 rpm: 2.678638 m / h: 129.760696 deltaTicks: 1 deltaTime: 33144us
! 03, motor 1 enc: 976 absEnc: 976 rpm: 3.132316 m / h: 151.738159 deltaTicks: 2 deltaTime: 32857us
! 03, motor 2 enc: 976 absEnc: 976 rpm: 2.296233 m / h: 111.235962 deltaTicks: 1 deltaTime: 32859us
! 03, motor 1 enc: 978 absEnc: 978 rpm: 3.251686 m / h: 157.520752 deltaTicks: 2 deltaTime: 32998us

The example shows that the encoders are counting up. 'Example motor 1' : enc: 972 then enc: 974, then enc: 976 ... 'Example motor 2' : enc: 972 then enc: 975, then enc: 976 ...

If the enc value counts negative when driving forward you can configure it in the config.h:

#define CONF_LEFT_ENCODER_INVERSE false
#define CONF_RIGHT_ENCODER_INVERSE false

To do this, set CONF_LEFT_ENCODER_INVERSE to true for the left wheel. Set CONF_RIGHT_ENCODER_INVERSE to true for the right wheel.

Do the same for the right wheel:

clc.mt, 2,150

Command is stopped with clc.mt, 0,0.

After the lines in the config.h have been set correctly, recompile, play and retest!

Check of the closed loop control service

The closed loop control (clc) service controls the speed of a wheel and thus also the straightforward movement of the robot. There is one service for each wheel so there are two services in total. The service internally calculates the speed of the wheel with the aid of the encoder values and then sets the necessary PWM to reach the specified speed (closed loop). The speed is given in%. 100% refering to the constant CONF_MAX_WHEEL_RPM in the config.h.

With the command clc.v,30 both services are commanded to turn the wheel at a speed (v) of 30%. Thus, both wheels should turn forward.

Enter:

clc.v, 30 Moving forward with speed 30%

then

clc.v, s stop engine

then

clc.v, -30 drives reverse with speed 30%

If everything is working, then continue. Otherwise check encoders and drivedirection again.

mot.cur  Shows the motor current.

Check the position control services

The Position Control Service (pc) is used to drive the wheel a certain way or to turn the wheel a certain angle. There is one service per wheel. With the command pc.a,360,80 both wheels are comanded to: Turn the wheels an angle of 360 degrees with a maximum speed of 80%.

Make a mark on a wheel to see how far it turns.  

pc.a, 360,80  Rotates both wheels forward by 360 degrees with 80% speed if everything is configured correctly.
pc.a, -360,80 Rotates both wheels backwards by 360 degrees with 80% speed if everything is configured correctly.

The Position Control can be stoped with the command

pc.s


If the wheel does not turn 360 degrees, the value CONF_ENCTICKSPERREVOLUTION in config.h appears to be wrong. For the original engines from the Ardumower shop, the value of 1060 is given. In addition, the constant CONF_RADUMFANG_CM is important for the calculation to be correct to drive a particular path in cm.

Since the engine monitoring was switched off in the beginning in the config.h, it is now time to switch on again. Motor monitoring checks whether the encoders deliver values ​​when the motors are turning, whether they are turning in the right direction, or whether the motor is actually turning when a PWM is applied.

To enable motor monitoring in config.h, set the value CONF_DISABLE_MOTOR_STALL_CHECK to false.

#define CONF_DISABLE_MOTOR_STALL_CHECK false

Recompile and upload. Then try again. No errors should be displayed.


If everything works, the robot can be put on the wheels.

Further tests can still be performed (note that the USB cable should be long enough, preferably use an extension);

Drive a certain way in cm

pc.cm,60,60,30,30   drives 60cm forward with the speed of 30%
pc.cm,-60,-60,30,30 drives 60cm backwards with the speed of 30%


Turning a certain angle. Prerequisite: CONF_ENCTICKSPERREVOLUTION, CONF_RADUMFANG_CM and CONF_DISTANCE_BETWEEN_WHEELS_CM are configured correctly.

turnto, 360,30  Turn the robot 360 degrees CW (clockwise)
turnto, -360.30 Turn the robot 360 degrees CC (counter clockwise)

If the robot does not turn 360 degrees, the constant CONF_DISTANCE_BETWEEN_WHEELS_CM in config.h is probably wrong.

Mowmotor commissioning

The mowing motor does not use an encoder. It is operated with a PWM of 255. The PWM of 255 is not immediately given to the engine. It ramps up the PWM from 0 to 255. The same applies to the braking of the engine. It may happen that a motor fault is displayed when the engine is decelerating. This is because the inertia of the mowmotor disc tends to continue to rotate the motor, thus retroactively injecting a current into the motor driver that exceeds the limits such that the tri-state outputs of the driver go to high-impedance. If this happens, the error can be reset with the reset command.

Befehl eingeben:

z          //mow motor start

danach

t          //mow motor stop

It may be that when stopping the motor a fault comes up. Reset this with the command reset.

mot.curm   //indicates the mowing motor current.


If the PCB1.3 is used, the mower motor current is probably displayed incorrectly here. See: Adjusting the mower motor current in Tune Up This can be done later and is not so important for the first mowing operation.

Perimeter Commissioning

The Raindancer firmware works with two coils. This determines the angle at which the robot meets the perimeter. Accordingly, it is decided whether CC or CW is rotated. The perimeter signal must be received all the time while mowing. If the signal is not received for 2 seconds, the robot will stop and continue as soon as the signal is received again. The time that a non-receive is tolerated is set with the parameter CONF_PER_SIGNAL_LOST_TIME in the config.h. With this it is possib to bridge "Receiving holes" in the middle of the lawn. Disadvantage is, if the transmitter fails exactly when the robot is at the perimeter, it may be that the robot travels this set time outside the perimeter loop.

Prerequisite for commissioning: The spools of the robot must be within the perimeter loop for commissioning. The Raindancer transmitter firmware must be installed on the transmitter.

First check is if the signal is detected.

You can see the calculated value of the individual coils as follows:

per.resultl for left coil 

and

per.resultr for right coil.

The example below shows that the BAD has not received a valid signal. It is important here that no BAD is displayed. The received amplitude is behind mag :. The signal quality can be seen on the Peak Signal Noise Ratio psnr.

Beispiel per.resultl
mag:  453  peak @ 432 :  453   peak2 @ 328 :  142   MSE: 1704.569   psnr:  120.388   psnr2:   11.829   ratio:   10.177
mag:  431  peak @ 279 :  431   peak2 @ 145 : -125   MSE: 1638.841   psnr:  113.349   psnr2:    9.534   ratio:   11.889
mag:  372  peak @ 128 :  372   peak2 @  12 :  119   MSE: 1521.076   psnr:   90.978   psnr2:    9.310   ratio:    9.772
mag:  458  peak @ 486 :  458   peak2 @ 352 : -195   MSE: 1922.495   psnr:  109.110   psnr2:   19.779   ratio:    5.516
mag:  428  peak @ 335 :  428   peak2 @ 233 :  118   MSE: 1818.376   psnr:  100.740   psnr2:    7.657   ratio:   13.156

Beispiel per.resultr

mag:    6  peak @ 144 :    6   peak2 @  24 :   -5   MSE:    3.161   psnr:   11.388   psnr2:    7.908   ratio:    1.440    BAD
mag:   -5  peak @ 161 :   -5   peak2 @  46 :    4   MSE:    2.380   psnr:   10.504   psnr2:    6.723   ratio:    1.562    BAD
mag:   -5  peak @  60 :   -5   peak2 @ 179 :    5   MSE:    3.556   psnr:    7.030   psnr2:    7.030   ratio:    1.000    BAD
mag:    5  peak @ 159 :    5   peak2 @   3 :    4   MSE:    2.949   psnr:    8.477   psnr2:    5.425   ratio:    1.563    BAD
mag:    5  peak @  11 :    5   peak2 @ 153 :    5   MSE:    3.286   psnr:    7.607   psnr2:    7.607   ratio:    1.000    BAD

End the output with h.

Both coils should detect the signal, so do not indicate a BAD. Also not sporadicly!


Next, the polarity of the signal must be configured. Enter:

per.show. (switch off output with h)

If the coil is inside the perimeter, the amplitude of the coil must be positive.

The detected perimeter amplitudes are now shown. ML indicates the amplitude of the left coil, MR the amplitude of the right coil.

!03, ML: -305  MR: 331 magMax:332 magMedL%: 0 magMedR%: 102
!03, ML: -330  MR: 338 magMax:332 magMedL%: 0 magMedR%: 102
!03, ML: -327  MR: 330 magMax:332 magMedL%: 0 magMedR%: 102
!03, ML: -336  MR: 332 magMax:332 magMedL%: 0 magMedR%: 102
!03, ML: -304  MR: 328 magMax:332 magMedL%: 0 magMedR%: 102
!03, ML: -326  MR: 324 magMax:332 magMedL%: 0 magMedR%: 102

However, one can see here that the magnetude on the left coil is negative. Inside the perimeter loop, this must be positive.

This can be set in the config.h:

#define CONF_LEFT_COIL_INVERSE		true
#define CONF_RIGHT_COIL_INVERSE        false

After new compiling, the values should be positive.


Attention, with per.resultl and per.resultr, the sign of the amplitude is displayed as actually received, regardless of the settings in CONF_LEFT_COIL_INVERSE and CONF_RIGHT_COIL_INVERSE. It may be that per.resultl provides a positive amplitude and per.resultr a negative amplitude inside the perimeter. That's OK, since it depends on the connection of the coils. Conversion with CONF_LEFT_COIL_INVERSE / CONF_RIGHT_COIL_INVERSE takes place later in the software. It is important to configure CONF_LEFT_COIL_INVERSE and CONF_RIGHT_COIL_INVERSE so that per.show displays positive amplitudes within the perimeter.

Configure Bluetooth

If the module has already been configured with the original Ardumower software, can CONF_BT_SERIAL_SPEED=19200 be set.

#define CONF_BT_SERIAL_SPEED 19200

(The perimeter outputs are extremely large.) It may be that the software faltered at this transfer rate when viewing perimeter data over BT at that baud rate.) This would be the configuration then done.


Since there are sometimes problems with the configuration of BT modules, I suggest to reprogram a working BT module only if you have another working BT module in reserve.


For the configuration of the BT the original Ardumower routine is used. However, the baud rate is set to 115200. Therefore, you can use the tips used for troubleshooting in the forum.


Lets start: De-energize the PCB (also disconnect USB from the DUE). Press and hold button on BT module. Turn on the board. The BT module should now flash every 2 seconds.

Release the button. Reconnect the USB to the DUE. The BT module should still be flashing every 2 seconds.

Now try bt.show first, to see if the BT module is found:

bt.show 

If found successfully put in the command:

bt.set 

The BT module will now be configured.

Configure Arduino Centrale

The software runs on an Android mobile phone or tablet. Arduino Centrale can be downloaded from the Play Store. Another software that works is Serial Bluetooth Terminal.

In Arduino Centrale, the top right menu (three points) can be opened. Call Settings there.

Then open the button layout Configuration. Here you can set which buttons are displayed. Only the following should be selected:

Show Control Button
Show Standard Button set 1
Show Standard Button set 2
Show Standard Button set 3

Go back and open Serial Terminal Settings Set Terminal View Character Limit to 10000

Go back and select Line Ending for Commands

Select CR

Go back and select Line Ending for Incoming Data

Select NL

Then first go out completely from the menu.

First, the BT module must now be paired to work with the mobile phone. That means on the phone enable BT. Then go to the BT menu on the phone and look for new devices. There should then appear a new device. Select this device and pair. There is a password query which is 1234 or 0000 Thereafter, the module is included in the device list

Now in the menu of Arduino Centrale go to connect to device and click the BT of the mower. If everything was successful, BT connect should be displayed at the top right.

At the command line, type H and Send. Then the help should be displayed.n.

In Arduino Centrale commands can be stored under the menu item Standard Button Setup. Currently I have deposited the following commands with me:

Button 1 Text: Manual 	Command: M
Button 2 Text: Auto   	Command: A
Button 3 Text: Hide   	Command: h
Button 4 Text: area,19 	Command: area,19
Button 5 Text: gohome 	Command: gohome
Button 6 Text: per 	Command: per.show
Button 7 Text: mowense 	Command: mot.curm
Button 8 Text: bat 	Command: bat.show
Button 9 Text: charge 	Command: charge.show

These commands can be customized as needed.

First test drive

For safety reasons, switch off the mowmotor in config.h for the first test.

#define CONF_DISABLE_MOW_MOTOR          	true

Then recompile and upload software.

Attention, there are still no bumpers active! That the area inside the perimeter must be free.

Disconnect the USB cable and connect to Arduino Centrale.


Put the robot inside the perimeter loop. Check the perimeter signal again with per.show. Disable perimeter output with h or per.show

A enter for auto mode to start the mowing.

It may take 5 seconds for something to happen. The robot first drives up the mowmotor. Since this one is turned off, it may look like it does not happen.

M enter for manual mode to stop the robot.

TUNE UP

Configure the bumpers on the bumper connectors

The original Ardumower chassis does not provide a standard solution for bumpers. Since most users create their own solutions here, the firmware has some options to configure the bumper service for their own needs.

To enable the bumper, the following line must be configured in config.h:

#define CONF_DISABLE_BUMPER_SERVICE    false

To test bumpers, you can use the bumper.show command. The bumper service then plays its activity on the console or mobile phone, depending on where that command was sent from.

bumper.show 


The bumper pins are configured by default as inputs with pullup resistor. This means, the input is high by default as long as the pin is not connected to GND by a switch for example.

The bumper service can be configured with following parameters in config.h:


Using the left or/and right bumper

#define CONF_USE_LEFT_BUMPER            true     // left bumper is used
#define CONF_USE_RIGHT_BUMPER           true     // right bumper is used


Determine if the bumper is active if the pin is connected to GND:

#define CONF_LEFT_BUMPER_LOW_ACTIVE     true     // left bumper is activated when pin is low
#define CONF_RIGHT_BUMPER_LOW_ACTIVE    true     // right bumper is activated when pin is low


If one uses a left and a right bumper, there is still the possibility to configure that the direction of rotation is determined by the activated bumper after driving back. That means, that when the left bumper is pressed, the robot then turns right after driving back.

#define CONF_ESCAPEDIR_DEPENDING_ON_BUMPER false  // if set to true, the robot rotates in the opposite direction of the activated bumper. If false, the escape direction is random.
                                                  // only set to true if you use a bumper for left and a bumper for right.


The bumper pins are configured by default as inputs with pullup resistor in hardware.cpp:

DigitalIn diBumperL(pinBumperLeft, true);
DigitalIn diBumperR(pinBumperRight, true);

This means the input is high by default if the pin is not pulled to GND.


If you want to switch off the pull-up resistors, the lines must be changed as follows

DigitalIn diBumperL(pinBumperLeft, false);
DigitalIn diBumperR(pinBumperRight, false);

Charge Service

The charge ervice provides the BHT with the charge voltage and the charge current. It contains functions for switching the charger relay on / off.


Annotation:

If the Mower is switched off (battery not connected) and then a charging voltage is connected to P42 Charger,
the board is directly supplied with voltage via D73. The problem is that the capacitors on the board have no voltage and supply a short circuit when connected. Then a 1.6A fuse will break through in EF1.
Therefore, EF1 should be 5A.
I've removed the D73 from my board, because I think it's only reasonable if the battery is so empty that the board and Relay no longer works with the battery. If this really 
happens, I will charge the battery directly with the charger. This should be happen only in case of an error and should not be the rule (but I would not persuade anyone to do this too).
Furthermore, the D73 has a different potential on the back, as the diodes are soldered behind this. Since it makes sense to separate them with hot glue, not that they come together.

The following describes how to load the robot.

Independent driving in the charging station

When the robot moves into the charging station, the charging relay is switched off. At this time, only the voltage of the charging station is at the contacts. If the robot has detected this, it stops, waits two seconds and checks the charging voltage again. If this is OK, it moves 3cm forward, 3cm backwards and again 2cm forward. This serves to optimize the connection to the charging contacts (which are currently designed as sliding contacts). Then the relay is switched on and the charging voltage checked again. (This behavior can easily be reprogrammed in the BHT.) The relay remains energized and thus the battery is connected to the charger until the robot is commanded to go to an area or the robot is switched to manual mode or switched to auto mode.

Use without charging station

To load the robot it should be in manual mode (enter command M). Then you can use charge.relay,1 to switch on the relay and with charge.relay,0 to switch off the relay. The relay automatically turns off when the Auto mode is activated. The relay only switches on if the charging voltage is applied to the charging contacts!. Another possibility is to connect the charging contacts when switched off and then turn on the robot. The robot then goes into auto mode and turns on the Behavior Charging Station. He now thinks he is in the charging station.

Put in the charging station

Here, put the robot in the switched off state in the charging station, so that the charging contacts have contact. Then turn it on. The robot then enters the charging mode in the Behavior Charging Station. He now thinks he is in the charging station, turns on the relay and charges.


To enable the charging service, set the config.h CONF_DISABLE_CHARGE_SERVICE to false and re-install the software.

#define CONF_DISABLE_CHARGE_SERVICE	false

Manual testing:

Enter the command:

charge.show 

This continuously displays the voltages and currents. Currently everything should be displayed with 0.

Connect charger to P42 or charging contacts.

Now you should see the Charge Voltage (CV)..

Enable relay:

charge.relay,1

Now a current flows from the charger to the battery and a charge current is displayed (CC).

Disable relay:

charge.relay,0 


Testing in the off state via the console:

Turn on the robot and connect USB. Wait until software has started up. Connect charging contacts. Open the serial console. The DUE restarts. The relay should be energized and the console output at boot should show "Charging station detected". The robot has now switched to the Chargingbehaviour.

Enter M to return to manual mode and switch off the relay.

Watchdog

The watchdog is solely for safety. If the software hangs, the watchdog should prevent the robot from running unchecked. The watchdog is hardware implemented in the DUE. It is activated in the config.h with:

#define CONF_ENABLEWATCHDOG  true


Each time the loop is traversed, the watchdog will be reseted with the function call watchdogReset ();. If watchdogReset (); is not called within 3 seconds (because the software hangs somewhere), the DUE is restarted, stopped the engines and the software goes into manual mode.

Annotation: Since the variables of the firmware are reinitialized during the reboot, it is difficult to find out what the cause of the error is. The Mower simply stops, and one wonders when opening the BT connection, that everything is fine and no error is issued - except that the software is in manual mode.

Undervoltage Shutdown

The undervoltage shutdown is used to prevent the battery from falling below a certain voltage and then deeply discharged. The implementation of the undervoltage shutdown is implemented in the battery service. Prerequisite is, that the jumper 8 UV shutdown on PCB 1.3 is set to Auto. If you then put voltage on the board, this gets no electricity first. Therefore, when switching on the voltage, the UV shutdown must be bridged with the P20 button. Then the PCB1.3 gets voltage. This button should be held for 4 seconds. Then the software takes control of the UV shutdown. The P20 button must then be open again, otherwise the software can not switch off the voltage.


In config.h the threshold is set at which the voltage is switched off

#define CONF_VOLTAGE_SWITCHOFF_BS  21.7f   

If the battery voltage falls below this voltage for one minute, the voltage to PCB1.3 and the motors will be cut off. The entire PCB1.3 is then dark.

If you want to bridge the undervoltage cut-off, you can set jumper 8 to permanent-on or bypass P20. I have an on / off switch connected to the P20, so that I can bridge this for testing purposes. The jumper 8 is still on auto.

I2C Bus

The I2C bus can be scanned with the command i2c.scan. All found addresses will be displayed.

i2c.scan

The addresses of the RTC module and the EEPROM can be adjusted in the hardware.cpp. Currently the following default addresses are configured:

byte DS1307_ADDRESS = B1101000;
byte AT24CX_ADDRESS = B1010000;

RTC

The RTC module is currently not used. It is intended to use this later for a time mowing start. However, the RTC module can already be programmed and tested.

The RTC module is activated with the following line in the config.h:

define CONF_DISABLE_EEPROM_SERVICE  false

The following commands are available:

rtc.show          //show rtc values every rtc read (10sec)
rtc.config        //show rtc service config
rtc.find          //tries to find RTC and show result
rtc.set,8,17,3,25,01,2017 //set rtc time=8:17 dayOfWeek=3 date=25.01.2017

EEPROM

The EEPROM is used on the RTC. Currently it is used to store statistics. The following statistics are stored: total mowing time, total distance traveled, total number of rotations, number of loading operations.

The use of the EEPROM is switched on with the following line in the config.h:

#define CONF_DISABLE_EEPROM_SERVICE false

The following commands are available for the EEPROM:

eep.config           //show EEPROM service config
eep.u8t,10           //show uint8_t at address 10
eep.s32t,10          //show int32_t at address 10
eep.f,10             //show float at address 10
eep.set.u8t,10,7     //write value uint8_t=7 to address=10 
eep.set.s32t,10,1234 //write value int32_t=1234 to address=10 
eep.set.f,10,7.3     //write value float=7.3 to address=10 
eep.erase            //erase the eeprom

To test the EEPROM e.g. enter the following command:

eep.set.f,10,7.3

This writes the float value 7.3 to the addresses 10, 11, 12, 13 in the EEPROM.

With the command

eep.f,10

the value can then be read out again.

The command eep.erase deletes the first 3 pages of the EEPROM. The other pages are currently not deleted because they are not used.

eep.erase

It makes sense to erase the EEPROM after the enable the service so that the memory cells are initialized.

Slow down the speed at the perimeter

The Mower drives at a speed of 1200m / s. In order to make the deceleration a bit gentler when driving over the perimeter, the robot reduces the speed just before the perimeter (about 20 cm).

The following constants in the config.h affect recognition near the perimeter:

#define CONF_NEAR_PER_UPPER_THRESHOLD   80.0L    // Threshold of one coil where Perimetersignal is detected as near perimeter
#define CONF_NEAR_PER_LOWER_THRESHOLD   70.0L    // Threshold of the other coil where Perimetersignal is detected as near perimeter

To determine if the robot is close to the perimeter, the amplitude of the left and right coils are evaluated. For this purpose, the firmware determines the current maximum amplitude over the entire travel time of the Mower. Now, when the left coil reaches an amplitude of 80% (CONF_NEAR_PER_UPPER_THRESHOLD) or higher of the maximum value and the right coil reaches above 70% (CONF_NEAR_PER_LOWER_THRESHOLD) or higher of the maximum value, it is assumed that the robot is close to the perimeter. The same applies if the right coil reaches 80% and the left 70%.

These values depend on the kind of coil used and on the signal strength of the transmitter and therefore may need to be readjusted.

To adjust this, enter the command per.show while the Mower is driving.

per.show 

If the mower then runs over the perimeter wire enter the same command or press h. Then scroll back in the display and look at the values.

Example: !03, ML: 305 MR: 331 magMax:332 magMedL%: 73 magMedR%: 87

The values magMedL%: 73 magMedR%: 87 indicate here the measured percentage of the coils 20cm before the perimeter wire. Use this percentage as starting point to set CONF_NEAR_PER_UPPER_THRESHOLD and CONF_NEAR_PER_LOWER_THRESHOLD. Several tests should be carried out for the determination. Better to slow down a little earlier than to slow down too late. The difference between UPPER and LOWER has been introduced because the coils do not have always the same value, e.g. when the Mower is running obliquely or almost parallel to the perimeter.

It may be that magMedL% and magMedR% show more than 100%. This is based on the type of magMax determination and is OK.

The calculation is stored in the function 'bool TPerimeterThread :: isNearPerimeter ()' in the file perimeter.cpp.

Set mower motor current

It should be noted that the outputs of the mowing motor driver on PCB1.3 have been interconnected.

With a PWM of 255 at the mower motor almost no current is measured on my board. I have then remeasured the value with a multimeter. I measure at M2 FB at full speed and free-wheel only 0.04V. Correct value would be about 0.22V because the engine pulls here 0.41A. On M1 M1 I measure a voltage of 0.007V. It seems that the current measurement is no longer correct due to the parallel connection. One might think that this should be halved. But it is not like that.


An interconnection of the two MC33926 is not recommended by the manufacturer and seems to provide an incorrect current measurement.

https://www.nxp.com/docs/en/application-note/AN4833.pdf

Quote:"If two independent H-bridges are used (separate MC33926 or similar), the load sharing may not be quite as even,

resulting in a reduction in maximum drive capability. This configuration will latch any fault until the EN pin is toggled."


I have then disconnected from the Mowmotor driver pins M1 OUT1 and M1 OUT2 (bent and guided next to the socket connector, so that they have no contact). Now the current measurement works properly, but under 1A this is not really accurate. Only from 1A the value is reliable.

Forum Posts: https://www.ardumower.de/index.php/de/forum/ardumower-1-3-mainboard/1461-pcb1-3-motorstrom-wird-vermutlich-falsch-gemessen#13904


If M1 OUT1 and M1 OUT2 are not disconnected, the measured and displayed current too low. Therefore, the scale value for the correct current measurement must be adjusted in the setup function of the class TMowMotorSensor in the file mowmotorSensor.h. The scale factor should be set at currents around 1A or more. Therefore he mower disc must be loaded with resitance when measuring the current with the multimeter.

If M1 OUT1 and M1 OUT2 are disconnected, the factor whih is set by default and find out by measuring is probably reasonably correct. However, this can only be checked by measuring current levels of 1A.

The measured current and wattage are displayed with the command:

mot.curm

Slow down when mower engine is loaded

When the mower motor is loaded, the mower slows down.

From which wattage of the mower motor the mower is slowed down, can be configured in the config.h with the parameter

#define CONF_MOW_MOT_UNDER_LOAD 30.0f 

If the mower needs more than 30W, the speed will slow down.

The current watts number when mowing can be displayed with the command:

mot.curm 

Thereafter, the value can be set at its discretion.

Attention, the motor drivers deliver an accurate current measurement only from 1A on (according to data sheet 0.5A). That Values where the current is displayed under 1A are inaccurate and should not be used. The accuracy is according to data sheet at a current of over 0.5A + -20%.

The speed setting code is in the class class TCruisePerimeterNear: public Node in the bCruise.h file.

Furthermore, it must be taken into account that the outputs of the mower motor driver have been interconnected. This is not recommended by the manufacturer and provides incorrect current measurement.

Perimeter Tracking

Here, the perimeter tracking algorithm is explained, with the aim of providing enough information to be optimized by the user on its chassis. The choice fell on this algorithm, since it is independent of the perimeter amplitude. Furthermore, the algorithm is extremely stable and is to be diverted from its intention to follow the perimeter. 'Video Example'

The perimeter tracking algorithm uses a one bounce algorithm. The algorithm move off counterclockwise on the perimeter. The right outer coil bounce always against the perimeter from the outside. When it hits the perimeter, the coil is first repelled by the perimeter. Thereafter, the coil moves in an arc towards the perimeter. 'Video Example'

OneBounce.png

The algorithm is in the file: bGotoAreaX.h class: TlineFollow implemented. The following diagram shows the "if" queries in a different chronological order for a better explanation than they actually are in the program code. Therefore, do not be confused when looking at the program code.

Procedure: The right coil is always outside the perimeter. If this exceeds the perimeter inwards, an aggressive rotation is first executed clockwise with:

bb.motor.L->setSpeed((bb.cruiseSpeed + 5));
bb.motor.R->setSpeed((bb.cruiseSpeed - 20)); 

Should the coil not be outside after 1 second, the rotation becomes more aggressive:

if ((millis() - lastTransitionTime) > 1000) { // If more than 1sec inside rotate aggressive
  bb.motor.L->setSpeed((bb.cruiseSpeed + 10)); 
  bb.motor.R->setSpeed(-25); 
}

If the coil is not outside after 1.5 seconds, the mower will turn

if ((millis() - lastTransitionTime) > 1800) {
  bb.cruiseSpeed = 25;
  bb.driveDirection = DD_ROTATECW;
  bb.motor.L->setSpeed(25);
  bb.motor.R->setSpeed(-25);

}

When the coil is now turned out, the robot moves a shallow counter clockwise curve until it reaches the perimeter. For the calculation of the curve, an integral is used, which can be controlled by the factor Ki. (Note: The integral is set to 0 as soon as the coil crosses the perimeter.)

integral = integral + (Ki*error); // the value error is a constant and has the value -1 if the coil is outside the perimeter.
double Output = integral;

The move of the curve is then carried out as follows: As the integral increases, the curve becomes smaller as the integral becomes larger.

bb.motor.L->setSpeed((bb.cruiseSpeed + Output));  // note: output is negative
bb.motor.R->setSpeed((bb.cruiseSpeed));

If the perimeter is not exceeded after 1 second, the curve is driven more aggressively;

if ((millis() - lastTransitionTime) > 1000) { // If more than 2sec Outside rotate aggressive
  bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
  bb.motor.R->setSpeed((bb.cruiseSpeed +5));
}

If after 1.5 seconds the perimeter was not exceeded, the curve is driven even more aggressive:

if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
  bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
  bb.motor.R->setSpeed((bb.cruiseSpeed +10));
}

If after 2 seconds the perimeter has not been exceeded, the following is rotated:

if ((millis() - lastTransitionTime) > 1500) { // If more than 2.8sec Outside rotate more aggressive
  bb.motor.L->setSpeed((bb.cruiseSpeed + Output));
  bb.motor.R->setSpeed((bb.cruiseSpeed +10));
}
if ((millis() - lastTransitionTime) > 2000) { // If more than 3.5sec Outside rotate full
  bb.cruiseSpeed = 25;
  bb.driveDirection = DD_ROTATECC;
  bb.motor.L->setSpeed(-25);
  bb.motor.R->setSpeed(25);
}


If the left coil is outside the perimeter, immediately counter clockwise is turned:

if (bb.perimeterSensoren.isLeftOutside() == true) {
  bb.cruiseSpeed = 25;
  bb.driveDirection = DD_ROTATECC;
  bb.motor.L->setSpeed(-25);
  bb.motor.R->setSpeed(25);
  waitForRightInside = true;
}


To set the algorithm, the first thing you should try to do is drive straight. Here is the first turn out to configure and Ki for the curve to drive in.

Testing the algorithm: Place the robot on the perimeter so that the right coil is on the outside and the left coil on the inside. Start the perimeter tracking with the command.

tpt     //test perimeter tracking to dock. Mower stands on perimeter

The command

M

stops the test.

With the command

set.lfki, 1.1

the Ki value can be set during testing. If satisfactorily determined, the value must be assigned in the TlineFollow class in the constructor.

When the drive wheels are rear, the distance to the coils is greater and the coils can be located off center. The original Ardumower chassis has front drive wheels. Here, the right coil must be placed close to the center, otherwise the rotation is too asymmetrical. Due to the short distance, the bounce interval of 1 sec is probably to be shortened, so that on a straight line probably all 0.3sec must be bounced. (Currently not tested)

Fast return

On the way back to the charging station, it may happen that the Mower drives at one point onto the perimeter so that it has to drive the entire perimeter wire to the charging station. To shorten this way, there is the fast return. The user has to lay the perimeter cable so that it results in a square. This quadrilateral is then recognized by the robot during perimeter tracking. When he recognizes the square, he turns 90 degrees from the perimeter into the interior, and moves to the other side of the lawn. When he discovers the perimeter cable, he picks up the perimeter tracking again.

To enable the fast return you have to set following option in config.h.

#define CONF_DISABLE_FAST_RETURN   false

For the square, the following dimension has been found to be favorable. However, it depends on the dimensions of the Mower. The Mower should come while tracking in the turning mode. Turn at the first left curve. Then turn at the next right curve. Then drive left curve. [Video:https://youtu.be/ipdVJzQn5Tc]


The square can be laid in two ways. Once with corners and once with flattened corners. The flattened corners are there for the mower to better recognize at the corner in which direction it should turn away from the perimeter when it is almost parallel to the perimeter. As a result, the perimeter nearest coil is the first outside and it turns away from the perimeter rather than toward the perimeter. This is necessary if there is a bed behind the perimeter into which the mower could turn.

ViereckSchnelleRückkehr.JPG

ViereckSchnelleRückkehr2.JPG


The detection depends on the position of the coils and the distance between the coils and the drive wheels.

The implemetation is in the file: bPerimeterTracking.h Class: class TfindTriangle: public Node

Detection is based on the rotated angle. It was implemented with a state machine.

The procedure of the statmachine and the calculated angles can be displayed with the command:

bht.tri 

The corresponding angles and maximum distances must then be adapted in the code in class: class TfindTriangle. Below Ishow slightly thinned class to get a better overview. The lines errorHandler.setInfoNoLog (..) are the output if the command bht.tri has been activated. These were listed here to better interpret the issue.


 virtual NodeStatus onUpdate(Blackboard& bb) {
   ...

The driven angle is determined every 500ms before the case statement.

   //============================================
   // Calculate driven angle every 500ms.
   //============================================
   if (millis() - lastRunAngleCalculation >= 500) {
     lastRunAngleCalculation = millis();
     ... 
     angle = (cmL - cmR)  * 57.2957795f / CONF_DISTANCE_BETWEEN_WHEELS_CM;
     if (flagShowFindTriangleStates) {
       errorHandler.setInfoNoLog(F("Winkel: %f cmL %f cmR %f\r\n"), angle, cmL, cmR);
     }
   }

Query the States

   // Check for left curve / right curve / second left curve
   switch (state)
   {

In case 0, a left turn is searched. A negative angle means a left curve/turn. If the angle is e.g. <-25 degrees, a curve was found and it will branched into case 1.

   case 0:  // search for left curve
     if (angle < -25) { 
       if (flagShowFindTriangleStates) {
         errorHandler.setInfo(F("!03,s0 set state = 1 Left turn found angle: %f ms: %lu\r\n"), angle, millis());
       }
       bb.motor.startDistanceMeasurementTriangle();
               ...
       state = 1; // Activate triangle searching
     }
     break;

In case 1, it is constantly checked whether a certain distance has been exceeded after the left turn. In the example 55cm. If so, that is too far and it jumps back into the case 0, since it can not be that the first way is so long. If an angle> 50 has been found within the distance of 55cm, the case 2 is jumped. A positive angle means a right turn.

   case 1: // search for right turn
     distance = bb.motor.getDistanceInCMForTriangle();
     if (distance > 55) {
       state = 0;
       if (flagShowFindTriangleStates) {
         errorHandler.setInfo(F("!03,s1 set state = 0 distance %f > 55 ms: %lu\r\n"), distance, millis());
       }
     }
     else if (angle > 50) { 
       if (flagShowFindTriangleStates) {
         errorHandler.setInfo(F("!03,s1 set state = 2 angle %f distance %f < 50\r\n"), angle, distance);
       }
       bb.motor.startDistanceMeasurementTriangle();
       ...
       state = 2;
     }
     break;

In case 2, the distance traveled after the right angle is checked first again. As long as the distance of 50 cm has not been exceeded, a left turn is checked. If the angle is <-25 degrees, a curve was detected and jumped into state 3.

   case 2:  // search for second left curve
     distance = bb.motor.getDistanceInCMForTriangle();
     if (distance > 50) {
       state = 0;
       if (flagShowFindTriangleStates) {
         errorHandler.setInfo(F("!03,s2 set state = 0 distance %f > 50 ms: %lu\r\n"), distance, millis());
       }
     }
     else if (angle < -25) {
       if (flagShowFindTriangleStates) {
         errorHandler.setInfo(F("!03,s2 set state = 3 angle %f distance %f < -25\r\n"), angle, distance);
       }
       bb.motor.startDistanceMeasurementTriangle();
        ...
       state = 3;
     }
     break;

Case 3 returns BH_SUCCESS to the BHT and the mower drives to the other side of the lawn.

   case 3:
     if (flagShowFindTriangleStates) {
       errorHandler.setInfo(F("!03,s3 set state=0  Cross Lawn Activated\r\n"));
     }
     state = 0;
     return BH_SUCCESS;
     break;
      ...
   }
   return BH_RUNNING;
 }


Testing the Algorithm: Place the robot on the perimeter so that the left coil is on the outside and the right coil is inside. Start the perimeter tracking with the command.

tpt     //test perimeter tracking to dock. Mower stands on perimeter


Start the output of the quadrilateral detection with the command.

bht.tri 

(tri stands for triangle, since previously a triangle was used for detection)

Mowing zones between adjacent surfaces

Mowing zones can be set up between adjacent surfaces that have a direct connection. For this, the perimeter cable between the surfaces is laid at a distance of about 13cm. A gap of about 30cm or less is left to the opposite perimeter cable. This reduces the likelihood that the robot will move to the other area.

See image:

(In the picture above, it is not normally necessary to set up mowing zones, as the robot covers relatively well all areas of the lawn by the algorithm.)

The distance of the area delineation cable to the opposite perimeter cable (here 30cm distance) can be optimized by tests. The distance depends on the functionality of the perimeter tracking. Firstly, the position of the left coil when tracking the overlying cable, as well as the tracking of the area delineation cable itself.

Since the robot travels with the coils about 20 cm over the cable by default, it may be that it stops with the coils within the next range.

Approaching an area from the charging station is done with the command:

area,x     // where x is the path to be traveled in m.

If the specified distance x has been covered at the perimeter, the Mower starts mowing.

The distance traveled on the perimeter can be displayed or measured with the command.

show.distance


Attention: It is important to remember exactly where the mower zone cables are located in case the grass is scarred.

Laying the Perimeter Cable at Corners

The Mower determines in which direction he turns on the perimter on the basis of the coil that was pulled out first. Therefore it is important not to lay the corners at 90 degrees. For example, if the Mower, with the right spool, moves close parallel to the perimeter and then drives out at the corner, the right spool should also be the first to leave the perimeter.

The following pictures show three examples of how corners should be moved..

Temperature Sensor

The temperature sensors DHT11 / DHT21 / DHT22 / AM2301 are supported. Currently only the sensor DHT22 was tested. The temperature sensor is connected to the designated port of the PCB1.3.

In config.h the used temperature sensor must be configured:

#define DHTTYPE DHT22 

To enable the service, the following line must be configured:

#define CONF_DISABLE_DHT_SERVICE   false   // Disables temp sensor

The sensor is read out with the following command:

temp.show

In manual mode, the sensor is read out directly. Temperature, humidity and the last temperature stored in the service are displayed. In auto mode, only the temperature stored in the service is displayed. The temperature is updated when the mower drives over the perimeter wire and comes to a stop and time has passed at least 20 seconds since the last measurement.

The DHT service turns off the power of the PCB1.3 when a temperature of 50 degrees has been measured twice:

#define CONF_OVERHEATING_TEMP  50.0f   // if this temperature is measured, robot shuts down the complete power for security

Rain Sensor

When the robot mows in AUTO mode and it starts to rain, the robot returns to the charging station. The rain sensor is connected to the designated port of PCB1.3. The sensitivity of the rain sensor is set on the rain sensor with the potentiometer.

To enable the service, the following line must be configured:

#define CONF_DISABLE_RAIN_SERVICE false   // Disables rain sensor

The rain sensor is read out approx. every 1.7 seconds.

The read out can be displayed with

rain.show

Shutdown Service

When the shutdown service is activated, it shuts off the power via the undervoltage protection. If a Raspberry PI is connected to the USB port,

CONF_WAIT_FOR_PI_SHUTDOWN = true 

can be set. Then the software waits 50 seconds for shutdown. Every second, $PwrOff and a countdown are sent to the PI so that it can shut down.

With the command:   poweroff the shutdown can be activated via the user interface or from the PI.

The shutdown service is also used by the battery service and the temperature service to shut down. Thus, the PI is informed that it should shut down if the battery voltage is too low or the temperature too high.

GPS Service

The GPS service receives the data from the GPS module.

There are two ways to process this data. Both options can be used in parallel.

a) The received GPS data will be forwarded to the Raindancer Controlcenter.
b) The received GPS data are evaluated in the Raindancer firmware. You can then define an area on the lawn.
   If the mower is in this area, it is assumed that the mower is inside the perimeter wire. So it is possible to bridge a weak perimeter signal on larger areas.

The GPS module is connected to the dedicated connector on PCB1.3. The GPS module periodically sends data to PCB1.3. If no data is received, please read the following article. It may be that RX3 and TX3 on the PCB1.3 were wired incorrectly. https://www.ardumower.de/index.php/de/forum/navigation-gps-odmetrie/1737-wait-for-gps-position-data

Send to the Raindancer Controlcenter

To enable the GPS service, the following must be configured::

#define CONF_DISABLE_GPS false

For the first commissioning you can set the following parameters:

#define CONF_GPS_PASS_THROUGH true
#define CONF_DEACTIVATE_GPS_CALCULATION true

The parameter #define CONF_GPS_PASS_THROUGH tells the firmware that all received GPS data should be sent to the control center.


In order to get this data displayed on the console, the following command must be executed:

set.cco, 1

Now you can see all the data sent to the control center. Including the GPS records.

With the following command you stop the output:

set.cco,0


By default, the GPS module sends multiple records in a 1 second interval. These records are not all needed and generate an overhead. Only the record: $GPRMC for NEO-6M and $GNRMC for NEO-M8N are needed. Therefore, there is the possibility to configure the module when starting the Raindancer firmware so that it sends only the required record and this only in a 3 second cycle. For this the following parameter is set:

#define CONF_INIT_GPS_WITH_UBLOX true

Thus the array const char UBLOX_INIT [] (in config.h) is sent to the GPS module during startup. To activate or deactivate you have to comment in or comment out individual lines.


Enable internal calculation

Again #define CONF_INIT_GPS_WITH_UBLOX should be true. To activate the internal calculation CONF_DEACTIVATE_GPS_CALCULATION must be set.

#define CONF_DEACTIVATE_GPS_CALCULATION false

For the NEO-6M module, the record: $GPRMC is used. The NEO-M8N uses the record $GNRMC. Therefore, the following lines must be commented in or out depending on the module used:

#define CONF_N_GPRMC_STR            "$GPRMC"    // GPS messagetype begin for $GPRMC for NEO-6M
//#define CONF_N_GPRMC_STR          "$GNRMC"    // GPS messagetype begin for $GPRMC for NEO-M8N

With

gps.show

you can display the calculated values.

If you have included the "GxGGA on" data set in UBLOX_INIT [], then Quality, Satellites and Altitude will also be displayed. These are not used anymore for other things.


It is possible to configure a GPS area in which the Mower assumes he is in the perimeter if the perimeter signal is too weak for detection.

The area is specified as a polygon.

const float CONF_LAT_POLYGON_Y[] = { 54.083245f, 54.084068f,  54.084679f,  54.085623f,  54.084018f }; // Latitude polygon points
const float CONF_LON_POLYGON_X[] = { 10.447986f, 10.447055f,  10.446015f,  10.447120f,  10.44930f }; // Longitudinal polygon points
const int   CONF_NUMBER_OF_POLYGON_POINTS = 5;  // The number of the ploygon points

Each column belongs to a polygon point. You can at https://www.google.com/maps enter a point in the search: 54.08728,10.448400. Then you can see where this coordinate is. So you can see point by point how the polygon is constructed. It is important that the number of columns is defined correctly with CONF_NUMBER_OF_POLYGON_POINTS. You can enter 3 to N coordinate points. However, I suggest you use no more than 8 points to make the calculation time as low as possible

To find the points, you can set the robot to the appropriate point and enter gps.show. Then, e.g. the following is displayed:

!03,$GPRMC,104503.00,A,5123.24690,N,00812.92063,E,0.094,,290718,,,A*72
!03,$GPRMC speed: 0.094000 course:0.000000
!03,$GPRMC lat: 54.08744800,N lon: 10.44867700,E
!03,$GPRMC date: 29.7.18 time: 11:45:3

The point can then be taken from the line! 03,$GPRMC,lat:54.08744800,N lon:10.44867700,E. Here for Latitude = 54.087448 and Longitude = 10.448677.


The area recognition is switched on with:   #define CONF_USE_GPS_POLYGON true


It should be noted that the GPS signal has a tolerance of +-10m. That you should stay far enough away from the perimeter. Because that does sometimes not work, the parameter

#define CONF_PER_THRESHOLD_IGNORE_GPS 300

was introduced. This means that if the amplitude of the perimeter exceeds this value, the perimeter signal will be used in any case and will not be overwritten by the GPS signal, even if the mower is in the GPS range. The value 300 must be set according to your own requirements..

Warning.pngSafety Note: If the perimeter signal fails and the GPS range exceeds the perimeter, the mower will leave the perimeter area

Perimeter Sender

The original Ardumower transmitter hardware is used. The software has been changed slightly. A 128 bit signal is sent. The following perimeter signal is sent:

1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1,
-1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1

The LEDs have the following function (from left to right):

  • 1. 12V available
  • 2. 5V available
  • 3. Green when the interrupt which produces the signal is running (red LED not available because of wrong pin at Nano). Off when charging.
  • 4. Green when a current flows through the perimeter, red when no current is flowing (perimeter interrupted) or very little current because of high protective resistor. Off when charging.
  • 5. Yellow the robot is charging. Perimeter signal is switched off. LED 2 and 4 off.

When power on, all leds will be tested.

Attention: LEDs 3 and 4 are Duo LEDs. These LEDs have two colors. With LED 3. the red LED is not addressable, because on the Nano the wrong pin was hardware-technically connected. Furthermore, the LEDs may have been soldered the wrong way round. Then one wonders, for example, that LED 4 is red even though everything is OK and a current flows. Or just LED 3. shows red, although I have written green here.

If the transmitter is on and the robot does not return to the charging station after twelve hours, the transmitter will turn off the signal. Then either reboot the transmitter or load the robot into the charging station.

Charging Station

The charging stations are approached counterclockwise.

If no charging station is used,   CONF_DISABLE_CHARGINGSTATION = true should be set. Then the Mower drives at low battery voltage to the perimeter and stops.

Head charging station

If a head charging station is used, make sure that the contacts can go back at least 3 cm when the Mower drives against it. It would be better 4 cm. Furthermore, it should be noted that the contact pressure of the contact is sufficient. I suggest using grinding contacts.

In order to use a head charging station, the following must be configured in config.h:

#define CONF_DISABLE_CHARGINGSTATION       false
#define CONF_PASS_THROUGH_CHARGING_STATION false //the mower can go through the station
#define CONF_HEAD_CHARGING_STATION         true  //the mower can't go through the station

With the command

gohome

the mower is instructed to search the perimeter wire and drive to the charging station.

For testing, the mower can be placed on the perimeter wire, 2m in front of the charging station. Then enter

tpt

The Mower then drives to the charging station.

To leave the charging station enter

area,0

The Mower then drives 1m backwards, turns 90 degrees and drives 50cm forward. Then turn again a random angle and starts to mow. This process runs without bumper protection. Therefore, make sure that this area is free of obstacles.

The distances can be configured with the following parameters:

#define CONF_HEAD_CHARGING_DRIVE_BACK_CM   100   //when the mower leaving the head charging station, how far it should drive back
#define CONF_HEAD_CHARGING_DRIVE_FORW_CM    50   //when the mower drove back and then rotates 90 degree, how far it should run forward that both coils securely inside


When the Mower has detected the charging contacts, it will travel 3cm back and 3cm forward. Then the charge relay is turned on. After 10 seconds, it is checked whether a charging current is flowing. If not, docking will be attempted a second time. If this does not work, an error will be issued.

Through Charging Station

If a through charging station is used, make sure that the contacts can grind at least 10cm. Furthermore, it should be noted that the contact pressure of the contact is sufficient.

In order to use a through charging station, the following must be configured in config.h:

#define CONF_DISABLE_CHARGINGSTATION       false
#define CONF_PASS_THROUGH_CHARGING_STATION true   //the mower can go through the station
#define CONF_HEAD_CHARGING_STATION         false  //the mower can't go through the station

With the command

gohome

the mower is instructed to search the perimeter wire and drive to the charging station.

For testing, the Mower can be placed on the perimeter wire, 2m in front of the charging station. Then enter

tpt

The Mower then drives to the charging station.

To leave the charging station enter   area,10 The Mower then travels 10m along the perimeter wire and then starts mowing. 10m can be exchanged against any distance.


When the Mower has detected the charging contacts, it will move forward 4cm, back 3cm and forward 3cm. This is to make the contacts to grind a little for better contact. Then the charger relay is turned on. After 10 seconds, it is checked whether a charging current is flowing. If not, docking will be attempted a second time. If this does not work, an error will be output.

Troubleshooting

Mower stops

Problem: Mower stopped, cause was probably the transmitter. On the transmitter just lights still the two left LEDs. Transmitter turned and on again, 4 LEDs back to green and then it works again.

Solution: The third green light from the left indicates whether the transmitter Interrupt is running in the Nano.

Possibility A) The transmitter is on for more than 12 hours without the robot returning to the station. Then the transmitter turns off the perimeter signal.

Possibility b) Since this was not on, the nano seems to have hung up. If that happens again, I would swap the China Nano for an original Arduino Nano. Since the software has been running for me for a year, I do not assume that the software is the cause. I had used cheap nanos before. They were not really frequency stable with me, which is necessary for the transmitter however. Now I have an original in it.

I got the message: Out: READ und In: CMD

Problem: In Arduino Central wird folgendes angezeigt:

Out: READ
In: CMD: Command not recognized.
Out: READ
In: CMD: Command not recognized.
Out: READ
In: CMD: Command not recognized.
Out: READ

Suggested solution: In the Arduino Centrale Settings "Read Command -> Enable Read Command" is activated

Understanding the Behaviour Tree

  1. REDIRECT Understanding the Behaviour Tree