How to write open loop maneuvers?
rwgast_logicdesign
Posts: 1,464
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?
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
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