Can anyone suggest how to make a two wheel balancing robot using a multirotor board.
I can't write code so please consider that when replying.
Are you determined on using a Flight control board for a Segway like balancing robot ?
Otherwise you can make a special control board out of arduino and sensors.
yes i know about the uc/acc/hbridge method - i want to use a FC ,
as i have a couple lying around.
i was thinking of using multiwii in airplane mode and using two servos (modified for continuous
rotation) for the drive.
i can also attach a reciever a drive it around.
any drawbacks to the above ?
Seems like a very interesting concept. I would love to see it in action. instructables.com has several self-balancing robots but from what I have seen, they use the Arduino/sensor method. Good luck sir.
@saikat ji, It should be working,
meanwhile, see this, http://www.instructables.com/id/2-Wheel-Self-Balancing-Robot-by-using-Arduino-and-/ (http://www.instructables.com/id/2-Wheel-Self-Balancing-Robot-by-using-Arduino-and-/)
you can even try tweaking the code there to run in multiwii h/w
Hi Saikat,
Wow what a coincidence!!
Me too trying to do exactly the same thing. A self balancing robot using the MultiWii SE 2.0 board. I decided to use this board, as I see lot of similarity between the individual boards setup & this FC board.
I have found links giving info on this. Could be of use to you too,
https://communities.intel.com/message/249321 (https://communities.intel.com/message/249321)
http://forum.arduino.cc/index.php/topic,7943.0.html (http://forum.arduino.cc/index.php/topic,7943.0.html)
http://www.x-firm.com/?page_id=148 (http://www.x-firm.com/?page_id=148)
http://forum.arduino.cc/index.php?PHPSESSID=pgqgui4snvnrj9jl7mmhr9j4n2&topic=8871.0 (http://forum.arduino.cc/index.php?PHPSESSID=pgqgui4snvnrj9jl7mmhr9j4n2&topic=8871.0)
One info I have found out is that servo's don't serve this purpose. You need a motor which has atleast 200RPM minimum for the faster corrections.
I doubt if servo's would give that RPM. I suggest using the DC motors with L293/L298 driver.
If you have already finished this project, please share the details. Else once I complete, will post the update here.
Cheers!
Sudhakar
Hi Sudhakar
yes .. unfortunately servos are not fast enough ... I realised that
only after hacking two perfectly good servos.
I tried fitting CDs as wheels ... reasoning that larger dia would result in faster travel
only worked partially . could balance on a bed (that too not very well) and not at all
on the floor.
next line of action will be to use two brushed motors (speed 300) size and drive
them using two brushless esc flashed to drive brush motor with reverse.
this will let them be driven off a servo pulse.(hopefully)
pls keep me updated on your progress.
why not brushless motors ???
they give ultimate response.
Hi Saikat,
What code did you use for your bot? Did you wrote your own code or used the MultiWii original one?
multiwii original - options changed to #airplane in config.h
does any one have any cheap atmega based brushless ecs (6-10amp) for sale ?
I require two.
.
How would air plane configuration support the balancing bot, air plane has only single motor & balancing bot has dual motors attached.
Can you please explain.
I was trying with Dual copter or BI config which has 2 motors in it. What is your though about it?
the airplane mode can use servos for each wing- I was using servos modified
for continuous rotation with wheels attached instead of normal motors.
dual copter will also work but you will either need motors attached to reversible
esc's or use servos.
for balancing (only) you need both motors to move in the same direction
so it is possible to drive both from a single signal pin using a y lead.
You can use two motor output of a quadcopter ???
you cannot
1. the motors will spin only with application of throttle
2. the motors have to be reversible. (the robot while balancing will move both forward and backward)
yeah I got it,
Why not use a custom firmware with multiwii h/w ?
aah ... the million dollar question.
My knowledge of C+ is very rudimentary - certainly not good
enough to write a program of this level.
Am learning though...
You don't have to be a master in C for Arduino programming.
You can use Arduino codes written by other peoples for this purpose, and tweak it for multywii board :) .
I understood your point Saikat.
L293/L298 boards provide dual motor forward-reverse option for driving DC brushed motors.
L293 can drive 2 Brushed motors b/w or f/w - But this IC can't be interfaced with a multiwii firmware.
You are right sooraj, But we need to design a custom firmware for this driver.
Use a code written for atmega 328 (Arduino UNO) and tweak it to run on multiwii sensor (MPU6050)
Quote from: sooraj.palakkad on December 09, 2014, 09:22:48 PM
Use a code written for atmega 328 (Arduino UNO) and tweak it to run on multiwii sensor (MPU6050)
look at your Reply #4 if you are using L298N, that code should work without modifications for the multiwii boards.
EDIT: Arduino UNO + MPU6050 +HMC5883L + BMP085 - FTDI (redesigned with removed some regulators) = MultiWii SE 2.0
Yeah, I forgot I pasted that link here !.
In that instructables, H/w similar to multiwii board is used. So it's as easy as load and run , but if the configured o/p pins with that f/w is not any of the multiwii motor o/p pins, yo have to either hack the multiwii board or the code (Hi hi, that rhymes !) .
Sorry I am too lazy now to read the code used in that instructables and find which are the o/p pins, but if you couldn't make it out, I can do that :)
Pins in that configurations is D10, D11 (PWM) Pins, same pins available @ multiwii se too (Look at the ESC Connection Pins). So no need to change code for that.
Still you need to change that just modify 4th and 5th line (#define PWM_L 10 #define PWM_R 11) to any of the pwm pins(3,9,10,11 are available) in multiwii se.
Hi Akhilzid,
For the code given in http://www.instructables.com/id/2-Wheel-Self-Balancing-Robot-by-using-Arduino-and-/ (http://www.instructables.com/id/2-Wheel-Self-Balancing-Robot-by-using-Arduino-and-/)
Following are the changes I could see in the definitions as per the attached L293 & Multiwii circuit diagram.
Let me know if you think any thing else need to be changed.
MultiWii Board Peripheral Connection
-------------------------------------------------------------------------
#define LED 13 LED
#define PWM_L 10 L293-Pin1
#define PWM_R 11 L293-Pin9
#define DIR_L1 6 L293-Pin2
#define DIR_L2 12 L293-Pin15
#define DIR_R1 8 L293-Pin7
#define DIR_R2 9 L293-Pin10
#define SPD_INT_L 3//1
#define SPD_PUL_L 4
#define SPD_INT_R 4//7
#define SPD_PUL_R 5
#define MPU_INT 2//0
#define K_AGL_AD A0 Change A0 to A4
#define K_AGL_DOT_AD A1 Change A1 to A5
#define K_POS_AD A2 Change A2 to A4
#define K_POS_DOT_AD A3 Change A3 to A5
-------------------------------------------------------------------------
i think two pin mappings need to change like this.
MultiWii Board Peripheral Connection
-------------------------------------------------------------------------
#define DIR_L2 12 L293-Pin7
#define DIR_R1 8 L293-Pin15
Thanks akhilzid, What about the Gyro/Acc pins is that ok?
The sensors (gyro / acc) are interfaced through I2C, so you don't need to do any thing there :)
Just do the modifications in code as suggested by akhilzid, and you are ready to go !
Cool, Will try out & post my experiences..
Thank you team!!
Best of luck, and don't forget to post a build log so that others could get help from it .
You will not be able drive a l293 just by reassigning the pins in
the multiwii code .
the output for multiwii is ppm - used for driving servos and esc's (using write() and
writeMicroseconds() ) this will not work with l293 which requires PWM.(using digital write() )
You need to change some other parts of the code also - and
please let me know once you have found out.
Hey, dude, you should read the previous posts, we are not speaking about multiwii code, I have given link to a instructible , the code in it can be easily run in multiwii board.
yes .. my mistake
going to try out the program now
Best of luck, :thumbsup:
I tried uploading the code & rigged up the bot, but did not see any movement in bot. (Multiwii+L298+Motors+Battery)
Later I tried uploading the multiwii firmware with airplane configuration, This too did not make any difference. I dont see bot moving or cant even stand. (Multiwii+Single brushed ESC+2 DC Motors+Battery)
But my multiwii board seems to be working fine. I can see that on the multiwii tool.
Not sure what is the issue, will have to check it tonight..
can you post an image/drawing of that wiring?
For L298, I have connected the same way as per definition in code.
I will share the circuit diagram in some time..
does the interrupt pin in the MPU need to be connected ?
i think no, code is using dmp to read values and yes that code is checking mpuinterrupt is active or not but cant find any code that mpuinterrupt is madatory.
Hi Akhilzid,
Sorry for delay, PFA the wiring diagram.
cant see uploaded image, is zero KB? Please re upload.
Edit: Ok, i can see now.
Ok, Just remembered, I have common grounded both boards.
Hi Saikat,
Any luck with your bot?
Mine still having issues using L298.
BTW how did you wire your bot with servos? On multiwii board, which pins did you connect the servos to? Can you please share the schematic of your bot with servos?
HEy, what I have last heard, Akhil eattan (Akhilzid) Already made a prototype ! He send me a video of it last week - but it was not RC then- don't know whether he have added remote control now :)
Wow!! thats a great news... Akhilzid, can you please share the video & the details of bot?
i have ha some success - with servo a amp board driving a l298 from multiwii.
that way I was able to use the multiwii code to drive a l298
i am away now - will post some pics when I get back.
!!Wish You All Very Happy New Year!!
Did you all have any progress on this? Please post your update.
My progress is, wheels rotates to the direction either forward or backward the way multiwii board tilts to. But balancing doesn't happen. Looking into this issue.
Thanks
Sudhakar
here is mine
still need lot of tuning.
http://docs.google.com/file/d/0B83oq3WVM0KWQkRMN3JDU3VieDQ/edit?usp=docslist_api (http://docs.google.com/file/d/0B83oq3WVM0KWQkRMN3JDU3VieDQ/edit?usp=docslist_api)
Good one Akhil.
Can you please share hardware & arduino code details of your build?
Hardware:
Arduino Mega2560 + MPU6050 (Can Replace With Multirotor Board)
Brushed ESC 20A Without Reverse
6v Relay (To Reverse Motor Direction)
Normal Toy Car Brushed DC Motor + Gears + Wheels (Taken as Whole assembly)
Firmware:
MPU 6050 Library
Kalman filter library (Kalman.h) is from https://github.com/TKJElectronics/KalmanFilter Doveloped ByKristian Lauszus.
And some Modifications From Me To Be Balanced.
And the code is attached here.
https://drive.google.com/file/d/0B83oq3WVM0KWMGZzSEhRM19Wb2c/view?usp=sharing
Cool. I will post details of mine soon I am done.
Thanks.
My SBR is up after long effort, still needs lot of fine tuning. Thanks Saikat & Akhil for the info provided.
Here is the test drive link,
http://youtu.be/rUtU7_Cgufg (http://youtu.be/rUtU7_Cgufg)
Cheers
Sudhakar
good progress sir.
increase height of that platform will help balancing better.
Thanks Akhil, Planning to do it over weekend. Will try it & share the progress.
Hey good work man - what motors are those ?
Sounds cool
Thanks Saikat & Roshan,
Its 300rpm 12v motor driven directly from L298 board.
The details of arduino based self-balancing robot are available at https://robu.in/.