Code Monkey home page Code Monkey logo

robotbuddy's Introduction

robotbuddy

C code + extra tools for a TI MSP430-based self-balancing robot. (We used an MSP430G2553)

C Code

All MSP430 code is located inside the robot folder

Extra tools

By default, the C code provided will use pins 1.1 and 1.2 for UART over the MSP430G's USCI hardware interface. To use this feature, make sure to rotate the jumpers as shown on this page. The code will send both the current angle estimate and the PID output as binary data over the UART interface. This data can be captured over USB using the provided python script serialReader.py (which relies on the PySerial library), and optionally its accompanying angleGui.py (which relies on PyQt4 and PyOpenGL). To command-line syntax for this tool is as follows:

python serialReader.py [-h] [-o OUTFILE] [-d DEVICE] [-r RATE] formats
  • OUTFILE is the name of a CSV file where the recorded data will be dumped (and overwritten if it already exists)

  • DEVICE is a number specifying the COM port of the robot (in Windows, at least, this can be gleaned from the device manager under 'ports').

  • RATE is the baud rate of the communication channel. By default this will be 9600.

  • FORMATS is where this gets even more fun (I know, as if!). This should be a string, taking one of the following forms:

    • raw Specifying "raw" can be used for debugging, as it will capture the data being transmitted, byte by byte, and print out the hex in neat little columns.
    • gui This option is specifically configured for the default setup, and is used to graphically display the robot's current angle estimate. It's great for testing out different filters or filter parameters.
    • The last option is a list of struct formats, seperated by comma. This form can be used to interpret raw bytes sent over from the MSP430, and then formatted as a CSV for post-processing. For instance, h,h,h,f is three shorts and a float per row. This would correspond to the MSP430 sending 3 16-bit integers and a 32-bit float in some sort of a loop.

    Schematic

    This schematic shows our setup and pin locations, but of course there are many possible configurations (and probably better H-bridges) that could be used. Example schematic

robotbuddy's People

Contributors

austensatterlee avatar tarunc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.