Shop OBEX P1 Docs P2 Docs Learn Events
Kalman Implementation — Parallax Forums

Kalman Implementation

QuadrtrFlyrQuadrtrFlyr Posts: 73
edited 2011-11-30 00:24 in Propeller 1
Hello,

I have a question in regards to the Kalman Filtered IMU via 5DOF Accelerometer/Gyro code.
I have the exact setup as listed in the code and am trying to read the roll angle via serial terminal and am having problems getting this angle. The readings come out very laggy and always around ~ -180...
Here is my code. Any ideas?

pin 6 on the MCP3208 (VDD as stated in manual) is connected to a 3.3V supply and pin 7 is not connected to anything. I'm not sure if pin 6 should be 5V..
CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000


OBJ


  imu:          "IMU"
  Debug:        "FullDuplexSerialPlus"
  fstring:      "FloatString"


VAR


  long rollangle
  
PUB Run


  Debug.start(31, 30, 0, 115200)
  waitcnt(clkfreq*2 +cnt)
  Debug.tx(Debug#CLS)


  imu.start(15, 14, 13)
  
  repeat
    Debug.Str(String("Roll angle: "))
    rollangle := imu.get_angle_Roll
    Debug.Str(fstring.FloatToString(rollangle))
    Debug.Str(String(Debug#CLS))
    
    
    

Thank you!

Robert
Sign In or Register to comment.