Ok well I haven’t looked at the code yet but from the pictures it would appear that the robot must balance by trying to keep the line sensor the same distance from the ground which it would measure by the amount of reflected light, right? Anyways very cool.
yeah, i tried this amazingly hard project awhile back… i was never able to get it to balance on its own, which looks like you havent either. suggestion: slow down the motors A LOT, it is way too jerky, and try to make different “zones” at which the robot is tilted in a way that the sensor values are in a range to make the motors move at varying speeds. eventually i gave up because i couldnt get the vex sensors/motor to be accurate enough.
You have to make the motor speed proportional to the amount of tilt. That’s called Proportional Control.
And you have to make the motor speed change with the rate of change of the tilt, ie, how fast is it approaching the balance point. That’s called Derivative Control.
And you have to adjust the motors so that the sum of all tilt measurements over time add up to zero. That’s called Integral control. Together, it’s called PID control, and it is a whole discipline unto itself.
I tried this a few months ago. I could never get it to balance. I think the 55mS processor loop speed is a little slow, and the backlash in the motors caused lots of problems.
Cool use of the line follower as a distance measurement. Keep it up, you might get it to balance.
My first thought is that your motion is Very Quick… I wonder if adding a “balancing tool” would help… (re: Tightrope Walker)
Make Note of the “Biomechanics” section from the above Wikipeda article:
“A wire-walker may use a pole for balance or may stretch out her arms perpendicular to her trunk in the manner of a pole. This technique provides several advantages. It distributes mass away from the pivot point and moves the center of mass out. This reduces [angular velocity because her center of mass is now swinging through a longer arc. It takes longer to sweep out the same angle because the center of mass has a longer distance to go. The result is less tipping. In addition the performer can also correct sway by rotating the pole sideways. This will create an equal and opposite torque on her body.
Sometimes the pole is weighted and has a dip at the ends. This provides additional stability by lowering the center of mass.”
A easy (I doesn’t look hard at first glance) step in this direction would be putting the heavy battery at the bottom of the machine instead of at the top (unless having it at the top is part of the challenge…).