Page 1 of 1

MultiWii based balancing robot (Segway)

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

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

Re: MultiWii based balancing robot (Segway)

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

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

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

Re: MultiWii based balancing robot (Segway)

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

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

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

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

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

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

Re: MultiWii based balancing robot (Segway)

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

Re: MultiWii based balancing robot (Segway)

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

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

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

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

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

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

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

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

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

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

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

Posted: 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.

Re: MultiWii based balancing robot (Segway)

Posted: Wed Dec 25, 2019 9:15 pm
by Veteranton
Здравствуйте. Кто может помочь с прошивкой ?

Re: MultiWii based balancing robot (Segway)

Posted: Sat Dec 28, 2019 12:40 pm
by Veteranton
Здравствуйте. Помогите пожалуйста разобраться. Перерыл все форумы и не могу найти ответ на свой вопрос.
Я залил в ARDUIO NANO прошивку BalancingWii не чего не меняя. Работает всё кроме шаговиков. "Смотрел" осциллографом на пинах 5,6,7,8 нет сигнала, На пине 4 (Eneble) есть. Драйвера шаговиков проверял проверочным скетчем, Все крутиться как нужно. В приложении EZ-GUI сделал все по инструкции(установил OUTы как на скрине, откалибровал акселерометр, зашел в управление, подергал джойстик и на пине 4 появился сигнал Eneble, а на 5,6,7,8 нечего(( Подскажите куда копать.
Спасибо.

Re: MultiWii based balancing robot (Segway)

Posted: Sat Aug 29, 2020 2:34 pm
by songbird
Hi, I'm trying to find where the HC-05 bluetooth is used in the code. Can some point me in the right direction?

Re: MultiWii based balancing robot (Segway)

Posted: Sun Aug 30, 2020 10:30 am
by PatrikE
The Bluetooth is just used for connecting it to Gui normally.

Re: MultiWii based balancing robot (Segway)

Posted: Sun Aug 30, 2020 1:13 pm
by songbird
Yes, where can I change it? The android app does not seem to be supported so I wanted to change it to Dabble. However I cannot seem to find it in the source code.

Re: MultiWii based balancing robot (Segway)

Posted: Sat Sep 05, 2020 4:15 pm
by PatrikE
It's done in the serial communication.
And it's based on MSP protocol.

Re: MultiWii based balancing robot (Segway)

Posted: Sat Dec 05, 2020 10:42 pm
by mahowik
Veteranton wrote:
Sat Dec 28, 2019 12:40 pm
Здравствуйте. Помогите пожалуйста разобраться. Перерыл все форумы и не могу найти ответ на свой вопрос.
Я залил в ARDUIO NANO прошивку BalancingWii не чего не меняя. Работает всё кроме шаговиков. "Смотрел" осциллографом на пинах 5,6,7,8 нет сигнала, На пине 4 (Eneble) есть. Драйвера шаговиков проверял проверочным скетчем, Все крутиться как нужно. В приложении EZ-GUI сделал все по инструкции(установил OUTы как на скрине, откалибровал акселерометр, зашел в управление, подергал джойстик и на пине 4 появился сигнал Eneble, а на 5,6,7,8 нечего(( Подскажите куда копать.
Спасибо.
Извините, редко захожу сюда.
Вы скорее всего не сделали арм, т.е. не запустили его.

Re: MultiWii based balancing robot (Segway)

Posted: Fri Jan 29, 2021 4:43 pm
by dsgeorgiev90
Hello all,

I have strange problem. After i upload the the code successfully it is able to connect to bluetooth trough the app. BUT when I try to control it all I do is hearing this loud beeeeeping sound. The motors are not moving at all. Also when I turn it on there is no action from the motors.

In order to complete the project I have used the custom PCB provided here: https://secureservercdn.net/198.71.233. ... 9/HGHG.jpg

The PCB was designed according to this diagram:
https://secureservercdn.net/198.71.233. ... 24x759.jpg

Here are the used parts:

--- Stepper motor:
NEMA 17 - (https://www.benselectronics.nl/stappenm ... ma-17.html)
Electrical Specification:
Motor Type: Bipolar Stepper
Step Angle: 1.8 deg.
Holding Torque: 40N.cm (56oz.in)
Rated Current/phase: 1.7A
Phase Resistance: 1.5Ohm±10%
Insulation Resistance: 100MΩ¸ Min, 500VDC
Insulation Strength: 500VAC for one minute


--- Controller:
A4988 Stepper Motor Driver Carrier
(https://opencircuit.shop/Product/A4988- ... er-Carrier)

--- Battery:
TATTU FUNFLY 1800MAH 11.1V 100C 3S LIPO ACCU
(https://droneshop.nl/catalog/product/vi ... o-battery/)


Please let me know if you have experienced that :)



Regards,
dsgeorgiev

Re: MultiWii based balancing robot (Segway)

Posted: Sun Feb 28, 2021 9:08 pm
by atlas
Hey dsgeorgiev90, I have the exact same problem you described! It's driving me crazy!
Were you able to figure it out?

Re: MultiWii based balancing robot (Segway)

Posted: Mon Mar 01, 2021 9:23 am
by PatrikE
Hi,
Witch firmware are you using?
Original MultiWii don't support the stepper motors!.
You need to use BalancingWii branch.
https://github.com/mahowik/BalancingWii

Re: MultiWii based balancing robot (Segway)

Posted: Thu May 13, 2021 1:05 pm
by Tiger_one
Just finish building the balancing robot using PCB by Alper Kayar. I have SPEKTRUM DX6i using Satellite to control robot.

Cannot arm the robot. I have set the Spectrum to go from HIGH to LOW with AUX1 (flaps).
Tried BT with HC-05 and Samsung app EZ-GUI, connects but no controls or ARM??
20210511_162737#1.jpg

Re: MultiWii based balancing robot (Segway)

Posted: Mon Aug 14, 2023 9:52 am
by jimmygg
Hello!

I am very late to the party but am also attempting this project :) Unfortunately, since EZ GUI groundbase isn't maintained anymore, it no longer seems to work (It is not receiving data from the robot), so I cannot set the AUX pins. I've tried loads of other apps but have not figured it out! Has anyone managed to fix EZ GUI or found another app that works? What is the solution? Thank you all!

FYI I am loosely following Mr Innovative's tutorial (same as dsgeorgiev90 above)