Shop OBEX P1 Docs P2 Docs Learn Events
How to write open loop maneuvers? — Parallax Forums

How to write open loop maneuvers?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-01-28 10:51 in Robotics
Ok so, i havent gotten to a point where im ready to to start trying figure 8s etc yet.. Im waiting till Ive gone through some propeller books and have encoders/compass working. Although for those of you who have seen some of my videos Ive gotten bots rolling around with PWM speed control, doing simple things. The thing is Im not really sure how to do even simple maneuvers if your motor control is open loop.

I get the basics you know, both wheels go forward, to go forward. One wheel goes backward while one runs at the same speed forward to turn/spin. When running open loop though, the only way I can figure out how to do even simple things like turn is based on time, which isnt all that great if you change the motors speed, you have to figure out all new timings.

Lets take something as simple as a 90 degree turn for example. So if you have encoders, you can figure outt how to get exact turns by figuring out the number of ticks it will take to do 90 degrees then turning one wheel forward, while one wheel turns backwards that many ticks. With a compass you could just turn your wheels until the bearing is 90 degrees from the starting bearing. Whit open loop I just spin the thing in full circles and kind of guesstimate the time it takes to do a 90 degree turn with a stop watch, then scale that time based on speed changes. Is this how it is usually done? Seems like a very bad way to do things? This also leads in to how would you do more complicated maneuvers like a circle with a set diameter.radius, using open loop controls?

Comments

  • ajwardajward Posts: 1,129
    edited 2013-01-28 01:59
    Open loop navigation is kind of tricky because there are variables to consider. As your route becomes longer the accumulated error becomes greater. If your starting point/vehicle orientation isn't exactly the same each run, your finish point will be different each time. The code for a 90 degree turn on carpet doesn't give the same result on tile. Unevenness in the surface can tweak your course ever so slightly (that accumulated error thing again). As batteries age, motor/servo speeds may change in turn invalidating all those calculations made for 90 degree turns, etc....

    I can program my BoeBot for a decent, small figure eight on the carpet in my bedroom. Take it into the kitchen (tile floor) or out to the lobby (different carpet) and it doesn't work (very well). Make the "8" bigger and repeatability becomes a lot tougher. I've a program to run my 'bot on a tour of the apartment (about 40 feet). Out of the bedroom, into the hallway, turn into the living room, turn into the kitchen, turn into the entryway, back into the hallway, back into the bedroom. Each leg and turn meticulously measured and calculated... darned 'bot hasn't completed the run yet!

    So, yeah... there is a lot of guesstimation, but that's what I find intriguing about the whole thing. Trying to get the most performance with the least hardware.

    Amanda
  • lardomlardom Posts: 1,659
    edited 2013-01-28 10:51
    I think tweaking sensors as well as encoders are both valid ways to get figure eights. I see encoders as necessary for a cnc machine but not necessarily for a wall follower. If your wheels slip while making a 90 degree turn using encoders you've lost your accuracy. The robot is blind to the environment. This is where I think tweaking sensors is needed.
Sign In or Register to comment.