Ardumower PCB: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Schematics)
(First-time usage)
 
(164 dazwischenliegende Versionen von 6 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
=Abstract=
+
 
 +
[[File: Pcb_top.jpg | 800px]]
 +
 
 
This page describes how to assemble the Ardumower PCB, flash the Arduino and configure the robot mower.
 
This page describes how to assemble the Ardumower PCB, flash the Arduino and configure the robot mower.
 +
 +
=Abstract=
  
 
The controller is built around a ready microcontroller board (Arduino Mega 2560 using 54 I/O pins).  
 
The controller is built around a ready microcontroller board (Arduino Mega 2560 using 54 I/O pins).  
 
<gallery>
 
<gallery>
File: Ardumower_overview.png|Components overview
+
File: Ardumower_overview.png | Components overview
File: Arduinomega.jpg|Ardumower's heart: Arduino Mega 2560 microcontroller
+
File: Ardumower_pcb_photo.jpg | Ardumower PCB connects all modules (available in the shop)
File: Ardumower_parts.jpg|Parts available in the shop
+
File: Pcb_top.jpg | PCB top
File: Ardumower_chassis_inside3.jpg | Parts mounted (Ardumower Chassis)
+
File: Pcb_bluetooth.jpg | PCB back
File: Ardumower_board1.jpg | Parts mounted (Ardumower Chassis)
+
File: Pcb_mc33926.jpg | PCB and MC33926
 
</gallery>
 
</gallery>
  
=Needed parts=
+
=Needed modules=
  
All parts can be purchased as complete kits via the [https://www.marotronics.de/index.php?k=7 shop] [[File: shopping.png|link=https://www.marotronics.de/index.php?k=7]] .
+
All modules can be purchased as complete kits via the [https://www.marotronics.de/index.php?k=7 shop] [[File: shopping.png|link=https://www.marotronics.de/index.php?k=7]] .
  
* Main functions
+
=PCB=
** Arduino cable (female-female and male-female jumper cable)
+
The printed circuit board (PCB) connects all electronic modules. The PCB is made with the following design parameters:
** 1 x Arduino Mega 2560
+
** 1 x DC voltage step-down module (LM2596)
+
** 1 x MC33926 motor driver module
+
** 1 x current sensor module ACS712-5
+
** 1 x current sensor module ACS712-30
+
** 1 x mower motor driver circuit: MOSFET IRLIZ44N, Diode MBR1045, Schottky-Diode 10A, Resistors (10K, 180 Ohm)
+
** Resistors (2 x 47K, 2 x 5K), Capacitors ( Fuse F20A250V
+
** Piezo buzzer (0,1W), button, ON/OFF switch 10A
+
  
* Perimeter sender (optional)
+
* PCB dimensions 241x114mm
** 1 x Arduino Nano
+
* All modules (motor driver, Bluetooth, etc.) can be soldered (or plugged) on the PCB (modules are available in the Ardumower shop)
** 1 x DC voltage step-down module (LM2596)
+
* Uses the Arduino Mega 2560
** 1 x MC33926 motor driver module
+
* Optional: can use Arduino Due via additional adapter PCB
 +
* Optional: integrated charging circuit (current limiting)
 +
* All connections are available on connectors as well as +5V and GND
 +
* Max. trace current (for motors): 8A
  
* Perimeter receiver (optional)
+
==PCB building manual==
** 1 x Arduino Nano
+
Robot PCB v0.5 (initial prototype, please do not use anymore)
** 1 x LM386 amplifier module
+
* [https://github.com/Ardumower/ardumower/tree/master/pcb/Produzierte_Platinen/megashield_svn_0.5/Platinenbilder Photos]
** Capacitor (1 x 4,7nF), 1 x Receiver coil 100mH
+
* [https://github.com/Ardumower/ardumower/raw/master/pcb/Produzierte_Platinen/megashield_svn_0.5/ardumower%20mega%20shield%20svn.pdf Schematics]
 +
* [http://www.ardumower.de/media/kunena/attachments/1259/ArdumuverBestckung2015-04-221115.pdf Build instructions]
 +
* [http://www.ardumower.de/media/kunena/attachments/905/TranslatedcopyofPrototypPlatine.docx.pdf Build instructions (English translation)]
  
* Additional modules
+
Robot PCB v1.2  (minor layout changes)
** 1 x HC-SR04 ultrasonic sensor module (optional)
+
* [https://github.com/Ardumower/ardumower/raw/master/pcb/Produzierte_Platinen/megashield_svn_1.2_geschlossen/ardumower%20mega%20shield%20svn.pdf Schematics]
** 1 x GY80 module (gyro, accel. compass) (optional)
+
* [https://github.com/Ardumower/ardumower/tree/master/pcb/Produzierte_Platinen/megashield_svn_1.2_geschlossen/Platinenbilder Photos]
** 1 x DS1307 realtime clock module (optional)
+
* [http://www.ardumower.de/media/kunena/attachments/1259/ArdumuverBestckung2015-04-221115.pdf Build instructions]
** 1 x Bluetooth module (for phone control)
+
* [http://www.ardumower.de/media/kunena/attachments/905/TranslatedcopyofPrototypPlatine.docx.pdf Build instructions (English translation)]
 +
* [https://github.com/Ardumower/ardumower/blob/master/Dokumentation/Megashield%20svn%201.2%20und%20V0.5/WorkaRound20150527.pdf WorkaRound20150527]
 +
* [https://github.com/Ardumower/ardumower/blob/master/Dokumentation/Megashield%20svn%201.2%20und%20V0.5/WorkaRound20150530.pdf WorkaRound20150530]
 +
* also see: Documentation in [https://github.com/Ardumower/ardumower/tree/master/Dokumentation Github]
  
=Schematics=
 
  
A schematics says more than a thousand words...
+
'''NOTE:''' The schematics and PCB files were created with KiCad. They can be downloaded from [https://github.com/Ardumower/ardumower/archive/master.zip github] and can be edited by open source KiCAD software (Download [https://docs.google.com/uc?id=0BzTsqkQk2FRsSEhOR2tVc1p4LVk&export=download here] or [http://iut-tice.ujf-grenoble.fr/cao/KiCad_stable-2013.07.07-BZR4022_Win_full_version.exe here]).
  
<gallery>
+
==PCB building videos==
File: Ardumower mega shield svn 0.3.jpg | new SVN code UPDATET 0.03 (recommended)
+
* [https://www.youtube.com/watch?feature=player_embedded&v=smZj60sxQvU Resistors]
File: Ardumower_schematics.png | old v0.9.3 code (not recommended)
+
* [https://www.youtube.com/watch?feature=player_embedded&v=chEBCcJDsjg Diodes and relay]
</gallery>
+
* [https://www.youtube.com/watch?feature=player_embedded&v=O6nyuSsCH1I Capacitors and transistors]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=m8XGWGwdEBk Piezo buzzer and fuse]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=a1y8C_uRdtA Strip pins]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=RrU6lTCU0cc DC/DC converter]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=fOvV-kD0y7k RTC module]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=DokrJiVzX2I Dual MC33926]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=lyCH8CQD358 INA169]
 +
* [https://www.youtube.com/watch?feature=player_embedded&v=M-rC03VlGK4 Battery & charger]
  
PDF for the SVN Version found here: https://ardumower.googlecode.com/svn/trunk/pcb/megashield_svn_0.5/ardumower%20mega%20shield%20svn.pdf
+
==PCB jumpers==
 
+
KiCad Files are in the [https://code.google.com/p/ardumower/source/browse/#svn%2Ftrunk%2Fpcb SVN]
+
 
+
=PCB assembly=
+
The Pcb is made with the following design parameters:
+
 
+
* Single sided PCB "eurocard" dimensions 160x100mm (So you can build it yourself)
+
* All used modules are available in the ardumower shop
+
* Uses the arduino mega R3
+
* All connections are available on connectors as +5V and GND
+
 
+
Meanwhile the ardumower group is working on a version for the arduino Due
+
More to come
+
 
+
<gallery>
+
File: Pcb_prototype.jpg| PCB prototype
+
File: PCB.jpg| PCB drilled
+
File: Pcb_solder_side.jpg| PCB prototype solder side
+
</gallery>
+
 
+
=PCB 1.0 prototype, jumpers=
+
  
 
{| class="wikitable"
 
{| class="wikitable"
Zeile 81: Zeile 70:
 
! Comment
 
! Comment
 
|-
 
|-
| LM350T charging control
+
| Integrated charging control via adjustable
| D7: DIODE,
+
 
D4: DIODE
+
voltage regulator (LM350T) with potentiometer
| D7: SHORT-CIRCUIT,
+
 
D4: SHORT-CIRCUIT
+
for adjustable charging voltage
| Do not use if using external charger
+
(recommended: NO)
 +
| D7: DIODE
 +
 
 +
D3: DIODE
 +
 
 +
C1, C4, U4, RV1: used
 +
|D7: SHORT-CIRCUIT
 +
 
 +
D3: SHORT-CIRCUIT
 +
 
 +
C1, C4, U4, RV1: not used
 +
| Do not use if using external battery charger
 
|-
 
|-
| External power while charging  
+
| External power while charging (recommended: NO)
| JP6: CLOSE,
+
| JP6: CLOSE
 +
 
 
JP7: OPEN
 
JP7: OPEN
| JP6: OPEN,
+
 
 +
D4: DIODE
 +
 
 +
C5: not used
 +
| JP6: OPEN
 +
 
 
JP7: CLOSE
 
JP7: CLOSE
| Use for external power to your PCB (disconnect battery from PCB) while charging
+
 
 +
D4: SHORT-CIRCUIT
 +
 
 +
C5: used
 +
| Use to power your PCB from externally (disconnect battery from PCB) while charging
 
|-
 
|-
| Arduino controlled charge relay
+
| Arduino controlled charge relay (recommended: YES)
| JP4: CLOSE,
+
| JP4: CLOSE
 +
 
 
JP5: OPEN
 
JP5: OPEN
 
| JP4: OPEN
 
| JP4: OPEN
 +
 
JP5: CLOSE
 
JP5: CLOSE
 
| Use for Arduino controlled charge relay (not automatic charging)
 
| Use for Arduino controlled charge relay (not automatic charging)
Zeile 108: Zeile 120:
 
|-
 
|-
 
| Bluetooth VCC=3.3V
 
| Bluetooth VCC=3.3V
| JP8: OPEN,
+
| JP8: OPEN
 +
 
 
JP9: CLOSE
 
JP9: CLOSE
| JP8: CLOSE,
+
| JP8: CLOSE
 +
 
 
JP9: OPEN
 
JP9: OPEN
 
| Many latest modules use 3.3V
 
| Many latest modules use 3.3V
Zeile 118: Zeile 132:
 
| JP2: OPEN
 
| JP2: OPEN
 
| Use for reprogramming baud rate etc.
 
| Use for reprogramming baud rate etc.
 +
|}
 +
 +
==PCB modules==
 +
 +
[[Image:Ina169_marotronics.jpg|thumb|200px| Note for Marotronics INA169: Short pads for 5A operation]]
 +
 +
{| class="wikitable"
 +
|-
 +
! Module
 +
! Feature
 +
! Pinout
 +
! Optional
 +
! Comment
 +
|-
 +
| U1
 +
| DC/DC converter (10V)
 +
| GND, Vout, Vin, GND
 +
| No
 +
|
 +
|-
 +
| U2
 +
| Bluetooth (HC-05)
 +
| VCC, GND, TXD, RXD, Key, LED
 +
| Yes
 +
|
 +
|-
 +
| U3
 +
| Current sensor (charging)
 +
| VCC, GND, OUT, IP+, IP-5
 +
| Yes
 +
|
 +
|-
 +
| U4
 +
| Charge control (LM350T)
 +
| AJD, OUT, IN
 +
| Yes
 +
|
 +
|-
 +
| U5
 +
| Current sensor (charging)
 +
| VCC, GND, OUT, IP+, IP-5
 +
| Yes
 +
|
 +
|-
 +
| U6
 +
| DC/DC converter (3.3V)
 +
| GND, Vout, Vin, GND
 +
| No
 +
|
 +
|-
 +
| U7
 +
| DC/DC converter (5V)
 +
| GND, Vout, Vin, GND
 +
| No
 +
|
 +
|-
 +
| U8
 +
| Realtime clock (DS1307)
 +
| Batt, GND, VCC, SDA, SCL, DS, SQ
 +
| Yes
 +
|
 +
|-
 +
| U9
 +
| Wifi (ESP8266)
 +
| TX, CH_PD, Reset, VCC, GND, GP_IO2, GP_IO0, RX
 +
| Yes
 +
|
 +
|-
 +
| U10
 +
| Level shifter 5V->3V (Arduino Due)
 +
|
 +
| Yes
 +
|
 +
|-
 +
| U11
 +
| Wifi (ESP8266)
 +
| TX, CH_PD, Reset, VCC, GND, GP_IO2, GP_IO0, RX
 +
| Yes
 +
| alternative mount position
 +
|-
 +
|}
 +
 +
==PCB connectors==
 +
 +
{| class="wikitable"
 +
|-
 +
! Connector
 +
! Feature
 +
! Pinout
 +
! Optional
 +
! Comment
 +
|-
 +
| P1
 +
| Sonar center (HC SR-04)
 +
| 5V, GND, Trigger, Echo
 +
| Yes
 +
|
 +
|-
 +
| P2
 +
| Sonar right (HC SR-04)
 +
| 5V, GND, Trigger, Echo
 +
| Yes
 +
|-
 +
| P3
 +
| Sonar left (HC SR-04)
 +
| 5V, GND, Trigger, Echo
 +
| Yes
 +
|-
 +
| P4
 +
| reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P5
 +
| IMU (gyro,acceleration,compass) (GY-80)
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P6
 +
| Lawn sensor
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P7
 +
| Status LEDs
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P8
 +
| Odometry right
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P9
 +
| Odometry left
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P10
 +
| GPS (GY-NEO6MV2)
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P11
 +
| Bumper
 +
| GND, GND, right, left
 +
| Yes
 +
|
 +
|-
 +
| P12
 +
| Perimeter coil (center or left)
 +
| 5V, GND, perimeter
 +
| Yes
 +
|
 +
|-
 +
| P13
 +
| R/C remote control
 +
| 5V, GND, mow, steer, speed, switch
 +
| Yes
 +
|
 +
|-
 +
| P14
 +
| Measurement points
 +
| 5V, GND, (Depending on JP15: 3.3V, 5V or Arduino 3.3V)
 +
| Yes
 +
|
 +
|-
 +
| P15
 +
| Wheel motor left
 +
| M1OUT1, M1OUT2
 +
| No
 +
|
 +
|-
 +
| P16
 +
| Optional motor driver input
 +
|
 +
| Yes
 +
| Do not connect
 +
|-
 +
| P17
 +
| Optional motor driver input
 +
|
 +
| Yes
 +
| Do not connect
 +
|-
 +
| P18
 +
| Wheel motor right
 +
| M2OUT1, M2OUT2
 +
| No
 +
|
 +
|-
 +
| P19
 +
| Tilt sensor
 +
| 5V, GND, tilt
 +
| Yes
 +
|
 +
|-
 +
| P20
 +
| Button (Start/Stop)
 +
|
 +
| No
 +
|
 +
|-
 +
| P21
 +
| Drop sensor right
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P22
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P23
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P24
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P25
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P26
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P27
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P28
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P29
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P30
 +
| Perimeter coil right
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P31
 +
| Drop sensor left
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P32
 +
| GND
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P33
 +
| 5V
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P34
 +
| 3.3V
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P35
 +
| Mower motor RPM
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P36
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P37
 +
| Mower motor
 +
|
 +
| No
 +
|
 +
|-
 +
| P38
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P39
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P40
 +
| User switches
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P41
 +
| Rain sensor
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P42
 +
| Charging pins
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P43
 +
| Battery (24V)
 +
|
 +
| No
 +
|
 +
|-
 +
| P44
 +
| Wifi module (ESP8266)
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P45
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 +
| P46
 +
| Reserved
 +
|
 +
| Yes
 +
|
 +
|-
 
|}
 
|}
  
Zeile 127: Zeile 507:
 
[[File:warning.png]]Warning : never connect more than 5V on the Arduino 5V pins, or you will damage the Arduino. Therefore, always measure the 5V voltage before connecting it to the Arduino 5V pin!
 
[[File:warning.png]]Warning : never connect more than 5V on the Arduino 5V pins, or you will damage the Arduino. Therefore, always measure the 5V voltage before connecting it to the Arduino 5V pin!
 
All components together (as shown in the schematics) need about 5W power.
 
All components together (as shown in the schematics) need about 5W power.
 
<gallery>
 
File: Dcdc_noise.jpg | NOTE: Keep away coil/pre-amplifier from DC/DC converters!
 
</gallery>
 
  
 
=Download and flash Arduino code=
 
=Download and flash Arduino code=
Zeile 137: Zeile 513:
  
 
You have two options:  
 
You have two options:  
* Download [https://code.google.com/p/ardumower/ Download SVN developer code (recommended, see steps below)]  OR
+
* Download [https://github.com/Ardumower/ardumower/releases github code (recommended)]  OR
 
* Download [http://www.ardumower.de/index.php/de/downloads v0.9.3 code (old, not recommended)]
 
* Download [http://www.ardumower.de/index.php/de/downloads v0.9.3 code (old, not recommended)]
  
Finally, download and start the [http://www.arduino.cc/ Arduino IDE] to flash the code to your Arduino.
+
Finally, download and start the [http://arduino.cc/en/Main/Software Arduino IDE] to flash the code to your Arduino.
  
'''Arduino Version''': It is very Importent that you use the Arduino IDE version 1.5.6-r2 or above AND select the right Board (Mega 2560 or Due).
+
'''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).
  
[[File:warning.png]] Note: Always verify that the pin configuration in your Arduino code (config.h/mower.cpp) matches your actual circuit!
+
[[File:warning.png]] <b>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! </b> 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 ([http://wiki.ardumower.de/index.php?title=Bluetooth pfodApp]).
  
SVN version download steps:
 
 
<gallery>
 
<gallery>
File: svnstep1.png | 1. Download and install Tortoise SVN client http://tortoisesvn.net/downloads.html
+
  File:Cheat_sheet.png | Visualization of settings
File: svnstep2.png | 2. In Windows Explorer, right-click, and choose 'SVN Checkout...'
+
  File:Speedcontrol.png | Motor speed settings
File: svnstep3.png | 3. Choose 'URL of repository': https://ardumower.googlecode.com/svn/trunk/, and click OK
+
File: svnstep4.png | 4. The project will be checked-out. In future, to get any updates, choose 'SVN Update'.
+
 
</gallery>
 
</gallery>
  
=First-time calibration=
+
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.
==Wheel motors==
+
[[File:warning.png]]Security note: For security reasons, always remove mower blades in your first tests!
+
  
Initially, you should verify that the wheel motors are controlled correctly and in the right direction. The software offers a diagnostic 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-time usage=
  
<blockquote style="background-color: lightgrey; border: solid thin grey;">
+
1. At first, deactivate all sensors - In 'mower.cpp' set the robot settings like this:
<pre>
+
    20 OFF  spd    0    0    0 sen    0    0    0 bum    0    0 son...
+
    21 OFF  spd    0    0    0 sen    0    0    0 bum    0    0 son...
+
    22 OFF  spd    0    0    0 sen    0    0    0 bum    0    0 son...
+
    23 OFF  spd    0    0    0 sen    0    0    0 bum    0    0 son...
+
    24 OFF  spd    0    0    0 sen    0    0    0 bum    0    0 son...
+
    ...
+
</pre>
+
</blockquote>
+
  
Now, press the key ‘t’ on the keyboard, and confirm using ENTER. The diagnostic mode should appear, and you can test your motors.
+
bumperUse = 0;
 +
dropUse = 0;
 +
rainUse = 0;
 +
sonarUse = 0;
 +
perimeterUse = 0;
 +
lawnSensorUse = 0;
 +
imuUse = 0;
 +
batMonitor = 0;
 +
odometryUse = 0;
 +
gpsUse = 0;
 +
buttonUse = 1;
 +
timerUse = 0;
  
==ADC calibration==
+
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.
Run the ADC calibration once (either via serial console or "pfodApp->ADC Calibration"), so that the received signal is symmetric around zero.
+
  
=Diagnostic=
+
Console:
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:
+
press...
 +
d for menu
 +
e=delete all errors
  
# Time of state machine's state (ms)
+
3. Run the ADC calibration, so that the ADC signals are symmetric around zero.
# loop()-counts per second
+
pres...
# choosen Verbose-Mode (0=counter readings/1=current values/2=current values)
+
8=ADC calib (perimeter sender, charger must be off)
# 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.
+
4. Save user settings
 +
press...
 +
9=saver user settings
  
Additionally, you can use pfodApp (Android) to plot the sensors (trigger counters and current values) over time:
+
5. Test motors:
 +
press...
 +
1=test motors
 +
 +
[[File:warning.png]]Security note: For security reasons, always remove mower blades in your first tests!
  
<gallery>
+
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.
File:Ardumower_sensor_counter_plotting.jpg |Sensor trigger counters
+
File:Ardumower_plot_sensors.jpg |Sensor measurement values
+
</gallery>
+
  
 
=Starting the mower=
 
=Starting the mower=
Zeile 221: Zeile 591:
 
  5 beeps : Find perimeter and track it
 
  5 beeps : Find perimeter and track it
  
=Error counter / error beeps=
+
=Diagnostics/troubleshooting=
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.
+
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:
  
==I2C bus / error beeps==
+
# Time of state machine's state (ms)
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.
+
# 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
  
=Config files=
+
Using the key 'v', you can toggle between sensor trigger counters and current sensor values.
You can adapt the Ardumower code to your own robot mower hardware using the config file:
+
* config.h (old v9.0.3)
+
* mower.cpp (SVN version)
+
  
Config files translate the commands of the main program into the specific hardware (i.e. actuators and sensors) - that allows us to adapt the main program to different robot mowers:
+
[[File:warning.png]] 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.
  
 
<gallery>
 
<gallery>
File:Ardumower_config_files.png
+
File:Ardumower_sensor_counter_plotting.jpg |Sensor trigger counters
 +
File:Ardumower_plot_sensors.jpg |Sensor measurement values
 +
File: Ardumower_states.png | Ardumower states
 
</gallery>
 
</gallery>
  
Example:
+
==Error codes and troubleshooting==
 +
http://wiki.ardumower.de/index.php?title=Troubleshooting
  
The main program wants to drive the left wheel motor with speed 100. The chosen robot config file is called by the main program with this command:
+
=Error counter / error beeps=
setActuator(ACT_MOTOR_LEFT, 100)
+
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.
  
The actual config file will execute this command by calling the specific motor driver:
+
See section [[Troubleshooting]] for details on all errors.
setL298N(pinMotorLeft, pinMotorLeftPWM, 100)
+
  
To enable a sensor, remove the comment of that line. To disable a sensor, comment the line with a double slash (//).
+
==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.
==pfodApp==
+
The configuration of the robot mower can be set via Android phone ([http://wiki.ardumower.de/index.php?title=Bluetooth pfodApp]).  
+
 
+
Important: If you flashed a new version, 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.
+
  
 
=Further links=
 
=Further links=

Aktuelle Version vom 1. April 2017, 08:14 Uhr

Pcb top.jpg

This page describes how to assemble the Ardumower PCB, flash the Arduino and configure the robot mower.

Abstract

The controller is built around a ready microcontroller board (Arduino Mega 2560 using 54 I/O pins).

Needed modules

All modules can be purchased as complete kits via the shop Shopping.png .

PCB

The printed circuit board (PCB) connects all electronic modules. The PCB is made with the following design parameters:

  • PCB dimensions 241x114mm
  • All modules (motor driver, Bluetooth, etc.) can be soldered (or plugged) on the PCB (modules are available in the Ardumower shop)
  • Uses the Arduino Mega 2560
  • Optional: can use Arduino Due via additional adapter PCB
  • Optional: integrated charging circuit (current limiting)
  • All connections are available on connectors as well as +5V and GND
  • Max. trace current (for motors): 8A

PCB building manual

Robot PCB v0.5 (initial prototype, please do not use anymore)

Robot PCB v1.2 (minor layout changes)


NOTE: The schematics and PCB files were created with KiCad. They can be downloaded from github and can be edited by open source KiCAD software (Download here or here).

PCB building videos

PCB jumpers

Feature used YES NO Comment
Integrated charging control via adjustable

voltage regulator (LM350T) with potentiometer

for adjustable charging voltage (recommended: NO)

D7: DIODE

D3: DIODE

C1, C4, U4, RV1: used

D7: SHORT-CIRCUIT

D3: SHORT-CIRCUIT

C1, C4, U4, RV1: not used

Do not use if using external battery charger
External power while charging (recommended: NO) JP6: CLOSE

JP7: OPEN

D4: DIODE

C5: not used

JP6: OPEN

JP7: CLOSE

D4: SHORT-CIRCUIT

C5: used

Use to power your PCB from externally (disconnect battery from PCB) while charging
Arduino controlled charge relay (recommended: YES) JP4: CLOSE

JP5: OPEN

JP4: OPEN

JP5: CLOSE

Use for Arduino controlled charge relay (not automatic charging)
Arduino Due (3.3V I/O) LP0, ..., LP15: OPEN LP0, ..., LP15: CLOSE Do not use if using Arduino Mega
Bluetooth VCC=3.3V JP8: OPEN

JP9: CLOSE

JP8: CLOSE

JP9: OPEN

Many latest modules use 3.3V
Bluetooth programming mode JP2: CLOSE JP2: OPEN Use for reprogramming baud rate etc.

PCB modules

Note for Marotronics INA169: Short pads for 5A operation
Module Feature Pinout Optional Comment
U1 DC/DC converter (10V) GND, Vout, Vin, GND No
U2 Bluetooth (HC-05) VCC, GND, TXD, RXD, Key, LED Yes
U3 Current sensor (charging) VCC, GND, OUT, IP+, IP-5 Yes
U4 Charge control (LM350T) AJD, OUT, IN Yes
U5 Current sensor (charging) VCC, GND, OUT, IP+, IP-5 Yes
U6 DC/DC converter (3.3V) GND, Vout, Vin, GND No
U7 DC/DC converter (5V) GND, Vout, Vin, GND No
U8 Realtime clock (DS1307) Batt, GND, VCC, SDA, SCL, DS, SQ Yes
U9 Wifi (ESP8266) TX, CH_PD, Reset, VCC, GND, GP_IO2, GP_IO0, RX Yes
U10 Level shifter 5V->3V (Arduino Due) Yes
U11 Wifi (ESP8266) TX, CH_PD, Reset, VCC, GND, GP_IO2, GP_IO0, RX Yes alternative mount position

PCB connectors

Connector Feature Pinout Optional Comment
P1 Sonar center (HC SR-04) 5V, GND, Trigger, Echo Yes
P2 Sonar right (HC SR-04) 5V, GND, Trigger, Echo Yes
P3 Sonar left (HC SR-04) 5V, GND, Trigger, Echo Yes
P4 reserved Yes
P5 IMU (gyro,acceleration,compass) (GY-80) Yes
P6 Lawn sensor Yes
P7 Status LEDs Yes
P8 Odometry right Yes
P9 Odometry left Yes
P10 GPS (GY-NEO6MV2) Yes
P11 Bumper GND, GND, right, left Yes
P12 Perimeter coil (center or left) 5V, GND, perimeter Yes
P13 R/C remote control 5V, GND, mow, steer, speed, switch Yes
P14 Measurement points 5V, GND, (Depending on JP15: 3.3V, 5V or Arduino 3.3V) Yes
P15 Wheel motor left M1OUT1, M1OUT2 No
P16 Optional motor driver input Yes Do not connect
P17 Optional motor driver input Yes Do not connect
P18 Wheel motor right M2OUT1, M2OUT2 No
P19 Tilt sensor 5V, GND, tilt Yes
P20 Button (Start/Stop) No
P21 Drop sensor right Yes
P22 Reserved Yes
P23 Reserved Yes
P24 Reserved Yes
P25 Reserved Yes
P26 Reserved Yes
P27 Reserved Yes
P28 Reserved Yes
P29 Reserved Yes
P30 Perimeter coil right Yes
P31 Drop sensor left Yes
P32 GND Yes
P33 5V Yes
P34 3.3V Yes
P35 Mower motor RPM Yes
P36 Reserved Yes
P37 Mower motor No
P38 Reserved Yes
P39 Reserved Yes
P40 User switches Yes
P41 Rain sensor Yes
P42 Charging pins Yes
P43 Battery (24V) No
P44 Wifi module (ESP8266) Yes
P45 Reserved Yes
P46 Reserved Yes

Power supply

Please also read the section 'Voltages' under Motor driver for more information on motor voltages.

It is recommended to use a voltage step-down converter (e.g. module using LM2596) to generate the 5V voltage for the Arduino and all additional modules. Before connecting, set the voltage of the converter to 5V.

Warning.pngWarning : never connect more than 5V on the Arduino 5V pins, or you will damage the Arduino. Therefore, always measure the 5V voltage before connecting it to the Arduino 5V pin! All components together (as shown in the schematics) need about 5W power.

Download and flash Arduino code

NOTE: If you have never worked with Arduino before, read our 'Arduino first steps' introduction.

You have two options:

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).

Warning.png 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

Warning.pngSecurity 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:

  1. Time of state machine's state (ms)
  2. loop()-counts per second
  3. choosen Verbose-Mode (0=counter readings/1=current values/2=current values)
  4. current state machine state (FORW, REV, ROLL etc.)
  5. drive home? (1/0)
  6. "spd" - Control/speed motors: left (PWM), right (PWM), mower (RPM)
  7. "sen" - Current limit exceeded counter motors: left, right, mower
  8. "bum" - bumper counter: left, right
  9. "son" - Ultrasonic-distance threshold exceeded (counter)
  10. "pit/roll" - Tilt (computed by acceleration sensor)
  11. "com" - compass course
  12. "per" - Perimeter loop detected: counter
  13. "bat" - Battery voltage
  14. "chg" - Charging current

Using the key 'v', you can toggle between sensor trigger counters and current sensor values.

Warning.png 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.

Further links