Raindancer Firmware (English)
!!! I am currently translating this side. !!!
Attention! The software is still changing and can be changed / extended at any time.
(Auf Github mit dem grünen Button das Zip-File herunterladen)
The Raindancer firmware is located in the directory code\Raindancer
The transmitter firmware is located in the directory code\sender
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 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.
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. 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.
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.
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.
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 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 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. 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.
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,30 //drives 60 cm with speed 30 (//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.
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.
To view the files of the BHT the following free software can be used:
The files of the BHT are here:
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.
- 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
- 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
Safety note: For safety reasons, the mower blades must not be mounted during the first tests!
- 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
The file config.h contains the basic configuration of the firmware.
'Before commissioning the parameters must be adjusted.'
#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_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.