Azurit Firmware (English)
Inhaltsverzeichnis
Download and flash Arduino code
NOTE: If you have never worked with Arduino before, read our 'Arduino first steps' introduction.
You have two options:
- Download github code (recommended) OR
- Download v0.9.3 code (old, not recommended)
Finally, download and start the Arduino IDE to flash the code to your Arduino.
Arduino Version: It is very Importent that you use the Arduino IDE version 1.6.3 or above AND select the right Board (Mega 2560 or Due).
Important for Arduino IDE 1.6 or higher: if you see any folders inside the code folder (e.g. 'unused'), please delete them before compilation! Note: Always verify that the pin configuration in your Arduino code (config.h/mower.cpp) matches your actual circuit!
Settings
The robot uses settings that you can adjust for your own robot and environment (via pfodApp or directly in the code). The default settings (factory settings) are stored in the config file 'mower.cpp'. In this file you can find a description of all settings.
The settings can be adjusted via Android phone (pfodApp).
Important: If you uploaded a new version into your robot, reset all settings via pfodApp once (Settings->Factory reset). This will delete all existing settings. Old settings can produce malfunction if the internal settings format has changed.
First-time usage
1. At first, deactivate all sensors - In 'mower.cpp' set the robot settings like this:
bumperUse = 0; dropUse = 0; rainUse = 0; sonarUse = 0; perimeterUse = 0; lawnSensorUse = 0; imuUse = 0; batMonitor = 0; odometryUse = 0; gpsUse = 0; buttonUse = 1; timerUse = 0;
2. The software offers a serial console mode. Open the serial console in the Arduino IDE (CTRL+SHIFT+M) and set the baudrate to 19200. The motor and sensor values should appear constantly. First let's delete any existing error. Send the letter 'd' to the Arduino.
Console: press... d for menu e=delete all errors
3. Run the ADC calibration, so that the ADC signals are symmetric around zero.
pres... 8=ADC calib (perimeter sender, charger must be off)
4. Save user settings
press... 9=saver user settings
5. Test motors:
press... 1=test motors Security note: For security reasons, always remove mower blades in your first tests!
You should verify that the wheel motors are controlled correctly and in the right direction. Increase 'motorAccel' in 'mega.cpp' if the motors are not accelerating quickly enough.
Starting the mower
To start the mower, you need to add a button and a buzzer:
pinButton —o Button o— GND (button for ON/OFF)
pinBuzzer —o Buzzer o— GND (Piezo buzzer)
Now, press the button as long as you hear the beeps:
Mode (press button for x beeps):
1 beeps : Normal mowing (using blade modulation if available) 2 beeps : Normal mowing (without blade modulation) 3 beeps : Drive by model remote control (RC) 4 beeps : Drive without mowing 5 beeps : Find perimeter and track it
Diagnostics/troubleshooting
Each time a sensor triggers, its corresponding sensor counter increases. The sensor trigger counters as well as the current sensor values can be viewed on the serial console. The following values are shown for the trigger counters in the serial console:
- Time of state machine's state (ms)
- loop()-counts per second
- choosen Verbose-Mode (0=counter readings/1=current values/2=current values)
- current state machine state (FORW, REV, ROLL etc.)
- drive home? (1/0)
- "spd" - Control/speed motors: left (PWM), right (PWM), mower (RPM)
- "sen" - Current limit exceeded counter motors: left, right, mower
- "bum" - bumper counter: left, right
- "son" - Ultrasonic-distance threshold exceeded (counter)
- "pit/roll" - Tilt (computed by acceleration sensor)
- "com" - compass course
- "per" - Perimeter loop detected: counter
- "bat" - Battery voltage
- "chg" - Charging current
Using the key 'v', you can toggle between sensor trigger counters and current sensor values.
Additionally, you can use pfodApp (Android) to plot the sensors (trigger counters and current values) over time. This allows you to wirelessly monitor your robot mower for error diagnostics. It is highly recommended.
Error codes and troubleshooting
http://wiki.ardumower.de/index.php?title=Troubleshooting
Error counter / error beeps
If there's a communication problem or another serious problem, the error counter increases. The error counter can be monitored via pfodApp. Additionally, the robot mower will beep when started.
See section Troubleshooting for details on all errors.
I2C bus / error beeps
Several components (Arduino Nano, RTC, IMU, etc.) are communicating via the I2C bus (SDA/SCL wires). These wires should be very short (maybe even twisted) and they should be far away from DC converter and motor drivers. If there's a communication problem, the error counter will increase and robot will beep when started. The error counter can be monitored via pfodApp.
Troubleshooting
Hardware measurements
For detecting failures in the assembly or electronic parts, it is highly recommended to use an oscillscope (e.g. pocket oscillscope DSO201) for your measurements. An Oscilloscope allows you to detect short-time failures in power signals, perimeter sender and receiver signals, odometry signals and more.
Tutorial for pocket oscilloscopes: http://www.ardumower.de/index.php/de/forum/anleitungen-hilfe/142-bedienung-oszilloskop-dso201
Error codes
If your robot beeps periodically, it is in ERROR state. Either run the serial console or 'pfodApp->Error Counters' to find out the detailed error. The possible solutions for each error are given below. For details about your robot settings, see Settings.
ERR_CPU_SPEED CPU speed error * Check I2C cables (e.g. reduce wire length) ERR_MOTOR_LEFT Left gear motor error * Check gear motor driver module and left gear motor (supply voltage, signal lines) * MC33926: ensure SLEW jumper is not set * Tracking: reduce Motor-Max-PWM and Tracking-P to reduce EMF ERR_MOTOR_RIGHT Right gear motor error * Check gear motor driver module and right gear motor (supply voltage, signal lines) * MC33926: ensure SLEW jumper is not set * Tracking: reduce Motor-Max-PWM and Tracking-P to reduce EMF ERR_MOTOR_MOW Mower motor error * Check mower motor driver module and mower motor (supply voltage, signal lines) * MC33926: ensure SLEW jumper is not set * Reduce Motor-Max-Power, so over-current is detected earlier ERR_MOW_SENSE Mower motor over-current * Check mower motor driver module and mower motor * Increase Motor-Max-Power, so over-current is detected later ERR_IMU_COMM IMU communication error * Check IMU module connections ERR_IMU_CALIB IMU calibration error * Start IMU calibration (either via Console or pfodApp->Settings->IMU) ERR_IMU_TILT IMU tilt error * Check IMU module and robot orientation ERR_RTC_COMM RTC communication error * Check RTC module connections, RTC battery etc. ERR_RTC_DATA RTC corrupt data error * Set and save RTC date and time ERR_PERIMETER_TIMEOUT Perimeter signal timeout * Check perimeter sender, wire etc. * Check coil polarity * Reduce Perimeter-smag, so timeout is higher * Increase Perimeter-timeout-seconds, so timeout is higher * Check your signal-to-noise ratio is higher than 1.0 ERR_TRACKING Perimeter tracking error * Check perimeter sender, wire etc. * Increase Perimeter-tracking-timeout, so timeout is higher ERR_ODOMETRY_LEFT Left motor odometry error * Check left odometry cable * Check left motor direction ERR_ODOMETRY_RIGHT Right motor odometry error * Check right odometry cable * Check right motor direction ERR_BATTERY Battery error * Check battery connections ERR_CHARGER Charger error * Check charger connections ERR_GPS_COMM GPS communication error * Check GPS cables ERR_GPS_DATA GPS data error * Check GPS antenna and cable ERR_ADC_CALIB ADC calibration error * Start ADC calibration (either via Console or pfodApp->ADC calibration) ERR_EEPROM_DATA EEPROM data error * Save user settings (either via Console or pfodApp->Settings-Save)
After fixing the error, you can delete errors:
Console: press... d for menu e=delete all errors
I2C errors
Ensure the I2C bus is working correctly. A console stucked at line 'initL3G4200D' indicates I2C is not working correctly.
Disable all pins not connected
Ensure that you have disabled all features and pins in the robot configuration that are not connected (not used).
Example: If you do not have connected odometry pins, disable them in the robot config (robot.cpp):
odometryUse = 0; // use odometry?
Motors working correctly
Run the serial console (Arduino IDE: CTRL+SHIFT+M, 19200 Baud) and press 'd' and ENTER for menu. Then press '1' and ENTER to run the motor test.
Any unexpected sensor triggering
If your robot does something unexpected, it might be a sensor that is incorrectly triggering. Check this via the serial console:
Run the serial console (Arduino IDE: CTRL+SHIFT+M, 19200 Baud), and start the robot. Each time a sensor triggers, the counter of that sensor will increase. See description of each sensor below. Now when your robot does something unexpected, have a look which of the sensor counters increased to locate the problem.
Some sensor not triggering?
...
Bluetooth not connecting?
- Verify that BT module baudrate is configured properly (using Ardumower Console) - activate programming button on BT module for programming procedure.
- Verify that BT module is 'paired' on your Android phone
- Verify that Arduino Mega is not powered via USB (but DC/DC instead)
Robot not stopping to rotate when reaching perimeter (home mode)
At first, verify that the perimeter tracking itself is working: Manually put the robot on the perimeter wire, and via ArduRemote App, choose 'Commands->Track' and verify the robot is tracking the perimeter. If it does not, adjusting the tracking PID parameters may help.
The position of the coil should be as indicated here:
If the robot runs over the perimeter wire (coil is then "outside" of perimeter loop) it will try to get "inside" the loop again by rotating. If getting the coil "inside" the loop by rotating is not possible, the robot will rotate endless.
The more the robot runs over the perimeter, the more difficult it is to get "inside" again by rotation. The robot speed should be reduced as well as moving the coil further outside.
NOTE: It's always a good idea to manually place the robot at the position where you saw the robot detecting the perimeter. The perimeter plot should change from "in" to "out" at that position (http://wiki.ardumower.de/index.php?title=Perimeter_wire#Receiver_diagnostics.2Ftroubleshooting). Then manually rotate the robot (without motor) at that position and verify that "out" changes again to "in". If that is not the case, the position of the coil is not OK or the robot drives too quickly and detects the perimeter too late.
Console output
When the robot starts, it outputs something like this in the serial console:
START Ardumower rXXXX press... d for menu v to change console output (sensor counters, values, perimeter etc.)
t 0 l177 v0 FORW spd 33 33 0 sen 0 0 0 bum 0 0 dro 0 0 son 0 yaw 0 pit 0 rol 0 bat 20.8 chg 21.7 0.0 imu 0 adc 0 Ardumower t 1 l177 v0 FORW spd 33 33 0 sen 0 0 0 bum 0 0 dro 0 0 son 0 yaw 0 pit 0 rol 0 bat 20.8 chg 21.7 0.0 imu 0 adc 0 Ardumower t 3 l177 v0 FORW spd 33 33 0 sen 0 0 0 bum 0 0 dro 0 0 son 0 yaw 0 pit 0 rol 0 bat 20.8 chg 21.7 0.0 imu 0 adc 0 Ardumower
Once a sensor triggers, its counter increases.
Example (mower motor current overflow triggered):
t 4 l177 v0 FORW spd 33 33 0 sen 0 0 0 bum 0 0 dro 0 0 son 0 yaw 0 pit 0 rol 0 bat 20.8 chg 21.7 0.0 imu 0 adc 0 Ardumower t 5 l177 v0 REV spd -26 -26 0 sen 0 0 1 bum 0 0 dro 0 0 son 0 yaw 0 pit 0 rol 0 bat 20.8 chg 21.7 0.0 imu 0 adc 1 Ardumower
Here is a description of each column:
t - time of current machine state (ms) l - loop () - cycles per second v - Verbose mode selected sensor (0 = counts / 1 = sensor values / 2 = sensor values) - Current machine status (FORW, REV, ROLL etc.) - After-home-drive? (1/0) spd - control / speed motor: left (PWM), right (PWM), mower (speed) sen - motor current overflow counter: left, right, mower bum - bumper counter: left, right son - ultrasonic distance-below: counter pit, roll - inclination (calculated with Accel sensor) yaw - compass course bat - battery voltage chg - charger voltage sensor
--- commands ---
'd': menu for testing, adjust IMU, Bluetooth 'v': monitorMode (show Value not Counter 'h': drive home 'p': track perimeter 'l': simulate left bumper 'r': simulate right bumper 's': simulate lawn sensor 'm': toggle mower motor 'c': simulate charging '+': rotate 90 degrees '-': rotate 90 degrees '3': activate model RC '0': OFF '1': Automode motorMowEnable
Sensor logging
For PC data analysis, algorithm modelling and optimization, you can collect robot sensor data using pfodApp like this:
- Using your Android pfodApp, connect to your robot and choose 'Log sensors'. The logged sensor data will be displayed. Click 'Back' to stop logging (NOTE: for ArduRemote, press Android menu button before and choose 'Enable logging' to enable file logging).
- Connect your Android phone to the PC, if being asked on the phone choose 'Enable as USB device', so you phone shows as a new Windows drive on your PC.
- On your PC, launch Windows Explorer and choose the new Android drive, browse to the 'pfodAppRawData' folder (for ArduRemote: 'ArduRemote' folder), and copy the data file to your PC (you can identify files by their Bluetooth name and date).
How to report a new bug/new feature/new code
Click on 'this link' and create a new issue - Please let us know:
Your platform version (Arduino Mega 2560, Arduino Due) Your Arduino IDE version (latest code requires 1.6.3) Your exact operating system (Windows 8, Linux etc.) Your Ardumower code version (for a list of releases see https://github.com/Ardumower/ardumower/releases) Any other information that may be useful...