Canada
Asked — Edited

2 Wheel Balancing Robot

I got a 4 - in - 1 sensor and have put together a 2 wheeled balancing robot. Now I need to figure out some coding. I have the Initialization script and it works good - getting lots of data. I'm not having any luck after that. Does anyone have some scripting they would be willing to share with me to help me get going? Here's what I've got so far.


ControlCommand("MPU9150", Init)

sleep(100)

:loop
#Added these because $AccelX and $AccelY were not recognized later in the script for some reason.
$XAccel = $AccelX
$YAccel = $AccelY

if ("x" =0)

  print(1)  

  sleep(2000)
  
  goto(loop)
  
endif 
  
ControlCommand("MPU9150", RunOnce)

if($AccelX > 1000 and $AccelX < 1000)
servo(d4,108)
servo(d6,108)
endif

print("x: " + $XAccel)
print("y: " + $YAccel)

if($AccelX > 1000)

servo(d4,120)
servo(d6,61)

print(2)
elseif ($AccelX < 1000)
Servo(d4,61)
servo(D6,120) 

print( 1)
endif
Sleep(100)
goto(loop)

I am working with a code that d. cochran posted awhile ago. It will change directions when it is tipped but will never stop. Also, after it has run for 30 seconds or so it will just keep running and the only way to stop the wheels is by disconnecting the power to the EZB.


ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

#17  

DJ, how about you go to their website and use their search. I think its about time for me to leave this forum, I get tired of seeing your smarta$$ comments. Even my 13 year old son said same thing, sad.

PRO
Synthiam
#18  

Apologizes for what you may have interpreted as rude - however, as stated earlier, i am unable to find the robot on robot shop website. If you wouldn't mind copying and pasting the web URL using the above instructions, it would be helpful

#19  

All you had to do was type in self balancing robot in their search box, but here is link since you could not find it. Their software is on github. What would be great is you put your software on github.

Ralph - Self Balancing Robot

PRO
Synthiam
#20  

Awesome! Thanks - I had a hard time finding it by the name, this helps a lot.

#21  

Thanks for the link. I also could not find it. Balance Bot had 0 hits, Balance had 2 that were unrelated. Only Balancing worked as a proper search term.

This is why many companies pay Google or Microsoft to drive their search engines. Either of them would have searched synonyms.

Alan

PRO
Portugal
#22  

Could not find any videos related to this robot. confused

#23  

Strange,

I type in "balance" and in drop down menu it shows self balance robot.

But I would think proper search would be "self balancing robot", my opinion.

I have only seen one video for this robot, but the robot does has a lot of documentation online.

#24  

Quote:

I type in "balance" and in drop down menu it shows self balance robot.
Maybe a difference in the mobile web interface vs full interface. I was searching from my phone, and had no luck.

Interesting looking device now that I found it. A bit pricey for what it does, but this is not a cheap hobby....

Alan