* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download MINIORE Hardware Description - Ottawa Robotics Enthusiasts
Audio power wikipedia , lookup
Ground (electricity) wikipedia , lookup
Stepper motor wikipedia , lookup
Electric power system wikipedia , lookup
Electrification wikipedia , lookup
Power inverter wikipedia , lookup
Electrical substation wikipedia , lookup
Distribution management system wikipedia , lookup
Three-phase electric power wikipedia , lookup
Power engineering wikipedia , lookup
Power over Ethernet wikipedia , lookup
Voltage regulator wikipedia , lookup
Stray voltage wikipedia , lookup
Amtrak's 25 Hz traction power system wikipedia , lookup
Surge protector wikipedia , lookup
History of electric power transmission wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Power electronics wikipedia , lookup
Power MOSFET wikipedia , lookup
Variable-frequency drive wikipedia , lookup
Buck converter wikipedia , lookup
Alternating current wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Voltage optimisation wikipedia , lookup
Opto-isolator wikipedia , lookup
MINIORE HARDWARE DOCUMENTATION v1.0 INTRODUCTION In 2003, the Ottawa Robotics Club (ORE) put together a robot controller board (IgORE) designed around the Microchip PIC 16F877. It was designed as a complete controller solution, including motor driver, light sensors, LCD port, on-board voltage regulation among other features. Later that year a second revision of that board (IgORE2) was done to make it even more full powerful and easy to use. Both boards were very successful at the time. In 2005 I decided to re-spin the IgORE board to use a smaller device and surface mount components but still retain many of the features of the original boards. After a few weeks of work, MiniORE was born. The original MiniORE was intended for my use only, as I thought a surface mount design might scare off many of the group members. After some prodding, I relented and revamped the board to be a little more user friendly as well as fix a few bugs that I had missed in the original design. Thus, version 1.4 of the MiniORE board came to be. This document will describe the hardware features of this board design. It is intended as both an overview as well as a in-depth look at the various connectors available on the board and how they can be used in practically any robot design. MINIORE HARDWARE FEATURES MiniORE is a 2-layer design, with chips mounted on both top and bottom of the board. It is based around the Microchip PIC18F2620 controller. The board is very full featured: 64k of program memory 4k of internal ram 1k of internal eeprom Up to 128k of external eeprom on-board 2 full h-bridges for driving two motors RS232 level translator for serial communications with PC dual on-board regulators to separate logic and peripherals 2 i2c connectors two servo connectors 2 bumper I/O (digital) 3 ground IR connectors (analog) 2 sharp IR distance sensors inputs (analog) in-circuit debugging header an addition 7 general I/Os (mix of analog and digital) for general use On-board push-button switch (for reset or general use) status led (for general use) All in a 2 inch by 2 inch board. Page 1 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Of course, not all the I/O is dedicated to one particular task. For example, what I label as two servo connectors can just as easily be a pair of I/O with GND and power pins. I've just placed the I/O in a convenient placement so that typical sensors or devices can easily be connected. A servo connector just plugs into the board, no messing around. HARDWARE DESCRIPTION AND OVERVIEW Given that this is such a compact board, the I/O is very close together and there wasn’t enough room on the board to document the board on the silkscreen fully. Because of that fact, you may find that you have to refer back to this documentation until becoming fully familiar with the board. Figure 1 – Parts placement TOP (left picture) and BOTTOM (right picture) The majority of the components are placed on the top of the board. The only exceptions are both of the 5 volt regulators, the MAX3232 level translator chip, the I2C EEPROM, and a few capacitors. The microcontroller is placed in the centre of the board and the I/O is spread out from it to the edges of the board. The board takes two power supplies, one for the logic and one for the motor controller. If the robot power supply only has a single power source, the same supply can be fed into both inputs. A DPST (double pole, single throw) switch powers up the logic and motor voltages at the same time. The logic power supply is optionally regulated by REG1 and then is fed into the microcontroller, RS232 chip, I2C EEPROM and the logic section of the H-Bridge. The motor voltage is fed to the power section of the H-Bridge and is optionally regulated by REG2. The output of REG2 is then used to power the servo and sharp sensor ports. The 18F2620 microcontroller either uses an internal 8MHz (2 MIPS) or 32MHz clock (8 MIPS) or an optional resonator source. Using the external clock source means that the chip can run up to 40MHz (10 MIPS), but also means that the servo I/O ports are no longer available. I recommend using the internal oscillator source as I have found it to be Page 2 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 very stable. As the microcontroller is a surface mount device, this means that it must be programmed in-circuit. A programming header is provided (labeled ISP) and a programmer design is available for anyone who needs it. The recommended method of using MiniORE will be to initially program a bootloader into the device and then do all in-circuit programming through the RS232 port (J8) from a PC. This eliminates any extra hardware in order to work with the board. In-circuit programmers will be available at the monthly ORE meetings in order to initially program the bootloader into the chips. The recommended bootloader either JOLT ( http://mdubuc.freeshell.org/Jolt/ ) or COLT ( http://mdubuc/freeshell.org/Colt/ ) by Martin Dubuc. I/O PORT DESCRIPTION RS232 INTERFACE A MAX3232 RS232 level translator chip is connected to the hardware UART on the microcontroller. This allows easy communication with a PC as well as other devices. The MAX2322 device (U1) is mounted on the bottom of the board along with 5 capacitors (1 bypass cap and 4 caps for the charge pumps). The PC side of the connection is brought out to a three pin header (J8). The silkscreen has TX and RX silk-screened on it, in relation to the PC side of the connection. The third pin (centre) on this header is a common ground connection. Figure 2 – RS232 Hardware Interface A special serial cable must be built in order to use this port. If you cut a 9 pin serial cable, pin 2 of the cable should connect to the RX pin on the board, pin 3 of the cable should connect to TX on the board and pin 5 of the cable should connect to the centre pin on the header (GND). This header is intended primarily for use as a bootloader port when uploading new code and for a debug port when writing new robot software. Page 3 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 3 – RS232 Schematic The design is pretty basic. The only catch with it is the use of 0402 capacitors instead of the 0603 caps used everywhere else on the board. The space was tight so I had to drop the size down around this chip. I’ve found that I’m actually able to solder 0603 chips into the 0402 pads that Eagle (the layout program used for this design) uses. POWER SUPPLY Figure 4 – Power Hardware Implementation The MiniORE board has separate power terminals for Logic and Motor/Peripheral voltages. The Logic supply is connected to the terminal labeled VPIC (to the left of the power switch). The Motor/Peripheral supply is connected to the terminal labeled VMOT (to the right of the power switch). This is done to isolate the PIC power supply from noise Page 4 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 that may be generated either by the motor or other noisy devices (servos for instance). If the robot has a single power supply, it should be connected to both terminals (VPIC and VMOT). In practice, this will work the majority of the time anyhow (and is actually how I’m running it on my MiniORE sumobot). The power switch controls both VPIC and VMOT voltages. In the off position, both voltages are disconnected from the board. In the on position, both voltages are connected to the board. When the power is switched on, the PWR LED (LED1) will light. The onboard voltage regulation is optional on both supplies. If on-board regulation is used on the Logic voltage (VPIC), the input voltage must be at least 5.15V at the terminals. 4 AA alkaline batteries will easily supply this voltage. 5 or more NiMH batteries will also work in this mode. Logic voltage regulation is selected by placing the jumper on J1 in the 1-2 position (marked by bars on the silkscreen). This is the normal mode of operation. Maximum current draw from the MIC5209 regulator is 500mA. This voltage appears at a few headers and could be potentially used to power external circuitry as long as the external circuitry draws less than 400mA. If the user wished to provide 5V from an external source to the board, the jumper can be placed in the 2-3 position (the 2 pins closer to the power switch). In this mode, the voltage at the supply terminals is supplied directly to the logic devices on the board. Be careful in this mode, as it is possible to damage the board if a voltage larger than 5V is supplied to the board. This mode is useful when powering a robot from 4 NiMH batteries (4.8V). The logic chips on the board will all run at 4.8V, so it saves 1 battery on a smaller robot design. Figure 5 – Voltage Regulation Schematic The Motor voltage is supplied directly from the VMOT terminal. Note that the L293D hbridge used has a voltage drop internally and will drop roughly 1.5V before this voltage reaches the motor. Page 5 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 This power input is also used to power several of the I/O ports on the board. This gives the user the ability to drive servos and other devices without causing noise or supply issues on the logic supply lines. This voltage can optionally be regulated. VMOT voltage regulation is selected by placing the jumper on J7 in the 1-2 position (marked by bars on the silkscreen). In this mode, the VMOT voltage must be at least 6.2 volts in order to draw maximum current from the LM1117 regulator. This is the normal mode of operation. Note that this does not regulate the voltage going to the motors, only the voltage going to some of the headers on the board (this voltage is labeled 5V_IR on the schematics). This voltage is driven to the Sharp IR headers and the Servo headers. Maximum current draw from the LM1117 regulator is 800mA. If voltage regulation is not required, the jumper on J7 can be placed in the 2-3 position (the two pins closer to the PIC). In this mode, the input VMOT voltage will be driven to the servo and Sharp IR sensor ports. Again, in this mode, an over-voltage supply can cause damage to external components so be careful. H-BRIDGE Figure 6 – H-Bridge Hardware Implementation The L293D H-Bridge is used. This H-Bridge is able to drive two motors and can supply 600mA continuously to both motors. It accepts a motor voltage supply of between 4.5V and 36V. This voltage is supplied from the VMOT header, and is switched via the main power switch. The H-bridge is connected to the CCP1 (pin C1) and CCP2 (pin C2) ports on the PIC processors as well as two general I/O lines (pin C0 and C5). The CCP ports are used to generate a PWM signal which controls the speed of the motors attached to the H-Bridge and the general I/O lines are used to control the direction of the motor. The PWM rate going to the L293 is typically less than 5kHz. Motor 1 (labeled M1 on the silkscreen) is controlled with C1 (PWM) and C0 (direction). Motor 2 (labeled M2 on the silkscreen) is controlled with C2 (PWM) and C5 (direction). Page 6 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 7 – H-Bridge Schematic If more current than 600mA is needed, multiple L293D chips can be stacked on top of themselves (within reason). EXTERNAL I2C EEPROM Figure 8 – I2C EEPROM Hardware Implementation Page 7 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 The 18F2620 processor is quite capable, with 1k of EEPROM available to store any data which may need to be saved when the power is turned off. There are cases when this may not be enough (storing audio for instance). In these cases, an external I2C EEPROM is available on the board. Depending on the device populated, this external memory can be up to 128kbytes. The typical case is a 24LC256 device (32kbytes). If a 24LC512 (64kbytes) or 24LC1025 (128kytes) is required, the leads on the package must be bent slightly inwards in order to fit on the pads of the board (the 64k and 128k packages are slightly wider). Figure 9 – I2C EEPROM Memory Expansion Schematics The address of the EEPROM is set to 0x50 (A0,A1,A2 all set to 0), and write protect is disabled. I2C EXPANSION PORTS Figure 10 – I2C Ports Hardware Implementation Page 8 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 The I2C bus is a very flexible 2 wire serial bus. Up to 127 (typically) can connect to a single I2C bus, which means that it is an excellent means of expanding a robot design. For example, multiple SRF10 ultrasonic sensors (http://www.robotelectronics.co.uk/htm/srf10tech.htm) could be connected to the MiniORE using a single pair of I2C lines. The MiniORE design provides two I2C headers. These headers connect to the same I2C bus, but there are two headers in order to ease connections. The pinout of the headers follows the same convention as the sensors at Robot-Electronics (formerly Devantech) as these are some of the most common components on the I2C bus. Figure 11 – I2C Expansion Bus Schematics The I2C bus could also be used to connect multiple MiniORE boards together in order to run a small parallel processing array on a robot. This is actually a useful thing to do. It can be much easier to write code for multiple boards than it is to try to multitask a bunch of time-critical jobs on a single processor. Page 9 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 SERVO PORTS Figure 12 – Servo Ports Hardware Implementation The MiniORE board is designed to drive two servos directly. The power for the servos is either provided from VMOT or from VMOT regulated through REG2. A jumper on J7 selects whether the power is regulated or not (position 1-2 on J7 = regulated). See the power section of this document for more details on this. A pair of 1uF capacitors provides filtering. The servo control lines are driven from A6 and A7 on the microcontroller. These lines are labeled SERVO1 and SERVO2 on the schematics. These pins are multiplexed with the optional resonator. This means that the servo headers are not available if the resonator is used. Figure 13 – Servo Header Schematics A common use for the servo header may be a servo to position sensors, such as sweeping an ultrasonic sensor back and forth in front of the robot. Another common use is for actually moving the robot. Servos can be modified so that they spin 360 degrees and then Page 10 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 provide the drive for the robot. This modification is detailed on the Seattle Robotics website (among other places): http://www.seattlerobotics.org/guide/servohack.html These two headers can also be used as general digital I/O if the robot design does not require servos. The power supply powering this header can supply up a maximum of 800mA. SHARP IR SENSOR PORTS Figure 14 – Analog Sharp Sensor Hardware Implementation The GP2D12 Sharp analog IR range finders (also called AIRRS) are a very common sensor used in robots. These sensors provide a voltage output which is relative to any objects in front of it, up to 80cm. Sharp also has other IR sensors, some of which range up to 150cm. The MiniORE design provides two inputs for these sensors. The power for the servos is either provided directly from VMOT or from VMOT regulated through REG2. A jumper on J7 selects whether the power is regulated or not (position 1-2 on J7 = regulated). See the power section of this document for more details on this. A pair of 10uF capacitors provides filtering. These analog inputs are connected to A3 and A5 on the microcontroller. These lines are labeled SRP_IR1 and SRP_IR2 on the schematics. Page 11 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 15 – Sharp IR Analog Input Schematics These two headers can also be used as general analog or digital I/O if the robot design does not require Sharp distance sensors. The analog inputs can read between 0 and 5 volts. The power supply powering this header can supply up a maximum of 800mA. GROUND IR SENSOR PORTS Figure 16 – Ground IR Hardware Implementation A very common sensor on robots is a downward facing IR sensor. This sensor can be used to simply detect the ground (or absence of it), or can be used to detect lines (basically a dark or light detector). These types are sensors are build using an IR transmitter and an IR receiver. Based on the amount of reflected IR, a decision on what the ground under the robot looks like can be made. Page 12 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 17 – Ground IR Schematics BUMPER PORTS Figure 18 – Bumper Port Hardware Implementation Bumpers are your robots last line of defense before everything goes terribly wrong. Even robots with more sophisticated methods of detecting obstacles should have a bumper system on them. Cameras, ultrasonic sensors, IR sensors, etc, all can give false results and cause your robot to make bad decisions. A bumper is rarely wrong. The circuitry for the bumpers headers on MiniORE is basic. A digital I/O line pulled low with a large resistor and is connected to a two pin header. The other side of the header is Page 13 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 pulled high. The bumper is assumed to just be a switch that connects the two sides of the header together when something is touched. Reading the digital I/O when nothing is being touched will result in a low reading. When the bumper is active, the I/O will read a high. Figure 19 – Bumper Port Header Schematics There are two bumper headers available to the user. GENERAL I/O PORT Figure 20 – General I/O Hardware Implementation There are 5 general I/O brought out to header J9. The header contains GND and an unregulated power supply. This header is primarily intended for a future expansion board for MiniORE although it can be used for any purpose in the meantime. Page 14 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 21 – General I/O Header Schematic If the servo ports are used as digital I/O, then the general I/O on this port must be used as digital I/O also. If the servo ports are set as analog inputs, then the pins on this port can be used as any combination of analog inputs and digital I/O. IN-CIRCUIT PROGRAMMING PORT Figure 22 – In-Circuit Programming Header Hardware Implementation The surface mount processor used in minore must be programmed in-circuit. Initially this is accomplished through the ISP port (J3). If a serial bootloader is loaded through this port, then all future code loaded into the MiniORE board can be done through the RS232 header (J8). Once the code is loaded, this port can be used for other purposes. It contains 4 general I/O pins as well as regulated logic power and ground. Keep in mind that two of the I/O pins are shared with the bumper port. If the bumper port is used, this leaves two pins for general use. Page 15 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 23 – In-Circuit Programming Header Schematic ON-BOARD LED AND PUSH BUTTON Figure 24 – Push Button and LED Hardware Implementation The MiniORE board contains a general purpose LED and a push button that can be used as a reset button or a user input. The LED is turned on by setting pin RA4 high and turned off by setting RA4 low. Whether or not the push button is used for reset or general input is controlled by the PIC configuration word during programming. The default configuration is to use it as a reset button. Page 16 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 Figure 25 – Push Button and LED Schematic Page 17 of 18 MINIORE HARDWARE DOCUMENTATION v1.0 BOARD SIGNAL MAP Page 18 of 18