Asked
— Edited
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.
DJ, as usual the Arduino can't do anything per your say. Yes you can purchase the robots I listed, as I have both. If your referring to me with no experience, I started working with PID loops on IMM in 1987, but I'm no guru on it. Given, your a smart dude and great programmer, but I do get tired of you putting down the Arduino. James Burton and Mr. Stolpner are super smart dudes also on robots/electronics and have done many balancing robots. But thats just my opinion and this an EZ-Robot forum.
I didn't put down arduino and never have and never will. I put down the code for this subject on the arduino. Please visit the arduino code examples to better understand my statement so you can view the facts yourself.
As I've previously stated in all similar conversations, arduino and mcu programming is great for repetitive tasks and monitoring. If I were to have any negative opinion of arduino than I would most surely and logically need to have the same opinion with gcc compiling on stm32 arm or ccs picc on microchip. please do not accuse me of anything not included in the current topic, specifically having a negative opinion regarding something that would contradict tools ezrobot current uses, such as arduino.
Lastly, if you have both of those robots, id love for you to share purchase locations so I can get them for research as well. It would be very useful. If you have something additional to contribute to this topic, that would be awesome - it's not a good use of my effort in this thread to discuss anything off topic.
I would prefer to focus our combined efforts on an inverted pendulum solution.
Yes I have both of these robots, do I need to take a picture and show you? As I told you above who made them, but here you go, buy one at sociallyshaped.com and the other at robotshop.com.
What I have said in my post was to help out the original topic of 2 wheel balancing robot.
Some more on the Balancing: A PID cascade should be used, one PID adjust motors speed to maintain the angle and the other PID adjusts this angle. This would also allow a new set point angle for balancing if the center of gravity is moved.
I did not ask for proof. My goal in this conversation is to identify ideas that contribute to the continued development of the inverted pendulum, as i have previously stated.
I'll check those links and get those robots to add to my research collection.
@69developer, I had not heard of those robots, the one from SociallyShaped looks interesting. It won't help me do what I was looking to do but thanks for the response.
I'm unable to find information of either robot. However, on sociallyshaped i found a balancing robot named Roby, but it's discontinued and there is no further information available on any google searches. To get over using encoders, they use stepper motors which is a good idea but not practical for universal applications. Do you have access to a codebase for either of these robots?
The Roby says backorder not discontinued.
The other is on RobotShop.com which I said above - they have it in stock.
I do have access to the codebase, one is opensource and the other is not.
Also, I will try and show a video of balancing robot and adding an adjustable wrench hanging off the front and still balances. I have another one that is about 3 feet tall and balances well also.
I believe they balance - that's not the question. Please provide a link to the product on robot shop by using the copy and paste option provided by the Microsoft Windows Operating System from your web browser. Right click in the address bar of your web browser and select COPY and then perform the same right click function into this window and select PASTE. Thanks!