Thursday, June 14, 2012

Towel Build and Parts

The Towel is a simple RC delta wing poularized by Brooklyn Aerodrom and MAKE Online. It is a simple build for under $100 that should allow flight in only a few hours work. I stumbled across HobbyPartz.com which has amazing deals on robotics, RC and hobby electronics parts.

The following parts are either on their way for my Towel build or worthy of mention: 


  • 2.4G FlySky 6-Channel TX/RX Combo for $33 [[ Here ]] 
  • 2.4G FlySky 6-Channel Receiver for $9 [[ Here ]] 
  • Brushless Motor (KV 1300) + 18A ESC + 3 x 9g Servos for $25 [[ Here ]] 
I will post as progress is made. However, research will not let that happen anytime soon...

Tuesday, June 12, 2012

AI Battle Challenge

Two Georgia Tech students are developing AI challenge platforms similar to the Google AI Challenges. This site will serve as online documentation of the development process as well as a resource for the AI challenge participants.

Look for games like:

  • Battleship
  • Minesweeper
  • Mancala
  • Pong

Check it out

Saturday, June 9, 2012

Lizz's Calculator - Software Update

Reminder
As a reminder, I am building a custom calculator with an Arduino as a brain. This will use four linear time algorithms for pre-parsing the equation and a context free grammar to define valid syntax with a recursive descent parser to evaluate the equations. Note that each time the application is redesigned I am changing the version numbers so that I can more easily compare my documentation. Version 0.1 is implementing recursive pre-parsing and currently ignoring high precision requirements* for fast development and greater overall simplicity.

*This can (semi-)easily be fixed later using 3rd party libraries or implementing a custom library which implements big_floats by keeping track of a numerator and denominator, each in scientific notation.

Pre-Parsing
The pre-parsing code is complete, tested and committed to the repository.  The following algorithms serve to sanitize the input; ensuring the syntax passed to the recursive descent parser can be parsed by the grammar efficiently and accurately. The pre-parsing process is completed as follows.

  1. Parses a string (char*) and convert each equation element to a node inside a doubly linked list. Each number is parsed and converted to a float, each multi-character operation is converted to a single node with an identifying character e.g. SIN(...)->'s', LOG(...)->'g', etc. . 
  2. Once the equations is parsed into a linked lists, an algorithm uses a stack to ensure parentheses matching. While performing this check, an instance variable in each node containing a parentheses is set to specify its corresponding parentheses. 
  3. A third algorithm is used to surround each argument of two-argument operations with parentheses if necessary. This is done recursively keeping track of the insert position of the left parentheses and searching for operations to specify the position for the closing parentheses e.g. '+', '-', '*' and '/'. To ensure correct order of operations, this parsing is done on addition and subtraction, then re-evaluated on multiplication and division. Note that this step is not required for exponents or single argument operations e.g. SIN, COS, etc. . The algorithm includes checks to avoid duplicate or nested parentheses using the "match" instance variable, set in step 2, in each node containing a parentheses e.g. avoid "((3))+((4))".
Current UML
This will grow quickly as hardware is added; the project is still pending 128x64 pixel display, 5-bit 30-button array and power management including power button and low power state.



Evaluating The Equation
The current grammar is currently being redesigned as an LL(1) or LL(2) context free grammar. The current grammar is far too ambiguous to evaluate equations efficiently. I will post updates as progress is made, but I have multiple large research deadlines approaching in the next two weeks.

Friday, June 1, 2012

Lizz's Calculator - Build Update

This is an update from the previous design post which can be found here.

Software:

The code repository can be found here. All information found in updates on this blog will also be included in the README file for proper documentation. An old version or the parser which linearly parses the equation. This was originally written for a 32-bit PIC chip.

Electronics:

Recall that I had the "complexity" requirement (look as crazy as possible, with wires everywhere!). I think it is working out nicely. The schematics can be found on the design post linked above.







Lizz's Calculator - Design

My girlfriend just graduated from Georgia Tech as a math major. So obviously, she wants a custom calculator for her birthday...

I am planning to design and build a calculator in multiple versions which will have the functionality of a scientific calculator in v1 and a rudimentary graphing calculator in v2. This blog will chronicle the design and build process of Lizz's calculator with an Arduino as the brain.

Functionality (v1)

  • Order of operations including parenthesis
  • Algebra and geometric functions
  • High precision (more accurate than double precision)

Design

Software

The calculator will use a recursive descent parser with 3 stages of pre-parsing to validate and evaluate complex equations. The following context free grammar will define the language of valid equations:


    <S>     : <ex>
    <ex>    : (<ex2>) | <ex2>
    <ex2>   : <arg> | <op2> | <op1>
    <op2>   : <ex> <_op2> <ex>
    <_op2>  : + | - | * | / | ^
    <op1>   : <_op1>( <ex> )
    <_op1>  : SQRT | LOG | LN | <geo>
    <geo>   : <geo2> | ARC<geo2>
    <_geo>  : SIN | COS | TAN
    <arg>   : <num> | <num>.<num> | <const>
    <num>   : [0-9]+
    <const> : E | PI

The pre-parsing processes is defined as follows:

   Pre-Parse Rules:
   ----------------
    1. Surround all { +, - } args with ()'s recursively
        e.g. 8*3^4+PI => (8*3^4)+(PI). Note that recursion
        is used inside other sets of parentheses.
    2. Surround all { *, / } args with ()'s recursively
        e.g. (8*3^4)+(PI) => ((8*3)^4)+(PI). Note that recursion
        is used inside other sets of parentheses.
    3. Remove all unessary parentheses e.g. ((3+4)) => (3+4).
        These will cause a parsing error.
   
   NOTE: that these techniques are used to ensure order of 
   operations. The parentheses force the correct order of 
   operation when using the grammar above i.e. respect user 
   parentheses by using recursion, respect exponents by not 
   surrounding with parentheses, respect *,/ then respect +,- by 
   order of adding extra parentheses.



The software architecture is a simple recursive descent parser.



Electronics

The electronics will use an ATMEGA328 processor (Arduino UNO) for computations. One odd requirement for electronics design is that my girlfriend wanted the calculator "to look as crazy as possible, with wires everywhere!". So, I am make the design a little diluted and more complicated than necessary, hence me building my own 30 button array and 30:5 bit encoder. See schematics and block diagrams below