Page 1 of 1

MultiWii based balancing robot (Segway)

PostPosted: Mon Mar 10, 2014 12:06 am
by mahowik
Hi guys!

http://www.youtube.com/watch?v=U8bBna9iWCU

This is the demo/draft version of balancing robot based on modified/extended MultiWii 2.3 firmware.

Hardware:
- arduino nano (atmega328p)
- mpu6050 gyro-accelerometer (GY_521)
- any RC receiver with CPPM (ppmsum) output
- A4988 motor drivers
- nema 17 stepper motors
- 1/8 Buggy Wheels

p.s. Will be shared on github soon ;)

Re: MultiWii based balancing robot (Segway)

PostPosted: Thu Mar 13, 2014 4:40 pm
by shikra
damned cool

Re: MultiWii based balancing robot (Segway)

PostPosted: Thu Mar 13, 2014 9:40 pm
by Crashpilot1000
Nice little faceplanter. I wonder if segways are absolute faceplant proof...

Re: MultiWii based balancing robot (Segway)

PostPosted: Wed Mar 26, 2014 1:53 pm
by o_lampe
Amazing!
Could this also be done with a brushless gimbal controller and brushless motors?
My bet is, they run smoother and faster too?!

Re: MultiWii based balancing robot (Segway)

PostPosted: Tue May 20, 2014 3:00 am
by mahowik

Re: MultiWii based balancing robot (Segway)

PostPosted: Wed Jun 04, 2014 6:30 pm
by kukizz
Hi.
Is it possible to launch The robot without RC? How to do it?

Re: MultiWii based balancing robot (Segway)

PostPosted: Thu Jun 19, 2014 2:22 pm
by mahowik
yes, it's possible with ez-gui android tool. see experimental features there...

Re: MultiWii based balancing robot (Segway)

PostPosted: Wed Jul 16, 2014 9:36 pm
by ezio
mahowik wrote:yes, it's possible with ez-gui android tool. see experimental features there...

I will add later today better possibility of control. It will be released as beta as it is not finish yet and very experimental.

Re: MultiWii based Segway -> on real RC 1/18 circuit

PostPosted: Tue Sep 30, 2014 8:37 am
by mabaka
http://youtube.com/watch?v=s30CMZcGZ_8

On a real 1/18 circuit, driven by Barbie Harley-Davidson, 1080p.

Not too fast: HTML5 slow motion mode not recommended (better use 2x).

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 3:36 am
by mahowik
Autumn... More time to keep soldering iron and do something cool! So let's continue! :)
Now it's stable 1.0 release of balancing robot.

New features:
- Fall down?! New auto rise (stand up) function! (can be activated via box in GUI).
Now it's also possible to stand up manually when it's fall down.
- Position hold (can be activated via box in GUI).
Try to play, how it returns when you are pushing/kicking the robot.
- Possibility to control/steer from Android device by MultiWii EZ-GUI tool (go to Config -> Advanced -> Model control New)
- More stability and speed accordingly (see in video!)
- Predefined PIDs
- Simple mode for newcomers
- Set of code refactorings and cleaning.

New video:
http://youtu.be/038e2j9nE3M

GitHub:
https://github.com/mahowik/BalancingWii

Blogs:
http://forum.rcdesign.ru/blogs/83206/blog19661.html

Enjoy! ;)

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 3:53 am
by copterrichie
Kudos, job well done.

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 4:04 am
by mahowik
Thanks! :)

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 4:10 am
by copterrichie
Believe it or not, I have a power wheelchair that I am going to try this on. Will keep you posted. :)

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 5:11 am
by mahowik
No no no! Please don't do it! :)
Seriously it too dangerous to trust life to the toys like this!

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 1:10 pm
by copterrichie
No one will ride on the thing, it will be a robot.

LOL, as a point of reference, this is a toy also. ;)

hot_rod-t2.jpg

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Nov 24, 2014 3:15 pm
by copterrichie
You may find this instructable interesting.

http://www.instructables.com/id/Raleigh ... g-scooter/

Re: MultiWii based balancing robot (Segway)

PostPosted: Tue Nov 25, 2014 10:01 pm
by dialfonzo
That's a very nicely done project.
I will have to try it myself.. ;)

Thanks a lot for the hard work.

Eric Nantel - DiaLFonZo

Re: MultiWii based balancing robot (Segway)

PostPosted: Tue Jan 20, 2015 12:26 pm
by mabaka
mahowik wrote:...
New features:
- Fall down?! New auto rise (stand up) function! (can be activated via box in GUI).
Now it's also possible to stand up manually when it's fall down.
- Position hold (can be activated via box in GUI).
...


Excuse me; I can't see any difference in the GUI from the 2.3 distribution configuration. I can't find above boxes.
Moreover, 'fc' shows that your GUI files don't differ from those in the 2.3 distribution.
Maybe I'm losing something.

Question: I have steppers with 5:1 reduction. How can I adapt the software for using them?

Re: MultiWii based balancing robot (Segway)

PostPosted: Sun Feb 01, 2015 9:36 pm
by kukizz
Hi

I did everythink as you described but only mpu and beeper working, HC-06 and motors are not :( .
Sorry my eng.

regards

Re: MultiWii based balancing robot (Segway)

PostPosted: Wed Feb 04, 2015 3:57 pm
by mabaka
kukizz wrote:Hi

I did everythink as you described but only mpu and beeper working, HC-06 and motors are not :( .
Sorry my eng.

regards


Try first the steppers alone.
Code: Select all
//simple A4988 connection
//jumper reset and sleep together
//connect  VDD to Arduino 3.3v or 5v
//connect  GND to Arduino GND (GND near VDD)
//connect  1A and 1B to stepper coil 1
//connect 2A and 2B to stepper coil 2
//connect VMOT to power source (9v battery + term)
//connect GRD to power source (9v battery - term)
/*
Motor driver pins:
- D5 - STEP1 (PORTD 5)
- D6 - STEP2 (PORTD 6)
- D7 - DIR1 (PORTD 7)
- D8 - DIR2 (PORTB 0)
- D4 - ENABLE (for both)
*/

#define LED 13
#define STEP1 5
#define STEP2 6
#define DIR1 7
#define DIR2 8
#define ENABLE 4
#define DELAY 100
#define STEPO 16   // 1, 2, 4, 8, 16
#define STEPS 400*STEPO
#define STEPS2 200*STEPO
int a1, a2;   // separate if used simultaneously

//#define ESPERA delay(DELAY)
#define ESPERA delayMicroseconds(DELAY)

void setup()
{
   pinMode(LED, OUTPUT);
   pinMode(STEP1, OUTPUT);
   pinMode(STEP2, OUTPUT);
   pinMode(DIR1, OUTPUT);
   pinMode(DIR2, OUTPUT);
   pinMode(ENABLE, OUTPUT);
   digitalWrite(LED, LOW);
   digitalWrite(STEP1, LOW);
   digitalWrite(STEP2, LOW);
   digitalWrite(DIR1, LOW);
   digitalWrite(DIR2, LOW);
   digitalWrite(ENABLE, LOW);
}

void stepa1(void)
{
   digitalWrite(STEP1, HIGH);
   ESPERA;
   digitalWrite(STEP1, LOW);
   ESPERA;
}

void stepa2(void)
{
   digitalWrite(STEP2, HIGH);
   ESPERA;
   digitalWrite(STEP2, LOW);
   ESPERA;
}

void loop()
{
   a1 = 0;
   while(a1<STEPS)
   {
      if (a1==0)
      {
           digitalWrite(LED, LOW);
           digitalWrite(DIR1, LOW);
      }
      else
      {
         if(a1==STEPS2)
         {
              digitalWrite(LED, HIGH);
              digitalWrite(DIR1, HIGH);
         }
      }
      stepa1();
        a1++;
   }

   a2 = 0;
   while(a2<STEPS)
   {
      if (a2==0)
      {
           digitalWrite(LED, LOW);
           digitalWrite(DIR2, LOW);
      }
      else
      {
         if(a2==STEPS2)
         {
              digitalWrite(LED, HIGH);
              digitalWrite(DIR2, HIGH);
         }
      }
      stepa2();
      a2++;
   }
}

Re: MultiWii based balancing robot (Segway)

PostPosted: Thu Feb 05, 2015 5:41 pm
by kukizz
Thanks mabaka for your answer.

Your example works perfect.
Additionally i connected HIGH to MS1 and MS2, you didn't write this, without this it is not working.
But I still don't know why The whole of mahowik's finaly product does not work for me.

sorry my eng.

regards

Re: MultiWii based balancing robot (Segway)

PostPosted: Mon Feb 09, 2015 4:46 pm
by mabaka
kukizz wrote:Thanks mabaka for your answer.

Your example works perfect.
Additionally i connected HIGH to MS1 and MS2, you didn't write this, without this it is not working.
But I still don't know why The whole of mahowik's finaly product does not work for me.

sorry my eng.

regards


Note requirement:
A4988 motor drivers with 1/8 microstepping configuration (see http://www.pololu.com/product/1182/ for details)

Above example is only a wiring test. You can modify MS1, MS2 and MS3 connections and lines:
#define STEPO 16 // 1, 2, 4, 8, 16
#define STEPS 400*STEPO
#define STEPS2 200*STEPO
and check influence in total motors rotation each time.

For the real thing, first check if feedback is correct. If the thing falls at the front, motors should move it forward to compensate. If they move it backwards it will fall immediately (invert motors connection or exchange connections).

Then check if the thing follows transmitter sticks. Play with transmitter inverters or connections.

Finally, calibrate accelerometers and stabilize it (level PID). This depends heavily on weights and wheels diameter. In general:
P -> stability.
I -> precision.
D -> speed.

MultiWii based balancing robot (Segway)

PostPosted: Mon Feb 09, 2015 5:57 pm
by argotera
I d like to build a smaller version. Would I have to change anything In order to use smaller nema motors? I mean besides re tuning pids.

P.s. Thanks Mahowik. Really nice project.

Re: MultiWii based balancing robot (Segway)

PostPosted: Sat Feb 16, 2019 5:30 am
by lokesh
Hello,

It is a cool project. I am trying to recreate the entire thing but connections between Bluetooth module (HC05) and arduino nano are unclear, I am confused where to connect the TX and RX pins from HC05 to nano. Please provide some clarity on this.