Angle measurement for balancing robot.


Closed Thread
Results 1 to 40 of 53

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Muenchen, Germany
    Posts
    5


    Did you find this post helpful? Yes | No

    Wink PBP implementation

    Hi Henrik,

    thanks for the file and the link. I downloaded all the stuff from the nuts 'n volts FTP server. Obviously these guys creating B-Bot have adapted some code originally developed for the helicopter autopilot on sourceforge. Thank you again.

    Regarding my implementation: no, I am working on a C-code implementation for the ATMEGA16 to be compiled with win-avr or gcc, resp.

    When you adapt my formulas for the tilt angle from accelerometer data, please care for the fact, that the accelerometers have different sign for dynamic and static acceleration. This fact is not yet considered in my formulas. So the sign of "a" must be inverted for the real measurements.

    Have you done any work on implementing my formulas?

    Kind regards, uffi.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default

    Hi Uffi,
    Regarding my implementation: no, I am working on a C-code implementation for the ATMEGA16 to be compiled with win-avr or gcc, resp.
    Oh crap, yet another C implementation....and not even for PIC... ;-) I've started to look at C for PIC's but that's not a topic for this forum.

    Yes, the Kalman code comes from the UAV project. I have not had time to work on implementing your formulas yet but thanks for the pointer on the sign of the acceleromter readings. I'm not sure the accelerometer formulas will work with the sensor I got now. It is a two axis accelerometer, X and Y but I'm not sure how it will respond if mounted so it "becomes" X & Z. I will have to experiment with that too.

    I got the SHARP sensors yesterday and managed to get the robot balancing fairly well. It's still a little "nervous" but I think I'll get it better by filtering the readings and/or experimenting with the sensors mounting. The goal, however, is the acceleromter/gyro aproach since the SHARP sensors introduce too many drawbacks IMO. But hey, atleast it works!

    Thanks!
    /Henrik Olsson.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    If you need gyros, try the analod devices ADIS16250 or ADIS16255

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Henrik,

    Do you need 180º or 360º for your angle measurement?

    I "think" it should be 180º.

    -----------------------------
    Last edited by sayzer; - 5th February 2007 at 07:01.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I'd say +/-45 degrees from "down" will be more than enough. The problem, again, is that it needs (I'd like it) to be an absolute value in reference to gravity.

    /Henrik Olsson.

  6. #6
    Join Date
    Jan 2007
    Location
    Muenchen, Germany
    Posts
    5


    Did you find this post helpful? Yes | No

    Wink I got my two-wheel balancer working

    Henrik,

    during the last weekend I had a breakthrough using the kalman filter code you provided here from the nuts&volts article. I got my robot balancing based on combined gyro and accelerometer approach. Up to now I also used only one axis of my 2-axis accelerometer (therefore containing also an error due to the measurement of the robots acceleration itself: this error seems to be filtered away by the kalman code). The regulation is only PD-control, not PID, but I plan to extend it to PID to get better control of absolute position. I have a demonstration video (6MB) which is too large to be uploaded here. If you send me your email address, I will mail it to you.

    All approaches based on using only the accelerometer or the gyro were not successful so far: the pure accelerometer approach has a too noisy signal to be used for this kind of control and for the pure gyro approach I was not yet able to really compensate for the drift only by software.

    Have fun, Dirk.
    Last edited by uffi; - 26th February 2007 at 17:10. Reason: removed e-mail address

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Sweet!

    Hi Dirk,
    That's absolutely great!
    I haven't had time to work on mine for a while. I did get it to balance fairly well using the SHARP sensors though but nothing have been done to it since then.

    So based on your experience (and mine, so far) I think that we can rule out using just an acceleromter or gyro. I kind of had that feeling from the begining but was I would be glad to be proven wrong.

    Now, if we only could port that filter code to PBP. Hmmm...I wonder if there's a way to compile just the filter code and use the assembler code from within PBP.

    Thanks for the update, I appreciate it!

    /Henrik Olsson.

Similar Threads

  1. Replies: 0
    Last Post: - 2nd February 2009, 23:23
  2. PIC16F877A for application in mobile robot...
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th January 2009, 14:47
  3. Need Help - Line Tracer Robot
    By pidot in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th August 2007, 14:58
  4. IR for robot on 16F877A
    By Samuel in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 9th April 2005, 20:57
  5. Line tracer robot
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 30th January 2005, 15:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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