defaut.bas (6329Bytes)
28062009459.jpg (271148Bytes)
28062009458.jpg (420071Bytes)
Hello,
I have a problem with my first robot following firtsl's tutorial, i've done a robot like the part II of his course and i've put the same code. (https://www.robotshop.com/letsmakerobots/node/254). It take sometimes to understand the code but finally i understood it.
You can see in the video that the comportment of the robot is not the one I expected. It seems to reverse the motor to many times and i don't why.
Is the constants problem ? ( I mean the symbols Danger, Safatydistance, ClearPathAhead, etc...) Or is it a problem in the code ? Or something else ?
Thanks.
P.S.:I speak french so i'm sorry for my really bad english.
https://www.youtube.com/watch?v=fEq3ETZZSLQ
code
i tried building my frist robot with copied code, and it just didn’t work. the general consensus seems to be that it almost never works that way. There are a thousand physical factors that will get in the way. I would recommend starting your own from scratch, looking at F’s code as a reference so you can see why he did what he did. You’ll end up with a better robot, and more programming know-how.
i totally agree. I made my
i totally agree. I made my first robot off of frit’s idea but took the time to learn how to program picaxe and made my own code.
Ok, but he built a very nice
Ok, but he built a very nice robot after the Frits design. I like it 
I’m no expert in this and havent really ever touched a picaxe, but I believe maybe you’re sensor is tricking you. What I have learned after my first month with robotics is that sensors often give some strange results. What I would do if I were you, was to look at the sensor feedback and see if it’s jumping when it’s not supposed to - given false results etc. You might want to look into filtering the results from the sensor taking away the bad readings - or creating some sort of average. Bad readings often are due to motor noise and things like that. Especially since it looks like you’re sharing the power supply for motor and chip.
The code you posted also has lots of constants depending on what the sensor returns, these might need some tuning as well.
Anyway, this are just a few suggestion, not sure if it helps or not.
Thanks Simon. You’re right
Thanks Simon. You’re right this a problem with my sensor because i’ve made my own code but i found that the SRF05 detect the objects, the walls, etc… too far away. So i’ve tried to edit the constants but he have a more wierd comportment (he does so many reverse).
Now I’m trying to continue my own code but i don’t know if it will help me or this is just a constant story…
OK, then you have some sorts
OK, then you have some sorts of opinion about where you’re problem is; sensor readings give far away results and you’re robot does alot of reverse where you expect forward/directional drive.
A good thing now will be to try to isolate the problem and try to reproduce the errors. this will make it alot easier to fix the code/robot. Think modular and systematically when debugging. Following a systematic aproach when looking for you’re error will make it both easier to find and learningful - randomly changing the constants in you’re code will probably just make the random behaviour worse
Good luck.
And one more thing. No
And one more thing. No questions are to stupid, to easy etc.
same here, I had to write my
same here, I had to write my own code because Frit’s was making my robot go nuts and it took longer to navigate than with a simpler one
You should start by making a
You should start by making a simpler program in which you just debug what your sensor reads… so you’ll be able to see if your distance reading is ok… Then just put a led or two, and code something like “if distance < 50cm, light the green led, if not light the red one”…
(et si tu veux de l’aide en français, hésite pas
)