Ardumower PCB: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(PCB 1.0 prototype, jumpers)
(PCB 1.0 prototype, jumpers)
Zeile 75: Zeile 75:
 
! Comment
 
! Comment
 
|-
 
|-
| Integrated LM350T charging control
+
| Integrated LM350T charging control (recommended: NO)
 
| D7: DIODE
 
| D7: DIODE
  
Zeile 81: Zeile 81:
  
 
C1, C4, U4, RV1: used
 
C1, C4, U4, RV1: used
|(recommended)
+
|D7: SHORT-CIRCUIT
D7: SHORT-CIRCUIT
+
  
 
D3: SHORT-CIRCUIT
 
D3: SHORT-CIRCUIT
Zeile 89: Zeile 88:
 
| Do not use if using external battery charger
 
| Do not use if using external battery charger
 
|-
 
|-
| External power while charging  
+
| External power while charging (recommended: NO)
 
| JP6: CLOSE
 
| JP6: CLOSE
  
Zeile 97: Zeile 96:
  
 
C5: not used
 
C5: not used
|(recommended)
+
| JP6: OPEN
JP6: OPEN
+
  
 
JP7: CLOSE
 
JP7: CLOSE
Zeile 107: Zeile 105:
 
| Use to power your PCB from externally (disconnect battery from PCB) while charging
 
| Use to power your PCB from externally (disconnect battery from PCB) while charging
 
|-
 
|-
| Arduino controlled charge relay
+
| Arduino controlled charge relay (recommended: YES)
| (recommended)
+
| JP4: CLOSE
JP4: CLOSE
+
  
 
JP5: OPEN
 
JP5: OPEN

Version vom 12. Februar 2015, 22:32 Uhr

Abstract

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

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

Needed parts

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

  • Main functions
    • Arduino cable (female-female and male-female jumper cable)
    • 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)
    • 1 x Arduino Nano
    • 1 x DC voltage step-down module (LM2596)
    • 1 x MC33926 motor driver module
  • Perimeter receiver (optional)
    • 1 x Arduino Nano
    • 1 x LM386 amplifier module
    • Capacitor (1 x 4,7nF), 1 x Receiver coil 100mH
  • Additional modules
    • 1 x HC-SR04 ultrasonic sensor module (optional)
    • 1 x GY80 module (gyro, accel. compass) (optional)
    • 1 x DS1307 realtime clock module (optional)
    • 1 x Bluetooth module (for phone control)

Schematics

A schematics says more than a thousand words...

Click here for latest SVN version (PDF): https://ardumower.googlecode.com/svn/trunk/pcb/megashield_svn_0.5/ardumower%20mega%20shield%20svn.pdf

KiCad Files are in the SVN

PCB assembly

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

  • PCB dimensions 241x114mm
  • All used modules are available in the Ardumower shop
  • Uses the Arduino Mega 2560 (and via adapter the Arduino Due)
  • All connections are available on connectors as well as +5V and GND

Click here for photos: https://code.google.com/p/ardumower/source/browse/trunk/pcb/#pcb%2Fmegashield_svn_0.5%2FPlatinenbilder

More photos to come...

PCB 1.0 prototype, jumpers

Feature used YES NO Comment
Integrated LM350T charging control (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.

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.5.6-r2 or above AND select the right Board (Mega 2560 or Due).

Warning.png Note: Always verify that the pin configuration in your Arduino code (config.h/mower.cpp) matches your actual circuit!


SVN version download steps:

First-time calibration

Wheel motors

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

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

Now, press the key ‘t’ on the keyboard, and confirm using ENTER. The diagnostic mode should appear, and you can test your motors.

ADC calibration

Run the ADC calibration once (either via serial console or "pfodApp->ADC Calibration"), so that the received signal is symmetric around zero.

Diagnostic

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.

Additionally, you can use pfodApp (Android) to plot the sensors (trigger counters and current values) over time:

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

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.

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.

Config files

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:

Example:

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:

setActuator(ACT_MOTOR_LEFT, 100)

The actual config file will execute this command by calling the specific motor driver:

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

pfodApp

The configuration of the robot mower can be set via Android phone (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