2 wheel balancing robot
Mark Pepper
Posts: 14
Hi
I am having fun trying to get a 2 wheeled balancing robot to work (as per Robot Wagoner's article in Robot magazine) and was wondering if anyone else had given it a stab too?
Apart from the fact that I can't get it to balance I have been trying to change the code to not use the video output (I only have the house TV as a monitor) but to use the BS2 debug serial out commands. I have found that I can send serial data from the PUB start object but cannot get any output from any of the other objects that are started on a new cog or in another PUB object. See the section of code below:
PUB Start | x
·· BS2.start (31,30)··········· ' Initialize BS2 Object, Rx and Tx pins for DEBUG
·· waitcnt(50_000_000+cnt)
·· BS2.Debug_str(string("···· Just testing!",13))····· ' some test text
......code removed for clarity
PUB Kbd
'
· bs2.debug_str(string("Kbd Cog",13,10))··
The string "Just Testing" outputs to serial but "Kbd Cog" does not. Anyone any ideas why?
If I use Roberts code the basic functionality of the bot works but any servo movement is just too slow to counteract any off balancing. Any ideas why so here too please?
Oh and just for good measure I can't get the keyboard to have any effect at all. The routine doesn't seem to run.
The code I am using (appart from the video to serial mods) is available here http://www.botmag.com/issue4/index.shtml
Mark
Post Edited (Mark Pepper) : 10/4/2006 11:00:34 PM GMT
I am having fun trying to get a 2 wheeled balancing robot to work (as per Robot Wagoner's article in Robot magazine) and was wondering if anyone else had given it a stab too?
Apart from the fact that I can't get it to balance I have been trying to change the code to not use the video output (I only have the house TV as a monitor) but to use the BS2 debug serial out commands. I have found that I can send serial data from the PUB start object but cannot get any output from any of the other objects that are started on a new cog or in another PUB object. See the section of code below:
PUB Start | x
·· BS2.start (31,30)··········· ' Initialize BS2 Object, Rx and Tx pins for DEBUG
·· waitcnt(50_000_000+cnt)
·· BS2.Debug_str(string("···· Just testing!",13))····· ' some test text
......code removed for clarity
PUB Kbd
'
· bs2.debug_str(string("Kbd Cog",13,10))··
The string "Just Testing" outputs to serial but "Kbd Cog" does not. Anyone any ideas why?
If I use Roberts code the basic functionality of the bot works but any servo movement is just too slow to counteract any off balancing. Any ideas why so here too please?
Oh and just for good measure I can't get the keyboard to have any effect at all. The routine doesn't seem to run.
The code I am using (appart from the video to serial mods) is available here http://www.botmag.com/issue4/index.shtml
Mark
Post Edited (Mark Pepper) : 10/4/2006 11:00:34 PM GMT
Comments
http://forums.parallax.com/forums/default.aspx?f=21&m=109179
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://fstop.crosscity.com/
http://icar.crosscity.com/
·
Mark
I'm wondering if Spin is even fast enough to handle it? Hopefully so.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
h.a.s. designn
http://forums.parallax.com/showthread.php?p=570699
Essentially the problem is that I don't have (yet) a simple monitor so am trying to use a serial output stream to send text to my PC so I can check code progress.
I have plenty of cogs left to use too.
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
Mark