Jump to content


Photo

Project mini "Segway" CC3D


  • Please log in to reply
29 replies to this topic

#1 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 31 October 2012 - 05:10 PM

Hi,

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

CC/3D                    Revo/OPLink


#2 Mat Wellington

Mat Wellington

    Mix Master Mat

  • Members
  • PipPipPip
  • 1545 posts
  • LocationTaranaki
  • Country: flag of New Zealand New Zealand


Posted 31 October 2012 - 11:06 PM

whats your complete set of settings ? it will need not too much Kp (oscillations) but a fair bit of KI to get it to get back to level

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 :)

#3 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 31 October 2012 - 11:10 PM

thanks Mat for your great input... i will try tomorrow :)

i'll go crazy if that thing goes balance ... even if i know that cc3d does all the work .. it will be a magic moment for me :)

CC/3D                    Revo/OPLink


#4 Jurek

Jurek

    Matlab Guru

  • Members
  • PipPipPip
  • 687 posts
  • LocationGlasgow, UK
  • Country: flag of United Kingdom United Kingdom

Posted 01 November 2012 - 12:52 AM

it looks that your 'virtual axis of rotation' of the pendulum is below the table. In a sense, it's still a pendulum with it's arm up, over the axis of rotation.

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.


#5 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 01 November 2012 - 10:21 AM

That is a lot of information.. thank you Jurek. I see that you know a lot about this..
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 :)

CC/3D                    Revo/OPLink


#6 Jurek

Jurek

    Matlab Guru

  • Members
  • PipPipPip
  • 687 posts
  • LocationGlasgow, UK
  • Country: flag of United Kingdom United Kingdom

Posted 01 November 2012 - 10:56 AM

Felix, the current algorithm that is in the CC3D might not be ideal for segway like problems. But i think that sensors and CPU speed is appropriate.

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.


#7 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 01 November 2012 - 11:02 AM

Thanks Jurek i will try that :)

CC/3D                    Revo/OPLink


#8 juz

juz

    woo hoo

  • Members
  • PipPipPip
  • 4821 posts
  • Country: flag of Australia Australia


Posted 01 November 2012 - 12:03 PM

intriguing :)

#9 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 01 November 2012 - 08:37 PM

thanks guys for the help!!!!!!!!!! i got it :)

it is not perfect... but i can hold it balance for a while and control it with my transmitter a little bit ... so cool! outer loop Ki all the way to 99 :ph34r:

video proof is coming soon

CC/3D                    Revo/OPLink


#10 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 01 November 2012 - 11:22 PM

Settings
Attached File  Bildschirmfoto 2012-11-01 um 22.03.04.png   164.51KB   112 downloadsAttached File  Bildschirmfoto 2012-11-02 um 09.03.45.png   185.19KB   88 downloads

Video

View on Vimeo

Thanks Mat and Jurek for your input!

CC/3D                    Revo/OPLink


#11 k_g

k_g

    Key Member

  • Members
  • PipPipPip
  • 761 posts
  • Country: flag of United States United States


Posted 01 November 2012 - 11:38 PM

Fantastic!!! What's next, a unicycle? :)

#12 Jurek

Jurek

    Matlab Guru

  • Members
  • PipPipPip
  • 687 posts
  • LocationGlasgow, UK
  • Country: flag of United Kingdom United Kingdom

Posted 02 November 2012 - 01:54 AM

Extremely cool!!
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?

#13 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 02 November 2012 - 06:20 AM

i was controlling it with the transmitter, but i can't go very fast and not to agressive(left/right move was maybe the non symmetric servo/frame position or even the table that is maybe not really flat). It is not perfect but it is very cool for the start. I wasn't sure at all after the first day if i'm able to do it.

thanks

CC/3D                    Revo/OPLink


#14 Terrier

Terrier

    Fly Me a River

  • Administrators
  • 6933 posts
  • LocationNashville, Tennessee
  • Country: flag of United States United States


Posted 09 November 2012 - 04:50 PM

Awesome work, Felix! and Mat and Jerek, too! That's just too cool.... B)

#15 Maineiack

Maineiack

    Member

  • Members
  • PipPipPip
  • 3573 posts
  • Locationearth
  • Country: flag of United States United States


Posted 09 November 2012 - 05:20 PM

that is soo cool

#16 Adverse Effects

Adverse Effects

    Team Dropbear - QLD

  • Flight Test Team
  • PipPipPip
  • 3049 posts
  • Country: flag of Australia Australia


Posted 10 November 2012 - 09:10 AM

my hat is off to you mate

that is a BIG mile stone
25/2/2013

Help Those That Help Themselves First

convicted zealot

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

#17 Jake Bullit

Jake Bullit

    Roads? Where we're going, we don't need roads.

  • Members
  • PipPipPip
  • 633 posts
  • Country: flag of United Kingdom United Kingdom


Posted 10 November 2012 - 09:24 AM

Great work:lol:

#18 Felix Da Cat

Felix Da Cat

    ('-' ) (._. ) ( ._. ) ( '-' ) ( ._.)

  • Members
  • PipPipPip
  • 2051 posts
  • Country: flag of Germany Germany


Posted 10 November 2012 - 04:13 PM

thanks guys.. it all comes down to the great community here in the op forum ..always helpful and lots of input

CC/3D                    Revo/OPLink


#19 actionplus

actionplus

    FPV anyone?

  • Flight Test Team
  • PipPipPip
  • 2720 posts
  • LocationRancho Cucamonga, Ca. USA
  • Country: flag of United States United States


Posted 10 November 2012 - 07:03 PM

Well done Felix. Great determination. When are you planning to demo this to the Segway company as a lower cost alternative to their design? :-)

#20 juz

juz

    woo hoo

  • Members
  • PipPipPip
  • 4821 posts
  • Country: flag of Australia Australia


Posted 10 November 2012 - 07:12 PM

Felix, that was awesome to watch. Well done. :)