1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Balancing Bot

Discussion in 'Robotics & Mechatronics' started by MrMikey83, Dec 27, 2004.

  1. sjponder

    sjponder New Member

    Joined:
    Jan 5, 2005
    Messages:
    3
    Likes:
    0
    I see this has been suggested already, whoops.
     
  2. spindrah

    spindrah New Member

    Joined:
    May 31, 2004
    Messages:
    113
    Likes:
    0
    wow you're in for a lot of work!!
    but its great when you get it working

    here is my balancing bot
    I use ir LED's and Transistors to see the distance from the floor
    good luck with your project!

    [​IMG]
     
  3. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    Wow, awesome job spindrah! Yeah, I know mine is going to be even more work and code because of the gyro, but with the help of this board, avrfreaks, as well as a Mr. Anderson who built nBot, I think I will do well on this project. I'm learning so much just from researching, stuff we didn't cover in my class is becoming so easy to integrate into the code and design. This is why I like labs so much, theres so much you can learn by actually doing it.
    ~Mike
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    ONLINE

    Yes, looks great!.

    Have you got any video clips of it in action?.

    As for 'MrMikey83', have you considered starting off using simple sensors like this?, you could get it all working and the biggest part of the software proven and tested. Then replace the ground sensors with gyro's later, with minimal software changes required!. It would also extend the scope of your project, by showing how to upgrade and improve the basic design to a more functional one, based on varying conditions (ie, non-flat ground).
     
  6. spindrah

    spindrah New Member

    Joined:
    May 31, 2004
    Messages:
    113
    Likes:
    0
    thanks
    MrMikey & Nigel

    I do have a Movie of it, BUT I don't know how to post it!!!

    if you tell me how to do this i will be glad to post it.
     
  7. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    ONLINE
    The best bet is to place on some webspace somewhere, and post a link to it here - it may be too large to be uploaded here?.
     
  8. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    So far, I am able to read the accelorometer and have found info on making a filter to combine both accelorometr and gyro.

    I am now trying to get the remote control part to work. I have a JR XF421 radio control and the receiver has a PWM output for servos.
    I am trying to read the PWM through a normal input pin. Can I do this or must I use interrupts? I have 5 channels on the receiver and only 2 interrupts, thats why I am using normal inputs.

    I know I need to use the timer, but I have been having trouble trying to find info on using it. The datasheet is confusing to me and my class textbook is of some help but am still stuck.
    I need to know what register the timer1 count is located in. I need to define this, then measure once when the pin goes high and again when it goes low, then find the difference.
    ~Mike
     
  9. JFDuval

    JFDuval New Member

    Joined:
    Apr 9, 2004
    Messages:
    115
    Likes:
    0
    Location:
    Québec
    Hello!


    Spindrah, send me your video by e-mail if it's less than 10Mo or by MSN Messenger (if you have it). I'll put it on internet for you, on the server of a friend.
     
  10. spindrah

    spindrah New Member

    Joined:
    May 31, 2004
    Messages:
    113
    Likes:
    0
    MrMikey

    i didn't see what micro you are using

    but if it as a pic the reg is TMR1H and TMR1L (high and low byte of 16bit timer)
    you also need to set up the T1CON register

    also you have to read the low byte before you read the high byte
    and you must write the high byte before you write the lowbyte
    this is for the 18fxxx chips and is a must

    ok i will send it tonight

    thanks
     
  11. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    I'm using an ATmega32
     
  12. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    OK, I beveive I have found the correct Timer register to call. Its TMR1. Should I use the 8 bit timer or the 16 bit timer? Does it matter?

    Can anyone give an example code of how to read the PWM from the receiver with PIND.6?

    Thanks!
    ~Mike
     
  13. JFDuval

    JFDuval New Member

    Joined:
    Apr 9, 2004
    Messages:
    115
    Likes:
    0
    Location:
    Québec
  14. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    Not working for me.
     
  15. JFDuval

    JFDuval New Member

    Joined:
    Apr 9, 2004
    Messages:
    115
    Likes:
    0
    Location:
    Québec
    Yeah, me too I can't see it. I posted it because maybe they are some people who are able to watch it.
     
  16. spindrah

    spindrah New Member

    Joined:
    May 31, 2004
    Messages:
    113
    Likes:
    0
    I can't see it

    could you see it before you posted it?
     
  17. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    ONLINE
    Yes, the URL doesn't work, there appears to be no directory called 'jfduv'?.
     
  18. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    Time to take back my thread...

    Here is my progress on the balance bot. I have built a frame from aluminum stock from Lowes. The gears, motors and wheels are from a local RC hobby store. The batteries will be strapped to a peice of plexiglass on top of the two poles that extend upwards off the bot.

    The radio controller I am using as well as the receiver are in the pic. The accelorometr and Gyro are on the small breadboard in front of the controller.

    [​IMG]
     
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    ONLINE
    Cool! - I look forward to seeing how you get on!.
     
  20. MrMikey83

    MrMikey83 New Member

    Joined:
    Jul 17, 2003
    Messages:
    300
    Likes:
    0
    Location:
    Carbondale, IL
    I might need larger diameter wheels...not a problem to change them though.
     
  21. JFDuval

    JFDuval New Member

    Joined:
    Apr 9, 2004
    Messages:
    115
    Likes:
    0
    Location:
    Québec
    Hello!

    The link is working, it's the video that can't be seen (by some people at least). The directory jfduv/ exist. Don't forget the slash at the end.
     

Share This Page