Project mini "Segway" CC3D
Posted 31 October 2012 - 05:10 PM
here is a short video of my try to get the ServoBot balanced...
i have balanced the bot and leveled it vertically. Next step was to switch to attitude mode so the vehicle will try to stay balance...
i use TxPID for Innerloop Kp Pitch to find the right point... but around level the vehicle has really fast oscillation... if i lover Kp the servos wont move..
you can see at the end of the video when i'm holding the vehicle on an angle that the wheels don't continue to rotate.. but they should keep turning to try to come back in balance... anyone a idea how i can do that? I have never done something like that... so i'm basically just playing around and see if it gets better or not...
any suggestions are welcome
View on Vimeo
Posted 31 October 2012 - 11:06 PM
example is my tilting vtail, Ki is twice KP in the outerloop to get enough it to level properly , i would go inner loop kp as high as you can with no oscillation, ki=0
outerloop kp = 2 (so you have decent authority) and Ki, start at 2 and keep going up
I always wanted to build on of these - great work
Posted 01 November 2012 - 12:52 AM
It also looks like you are using the tilt angle to govern wheel absolute rotation angle. It won't work this way.
Instead of governing the wheel absolute rotation from the tilt angle modify the wheel controller so that the wheel ACCELERATION is governed by the current tilt angle of the board. This way it will continue to attempt to bring itself to level.
Step 1. Wheel acceleration is what causes a counter-tilt torque to appear. So make the controll law: more tilt->more acceleration. Note that at first, this may make your vechicle constantly go in one direction - see step 2.
Step 2. When you can controll or at least limit the tilt, can begin to controll the overall velocity of the vechicle by allowing for certain tilt for limited amount of time. To accelerate the vechicle, rotate the 'apparent ground level' in your controll algorithm by a small amount. It's like having a ball roll down the ramp.
Controlling vechicle position is not something that you want using Your radio (because that would mean that you can only go as far as you can move your stick)
hint 1: I can see that You are using turnigy 9x. It has 3 analogue knobs. You can use 3 channels to set gains for your control algorithm - this will allow you to experiment with gain settings. Then use one of your Return-To-Zero sticks as a velocity setpoint. This way it will attempt to stop when you release the stick.
I have done inverted pendulum controll for my Masters. This is not all that easy and in fact, you need a specific torque-to-inertia ratio range in your mechanical system, otherwise the system is uncontrollable - both when you have too much or not enough torque per inertia. If the wheels slip - that's even worse. Unless You know about system identification theory and controll design theory, it might take you quite a bit of experimentation to set the gains right.
Alternatively, you can try to use Your existing controll law, and raise the gains on your servo (raise the motor velocity) by such amount that the 'virtual rotation axis' moves above the table. (imagine the wheels running on the bottom inside of a 'big wheel'). This may be enough to keep it in single place, but then, moving it from that place will become difficult . . . . depending on the system dynamics, it might or might not work.
In any case, there is plenty of articles on "inverted pendulum control algorithm" . . . .
Edited by Jurek, 01 November 2012 - 01:27 AM.
Posted 01 November 2012 - 10:21 AM
i don't really know much about that segway problem.. i just thought that the CC3D should have the right sensors to get this thing balanced.. but i don't really know how to get it working
so i'm basically just playing around... i will try later some tuning that Mat sugessted me
Step 1: "more tilt->more acceleration" i think that is what the Kp term ist for?
Step2: will think about that after i got it level.. not sure if i can get it level with my skills... (i can't code new algorithm or anything)
i will post a new video as soon i see some progress
Posted 01 November 2012 - 10:56 AM
as to step 1, no, ditch the Kp altogether. Try this. Put the CC3D in attitute stabilisation mode. Set all gains to zero initially. Then set the first Ki term to some nonzero value, and see how the wheels respond. You might need to set it quite high. I think that this should be the starting point. If this doesn't seem to work in the right direction, start over(zeros everywhere) and try playing with the SECOND Kp (exclusive-or) SECOND Ki. See where this gets you.
If You look at any of these inverted pendulum videos, these carts move very fast and do high accelerations. Your modified-servo wheels might not be able to achieve that, but it's worth trying . . . .
Edited by Jurek, 01 November 2012 - 10:56 AM.
Posted 02 November 2012 - 01:54 AM
after a second tought - yes, it had to be the outer loop Ki.
regarding these small left/right turns, was it you controlling it, or is the slip of your wheels not symmetric?
Posted 02 November 2012 - 06:20 AM
Posted 10 November 2012 - 09:10 AM
that is a BIG mile stone
Help Those That Help Themselves First
Quad - 01 Build Blog (Now Dead)
THE BEAST My RC Lawn Mower Blog
My Eurgle 2.4Ghz 9ch (Turnigy 9x clone)
HEX-01 - Build Log
FPVRaptor Composite 1600mm - Build Log
if i link to hobbyking i use Affiliate links that pay me a few cents each time you use them
Posted 10 November 2012 - 07:03 PM