Sunday, May 16, 2010

Schematic V1.0

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


Or for a less technical view, here a block diagram of the same system. Solid lines are signals and dotted lines are power connections.


And here's how it works:


  1. 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.
  2. 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.
  3. 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).
  4. 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).

  5. 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.
  6. 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.
  7. 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.
  8. 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