I can get my balboa with arms installed to balance, if I start it standing up, but it will not stand up from a 90 or 85 degree angle lying down.(the angle the robot rests at lying down with the arms installed.)
I have been changing these values in Balance.cpp:
if (angleRate > -2 && angleRate < 2)
// It's really calm, so we know the angles.
if (imu.a.z > 0)
angle = 110000; changed to 90000 or 80000
angle = -110000; changed to -90000 or -80000
distanceLeft = 0;
distanceRight = 0;
I am I on the wrong track?
I cannot get the red led on with the initial standup code to engage when I press button A.
What part of the balance program “sees” the resting angle when the robot is face down at 110 degrees?
Where should I look to change it to about 87 degrees?
Hey, with further sleuthing of code I’m guessing… are you folks reading the accelerometer values in Balance.cpp?
It seems like there is testing if there is greater than 0 values in Z at rest . and a test with the x axis to run the standup code. I’m I right? Is it possible these tests are not > 0 at 90 degrees?
thanks in advance.
It sounds like you are on the right track. The section of code you reference checks to make sure the rotation rate is arbitrarily close to zero, reads the Z axis reading of the accelerometer to see whether the board is facing up or down, and then sets the angle (which is in units of millidegrees) to 110 degrees. Changing the code in line 6 of that block to
angle = 87000; would set the angle when the robot is resting to 87 degrees. You might try that to see if it helps. An improvement to that bit of code might be to read both the X and Z axes and to calculate the angle of the acceleration vector based on those two values instead of assuming a value for a standard physical configuration.
Also, you might look through this Balance.cpp (5.5 KB) file , which has some revisions that worked with a similarly configured robot here.