## Balancing Robot (Minimalist Design Using Only Accelerometer)

Anything related to the ROBOT. Head to Toe Magazine.

### Re: Balancing Robot (Minimalist Design Using Only Accelerometer)

Hi. Im new here.

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. @@

CODE: SELECT_ALL_CODE
`#include <p18f452.h>#include <adc.h>#include <stdlib.h>#include <delays.h>int result;int flash;void main(void){         //Set Port B Output & ClearTRISB = 0x00;PORTB = 0x00;         //Initialize The A/D ConverterOpenADC( ADC_FOSC_32       & ADC_RIGHT_JUST       & ADC_8ANA_0REF,       ADC_CH0 & ADC_INT_OFF );while(1){         //Flash At The Determined RatePORTB = 0x00;Delay1KTCYx(flash);PORTB = 0x01;Delay1KTCYx(flash);         //Get A/D Converted ValueDelay10TCYx(5);ConvertADC();while( BusyADC() );   result = ReadADC();               //If Within Normal Range Blink Slowlyif(result > 506 && result < 518)   flash = 200;               //If Slightly Tilted Blink Fasterif(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;}}`

gilbertgan

Posts: 4
Joined: Thu Jan 06, 2011 7:29 pm

### Re: Balancing Robot (Minimalist Design Using Only Accelerometer)

It is free of charge.

A380

Posts: 119
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

### Re: Balancing Robot (Minimalist Design Using Only Accelerome

Ok. Thank u very much. ^^

SnowLeopard

Posts: 7
Joined: Wed Sep 29, 2010 12:00 am

### Re: Balancing Robot (schematic)

Hi!

May I know where can get the two wheel balacing schematic diagram that build by cytron.
ycwong

Posts: 4
Joined: Thu Oct 20, 2011 1:29 pm

Previous