?? readme
字號:
$Id: README,v 1.10 2003/09/13 07:16:03 dwalters Exp $-- Open Automaton Project: http://oap.sourceforge.net -- DOCKING STATION INTRODUCTION----------------------------This README covers the source code and circuit schematics for the Open Automaton Project Docking Station.The Docking Station is a hardware device that provides an external power sourceas well as a battery charging power source for the robot when "docked". The PICMicro in the Docking Station turns on the external power source and chargeronly when signaled to do so by the robot itself via an infrared signal emittedfrom the Power Management Module (PMM) on board the robot. When the robot is not docked, the docking station power supply and charging contacts are kept insafe mode (open circuit).The circuit schematic (docking_station.sch) was developed in gschem, partof the gEDA package, version 20030525.Circuit schematic symbols that are not in the symbol library bundled with gEDAare included as separate sym files (these .sym files can be copied into yourlocal symbol directory, typically /usr/local/share/gEDA/sym/local/).LICENSING---------All source code and electronic circuit designs are copyright (C) 2003, Dafydd Walters.The Open Automaton Project software is distributed under the terms of the GNUGeneral Public License. See the file COPYING.SOFTWARE for details.Please see the file COPYING.ELECTRONICS to see the terms under which theelectronic circuit designs of the Open Automaton Project are distributed.CIRCUIT NOTES-------------The circuit treats two of its components, the 12V 4.5A DC Power Supply, and the12V 4A Smart Fast Sealed Lead Acid Battery Charger, as "black box" components.These are "off-the-shelf" modules.* 12V 4.5A DC Power Supply This takes 120V or 240V AC input, and outputs 12V DC at up to 4.5A. The unit must output a regulated supply in the range 11.4V to 12.6V. The power supply unit that's bundled with the Morex DC to DC converter is suitable.* 12V 4A Smart Fast Sealed Lead Acid Battery Charger This takes 120V or 240V AC input, and outputs a charging voltage suitable for fast charging, and then trickle/float charging a 12V sealed lead acid battery. This assumes that the robot's battery is capable of handling a charging current of 4A. A suitable charger is the PSC-124000A by Power-Sonic.The battery charger typically requires that the battery being charged is not loaded during charging, and that the charger is hooked up to the batteryterminals before the charger is powered up. For this reason, the sequence ofrelay switching on the Power Management Module (on board the robot) and theDocking Station module must be properly choreographed by the twomicrocontrollers.The Docking Station responds to commands beamed to it from the Power Management Module on board the robot via infrared. The Sony infrared remotecontrol protocol is used in an adapted form (refer to the Input Module documentation and source code comments for more complete details).The IR detector is a 3-pin device designed to operate with a 5 volt supply.It gives a Low output signal when IR energy (at around 940nm wavelength) isdetected that's being pulsed on and off at a frequency of 40kHz. When there is no IR energy present, or there is IR energy present, but it is not being pulsedat or near the detection frequency of 40kHz, the output signal is High. The circuit has been tested with the IR detectors available from Radio Shack (RadioShack part number 276-137B).The lower 8 bits of the command code used in the Sony IR Protocol are interpreted as follows: 11100001 - turn on external power source relay 11100010 - turn on charger relay (external power must already be on) 11100100 - "ping"; lets docking station know that robot is still there 11100101 - turn off charger relay 11100110 - turn off external power source relay (turns off charger if not off)These command codes are different from those output by appliance remote controls, so the docking station module will not respond to stray IR signalsfrom nearby remotes. Note that the source code comments in docking_station.asm contain command codesTHAT DO correspond to Sony TV remote codes, which can be used as substitutes for the above PMM commands for the sake of testing with a TV remote control (without the PMM).As a safety measure, the robot must "ping" the docking station at least once every minute to keep the relays engaged (a kind of watchdog timer). If no "ping" command is received after one minute, the charger power and externalpower relays are turned off.The firmware enforces a 30 second minimum time between switching the chargeroff and on, essentially "buffering" any pending 'on' command received within 30 seconds of an 'off' command. This is to ensure that the charger resets cleanly when powered up and goes into the correct charging state. The yellowLED flashes during this "pending charging" state, and changes to constanton once the 30s timeout has elapsed.The firmware also enforces the rule that the external power relay must be onany time the charger is turned on. The reason for this is that the robot's mainboard cannot take its power from the battery during charging, as this wouldput a load on the battery, so the external power source is always needed whilecharging.The LEDs on the docking station module signal the following states: - Both off: Both relays off, all docking station contacts safe. - Green on: External power supply live. Charger off. - Flashing Yellow: External power supply live. Charger currently off, but will be switched on within 30 seconds. - Yellow on (constant): Both external power supply and charger contacts live.When assembling this circuit, it is essential to use heavy gauge wiring andwide circuit board tracks for all of the 12V DC and GROUND runs. This is because of the high currents drawn (up to 5 Amps). Thin wires will get hotand will cause undesirable voltage drops, not to mention that inadequatewire gauge for these kinds of currents is a potential fire hazard.FIRMWARE NOTES--------------The software for the PICMicro is written in assembly language, and compiles using the GNU PIC Assembler, gpasm. To compile the source code into a hex file suitable for programming a PIC16F819 device, type gpasm -n docking_station.asmThe resulting hex file will be called docking_station.hex The -n option puts DOS-style CR-LF newline sequences in the .hex file, required by most device programmers. It also compiles with the MPASM compiler for Microsoft Windows that is a partof the MPLAB suite from Microchip. However, you must make sure the assembly(.asm) file is in Windows/DOS format (i.e. with CR-LF sequences at the end ofeach line) before it will successfully compile in MPASM for Windows.Some device programmers require the configuration bits to be set manually. Itis very important that these are set correctly. The Docking Station modulerequires the following configuration bit settings: - Flash Code Protection off - CCP1 on RB3 - In-circuit Debugger disabled - Flash write enable off - EE Code Protection off - Low Voltage Programming Enable off, RB3 is I/O - Brown-out Reset Enable on - RA5/MCLR pin function is digital I/O - Power-Up Timer on - Watchdog Timer off - Oscillator: INTRC, port I/O function of RA6 and RA7The above configuration settings are represented by the configuration word2F50 in hexadecimal.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -