Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Teensy 3.0 + Free IMU?

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    6

    Teensy 3.0 + Free IMU?

    Hi all, first post here .

    I am planning a quadrocopter project, and have decided to use Teensy 3.0 as the brains of the quad, since it's much more powerful and capable than any other similarly-sized Arduino-esque microcontrollers I've found (Pro Mini, Pro Micro, Nano, etc...). Also, I just think the Teensy is a wonderful board and haven't gotten the chance to play with it yet, so maybe this will be a good opportunity. Also, my first quad project .

    I want to use the FreeIMU v0.4 board together with the Teensy 3.0. On the software side, I want to use the FreeIMU library designed for this board. I had come across this thread: http://freeimu.varesano.net/node/34 in which Fabio (designer of FreeIMU) and Paul discussed getting Teensy3.0 to work with FreeIMU, and from that I got the impression that the FreeIMU library would indeed work with Teensy 3.0.

    But I'm not sure, so I ask: Does Teensy 3.0 currently work with the latest FreeIMU library/software? As well as interfacing hardware-wise with the FreeIMU v0.4 board?

    And what if I instead use a different IMU board that's supported by the FreeIMU library?

    And how should I configure the FreeIMU library/software specifically for the Teensy?

    I know the best way to find the answer would be to pick up a Teensy and IMU myself, but I'm on a limited budget
    So hopefully someone here has experience with this.

    Thanks.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,478
    Yes, FreeIMU works well. You'll need R49, because the fixed for Teensy3 were never officially released before Fabio died.

    http://www.pjrc.com/teensy/beta/freeimu_trunk-r49.tgz

  3. #3
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Hi, I saw on another forum that you had achieved 1 kHz sampling with the Teensy 3 and the FreeIMU with the MPU6050? Would you possibly be able to share how you achieved it?

    I had attempted high sampling rates using a SparkFun breakout board that I had, but was getting invalid data in the FIFO, not sure if this was because the breakout had 10k resistors instead of the recommended 3k. Also, the FIFO was also overflowing at 1 kHz, which I had thought was due to the I2C speed (until I saw that you had done it).

    Thank you in advance for any help!

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,478
    I just ran the speed test example that comes with FreeIMU.

  5. #5
    Junior Member
    Join Date
    Sep 2013
    Posts
    18
    So, I've got the FreeIMU stuff working quite well with Teensy 2.0 and 3.0... As soon as I add WS2811 Led strip the IMU stops giving reliable data.

    This feels like a Timers issue. Any one have experience with this? I've tried the FastLED and NeoPixel Libraries for driving led strips.

    thanks!

    -matt

  6. #6
    Junior Member
    Join Date
    Sep 2013
    Posts
    18
    Here is the code Im testing with:

    #include <ADXL345.h>
    #include <bma180.h>
    #include <HMC58X3.h>
    #include <ITG3200.h>
    #include <MS561101BA.h>
    #include <I2Cdev.h>
    #include <MPU60X0.h>
    #include <EEPROM.h>

    //#define DEBUG
    #include "DebugUtils.h"
    #include "CommunicationUtils.h"
    #include "FreeIMU.h"
    #include <Wire.h>
    #include <SPI.h>

    #include "FastLED.h"

    #define SPINE_COUNT 30
    #define SPINE_PIN 6
    CRGB leds[SPINE_COUNT];


    #define LED 13



    int raw_values[9];
    //char str[512];
    float ypr[3]; // yaw pitch roll
    float val[9];

    // Set the FreeIMU object
    FreeIMU my3IMU = FreeIMU();

    void setup() {
    Serial.begin(57600);
    Serial.println("hi");

    FastLED.addLeds<NEOPIXEL, SPINE_PIN>(leds, SPINE_COUNT);
    Wire.begin();

    pinMode(LED,OUTPUT);
    my3IMU.init(); // the parameter enable or disable fast mode
    delay(5);
    }

    void loop() {

    digitalWrite(LED, HIGH);

    my3IMU.getYawPitchRoll(ypr);

    Serial.print("Yaw: ");
    Serial.print(ypr[0]);
    Serial.print(" Pitch: ");
    Serial.print(ypr[1]);
    Serial.print(" Roll: ");
    Serial.print(ypr[2]);
    Serial.println("");

    static uint8_t hue = 0;

    // WHEN THIS NEXT LINE COMMENTED OUT I GET GOOD IMU DATAS
    FastLED.showColor(CHSV(hue++, 255, 255));

    delay(10);
    }

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,478
    First, try the easiest thing: add a 100 ms delay at the beginning of setup(). There've been "starting too soon" issues with FreeIMU and NeoPixel stuff.

    Regarding the code in #6, which Teensy and which IMU sensor(s) are connected? Those details matter...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •