Discuss Scratch
- Discussion Forums
- » Connecting to the Physical World
- » Suggestions for more precise WeDo motor control?
- grodey
-
12 posts
Suggestions for more precise WeDo motor control?
Hi, I'm trying to get a Scratch-controlled lego car with 2 WeDo motors turning more precisely. I realize I won't get stepper-motor accuracy here, but any suggestions to get my turns more precise would be appreciated!
I've tried different combinations of motor power, motor on-times, and wait-delays to look for a smooth pulse that is reproducible. I tried running each motor in a parallel thread and they got out of synch quickly. So far, the routine of ‘set power A’ -> ‘set power B’ ->'set direction A'-> ‘set direction B’-> ‘turn motor on for x secs’ works (turning A and B on individually leads to timing problems), but I can't, say, turn 90 degrees one way, then back again for the same time and expect to be within 30 degrees of the starting track.
Has anyone tried something similar and had better luck?
Thanks for your help!
I've tried different combinations of motor power, motor on-times, and wait-delays to look for a smooth pulse that is reproducible. I tried running each motor in a parallel thread and they got out of synch quickly. So far, the routine of ‘set power A’ -> ‘set power B’ ->'set direction A'-> ‘set direction B’-> ‘turn motor on for x secs’ works (turning A and B on individually leads to timing problems), but I can't, say, turn 90 degrees one way, then back again for the same time and expect to be within 30 degrees of the starting track.
Has anyone tried something similar and had better luck?
Thanks for your help!
- drmcw
-
1000+ posts
Suggestions for more precise WeDo motor control?
What you have is an open loop system, to be able to control it properly it needs to be closed loop. In other words you need feedback. So a way to measure how much the vehicle has turned or the wheels have turned. I don't think any of the wedo sensors will enable you to do that though I'm afraid.
- kiloe2
-
96 posts
Suggestions for more precise WeDo motor control?
What you have is an open loop system, to be able to control it properly it needs to be closed loop. In other words you need feedback. So a way to measure how much the vehicle has turned or the wheels have turned. I don't think any of the wedo sensors will enable you to do that though I'm afraid. LOLOLOLOLOLOL
- kiloe2
-
96 posts
Suggestions for more precise WeDo motor control?
What you have is an open loop system, to be able to control it properly it needs to be closed loop. In other words you need feedback. So a way to measure how much the vehicle has turned or the wheels have turned. I don't think any of the wedo sensors will enable you to do that though I'm afraid.lol
- grodey
-
12 posts
Suggestions for more precise WeDo motor control?
Yes, I understand- I have a picoboard set up to give collision detection feedback for R/L tracking errors, so it is a closed-loop. However, when the motor control is so imprecise, it makes it harder to control in tight quarters.
It seemed to me just playing around with the motors and Scratch that different coding methods led to better or worse control, so I just wondered if anyone else had done this before and worked out a better way.
Thanks.
It seemed to me just playing around with the motors and Scratch that different coding methods led to better or worse control, so I just wondered if anyone else had done this before and worked out a better way.
Thanks.
- Discussion Forums
- » Connecting to the Physical World
-
» Suggestions for more precise WeDo motor control?