Shop OBEX P1 Docs P2 Docs Learn Events
solutions Robotics v1.1 ? — Parallax Forums

solutions Robotics v1.1 ?

TheoTheo Posts: 7
edited 2005-06-01 23:21 in Robotics
·ello,

does anyone have the right solutions for the Roboticsv1.1 manual?

Theo

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-05-31 16:02
    One solution to your question would be to post
    a few questions at a time and that would us to answer them as you go through the book.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • TheoTheo Posts: 7
    edited 2005-06-01 15:48
    Well ok,

    I'm having trouble coding a program for the project at the end of Chapter 2 (Robotics),

    where there is asked to make the Boe-Bot to follow a sine wave pattern.



    Theo



    btw. I have version 1.5 of the Robotics Student Workbook (not v1.1) Sorry blush.gif
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-01 16:11
    Can you be more specific on what trouble you are having? Have you completed the servo ramping exercise? To do a sine wave you will need to ramp both servos in a sawtooth wave between stop and full forward, the two servos waveforms are set 180 degrees apart.

                   /\      /\
    Left Servo    /  \    /  \
                 /    \  /    \
                /      \/      \
     
     
                \      /\      /
    Right Servo  \    /  \    /
                  \  /    \  /
                   \/      \/
    

    The result is the bot will travel in a sine wave.
  • TheoTheo Posts: 7
    edited 2005-06-01 22:13
    Ok, i see.
    But I was trying to let the BS2 calculate the sine-function and trying to figure out how to make the servo's respond to that.
    Did not make a code simply because I didn't see a solution on how to let the servo's respond to the calculation of the sine.

    Theo
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-01 23:21
    You can do it that way as well, in that instance you need to think in terms of forces acting upon the "drawing particle" (in your case the bot). The bot can be thought of accelerating back and forth creating the sin wave. Acceleration is the second derivative of·position and we know the position is sin(x), so the acceleration would be -sin(x). This is the "force" acting upon your servos, this force is split between the wheels in opposing directions, and if you have the same "handedness" for your servos (the pulse for one going forward is the same pulse for the other going backward) you just divide the "acceleration" by two and add this value to both servo speeds.·This will have the effect of incrementally changing the servos so the resultant movement is sinusoid.

    PS. you can just use sin(x) when calculating the acceleration, it will do the same thing except one would start the bot off by turning left, the other to the right)

    There is some addition math required, such as scaling the sin(x) (changing the servo value by ± 1 isn't going to make the bot turn very much).


    Post Edited (Paul Baker) : 6/1/2005 11:27:12 PM GMT
Sign In or Register to comment.