Hardware design is almost done! Here's a link to the first version of the board that will sit onboard the Roomba:
http://sites.google.com/site/zambots/project-files/MCU_boardandProgrammer.pdf?attredirects=0&d=1
And here's how it works:
- Code for controlling the Roomba and distance sensor is written in C on a computer. This is converted into hex and sent via serial to the programmer. For this step, a serial cable must be connected between the computer and circuit board.
- The programmer is a set of hardware the allows for programming of the Microcontroller (MCU). It must hold the high voltage (MCLR) pin to between 9 and 13.5V, and then apply a clock signal and a synchronized data stream to the PGC and PGD pins on the MCU. The data stream contains the code to be executed.
- Once programming is done, the serial cable can be disconnected. When the programming is finished, the MCLR pin is held at 5V using a diode, and now acts as a reset switch (if pulled down to ground).
- Power for the MCU and associated devices comes from the Roomba battery. This is an unregulated 15V, and 3 different voltages are needed on this board (3.3, 5, and 12). This is accomplished through the use of 3 voltage regulators.
- Note that during programming, there is another set of voltages on the board. This is because the serial voltages are somewhere around 7.5V, which could damage the MCU. This motivated the use of opto-couplers, so that the serial voltages and its ground (from the computer) is kept separate from the MCU voltages and their ground (from the Roomba).
- The MCU collects distance data from the ultrasonic sensor at scheduled intervals. To do so it sends out a short pulse, and then waits to receive a pulse corresponding to the distance to the nearest object in the direction pointed. Directions will be calculated from wheel encoders, already integrated into the Roomba platform.
- The MCU also communicates with the Roomba. This is done through the UART. First a device detect pulse series is sent. Then serial communications can be sent. Instructions tell the Roomba to use its motors, LEDs etc. or to return sensor data packages.
- The MCU also communicates with the Arduino through the XBee module. This is done through the UART also. However the XBee operates on 3.3V, while the MCU operates on 5V. The 2 NPN transistors between the XBee and MCU are for level shifting the transmission voltages to avoid problems.
- In order to allow both Arduino and Roomba to communicate with the MCU via a single UART, a MUX/DEMUX chip facilitates communications. 2 control lines from the MCU can select which communication channel is open for transmission or receiving.
Design is one thing, practicality is another. Hope to be testing this in the next couple weeks, and I'm sure at that point I'll make some modifications to the board. Once this is working, I plan to post my BOM too, with digikey part numbers for all the electronics and suggested retailers for the rest.
-Mike
No comments:
Post a Comment