Shop OBEX P1 Docs P2 Docs Learn Events
Turn X degrees, go X cm forward — Parallax Forums

Turn X degrees, go X cm forward

GiaGia Posts: 6
edited 2012-03-19 09:34 in Robotics
Hi,

Is any rules/formulae how to set Scribbler's wheels velocity and move time from GUI to turn it 45 degrees, go 10 cm forward etc.

Regards,

gia

Comments

  • ercoerco Posts: 20,255
    edited 2012-03-19 03:28
    Short answer: red S2 yes, blue Scribbler no.

    S2's motor encoders make all the difference. "Old Blue" is open loop (no encoder feedback), so you just have to experiment with timing.
  • GiaGia Posts: 6
    edited 2012-03-19 03:46
    I have S2 (red one), Should I experiment with it too? Maybe I can read the ready recipes somewhere? Thanks.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-19 05:44
    Gia,

    As erco said, the S2 can do this.

    Take a look at the S2 download page. Jessica made a video where she has the S2 spells out her name.

    Nikos has been working on a S2 alphabet. I think Nikos' letters use a pen lifter.

    I hope you take a look at my S2 project too.

    Post #12 of my index has some other Scribbler 2 links.
  • GiaGia Posts: 6
    edited 2012-03-19 06:30
    If I understand correctly I cannot do it from GUI, we are beginners :-) ... Thank you
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-19 07:34
    I think you'd need to use the motion control icon and adjust the speed of each motor and set the time you want them to move. You'd need to experiment to see how much you turned with the various speed settings.

    There might be a different way to do this with the GUI, but I don't know it. I personally only use the GUI to generate sounds and then I copy the generated code into my project.

    The motion icon is below the hand icon and above the musically notes icon.
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2012-03-19 08:31
    Hi Gia, welcome to the forums!

    Chapter 4, Activity 3 in Robotics with the Boe-Bot provides a great tutorial on how to calculate distances with the Boe-Bot Robot, but you can apply the same techniques to the S2. And you can do it all in the GUI! It's essentially three steps:
    1. Have the S2 move forward for a couple seconds.
    2. Use a ruler to measure the distance travelled.
    3. Use this information (my S2 travelled x cm in x seconds) and set up a proportion to calculate the time needed to travel other distances.
    Keep in mind that this value will change for different motor speeds, so you'll have to do some more experiments if you want your robot to move faster or slower.

    Happy experimenting!

    -- Jessica
  • ercoerco Posts: 20,255
    edited 2012-03-19 09:34
    Variations in battery voltage will likely affect the distances travelled, using the timing techniques described here and the GUI. At least the S2's encoders will guarantee that it goes straight when you want it too.

    If you follow Jessica's video, you can see how to write some SPIN code for more direct control of distance.
Sign In or Register to comment.