Balancing Robot (Minimalist Design Using Only Accelerometer)

Anything related to the ROBOT. Head to Toe Magazine.

Re: Balancing Robot (Minimalist Design Using Only Accelerometer)

Postby gilbertgan » Thu Jan 06, 2011 7:35 pm

Hi. Im new here. :lol:

My project differs with TS. My project require me to build a autonomous mobile robot to balance a full cup of water (cap opened) when it's going up a 30degree slope. Im thinking to use a servomotor to turn a acrylic platform, to adjust its angle whenever the inclination changes.

There're other feature as well. Might discuss them at another thread. :)

I have already bought ADXL335 from Cytron. Want to ask, do i need to get gryoscope and involve kaiman filter as well? Seen some tutorial at website that claim kaiman filter not necessary, as it's too complicated. :?

I'm using Pic18f452 and 20Mhz oscillator. And...i got not much knowledge and experience on programming.

But I found out a website. They share their source code. Was thinking to move on from there actually. Then saw this, and worry gyro and kaiman will have to come into the picture. @@

#include <p18f452.h>
#include <adc.h>
#include <stdlib.h>
#include <delays.h>

int result;
int flash;
void main(void)

         //Set Port B Output & Clear
TRISB = 0x00;
PORTB = 0x00;

         //Initialize The A/D Converter
      & ADC_8ANA_0REF,
      ADC_CH0 & ADC_INT_OFF );

         //Flash At The Determined Rate
PORTB = 0x00;
PORTB = 0x01;

         //Get A/D Converted Value
while( BusyADC() );
   result = ReadADC();

            //If Within Normal Range Blink Slowly
if(result > 506 && result < 518)
   flash = 200;
            //If Slightly Tilted Blink Faster
if(result > 518 && result < 550)
   flash = 100;

if(result > 545 && result < 506)
   flash = 100;
            //If Really Tilted Blank FAST!   
if(result >= 550)
   flash = 25;

if(result <= 450)
   flash = 25;



Any advice? :)
Posts: 4
Joined: Thu Jan 06, 2011 7:29 pm

Re: Balancing Robot (Minimalist Design Using Only Accelerometer)

Postby A380 » Fri Jan 14, 2011 6:27 pm

For Kalman filter code, this may help you..
It is free of charge.
User avatar
Posts: 119
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Re: Balancing Robot (Minimalist Design Using Only Accelerome

Postby SnowLeopard » Sat Jan 29, 2011 11:12 pm

Ok. Thank u very much. ^^
User avatar
Posts: 7
Joined: Wed Sep 29, 2010 12:00 am

Re: Balancing Robot (schematic)

Postby ycwong » Thu Oct 20, 2011 2:10 pm


May I know where can get the two wheel balacing schematic diagram that build by cytron.
Posts: 4
Joined: Thu Oct 20, 2011 1:29 pm


Return to ROBOT. Head to Toe Magazine

Who is online

Users browsing this forum: No registered users and 5 guests