James, One thought, and this is what I wish I'd done my first go around, is to build the system that is on the nbot site where he is balancing a pole with a ball on top.. Instead of building this on a robot, build it on a track so that you can work out the details and then they'll all be directly applicable to a balancing bot. He uses a pot for feedback on the pole-balancer, and you could start there and add other sensors as you got comfortable. James On 11/16/05, James Humes wrote: > > One drawback to the pot is that something connected to it is actually > touching the ground as a reference so that affects the overall system. An= y > low-friction, high linearity pot should work okay though. The sin and cos > functions in c18 are for floats, you'll definately want to see how long t= hey > take. > To differentiate and integrate a digital signal subtract and add.. > differentiation is the rate of change from one sample to the next and > integration is the sum of the samples. So to integrate your error, for > instance, just keep up with (in a FIFO buffer) the last several error ter= ms > you've calculated and used in your PID loop and sum them. The length of t= he > buffer is something like the time constant. > James > > On 11/16/05, James James wrote: > > > > Thank you for your reply. I use MCC18 compiler, so it has sine & cosine > > functions. Does the sine/cosine function take a lot of time to execute?= How > > do you integrate or differentiate in C? > > > > Is the pot you mentioned about a special type? The only two types I kno= w > > of are the one with the turn knob and the one with the slider. There mu= st be > > some drawbacks for using the pot, right? Otherwise, everyone would have= used > > it. > > > > Best regards, > > > > James Humes wrote: > > Hey James, > > I set up an ADXL accel. in analog mode for static tilt measurement > > (following the datasheet) about a year ago and it worked fine with only > > a > > little averaging. Differentiate that signal to find the rate of change > > of > > angle. The only thing I could see holding you up is that to calculate > > tilt > > you have to take a sin or cos.. that could limit your sampling rate. > > I have built a balancing robot before (from the same inspirational > > source.. > > nbot) so I'll be happy to offer any experience I have from that. I used > > a > > pot to measure tilt for simplicity. > > James > > > > On 11/16/05, James James wrote: > > > > > > Hi Robert, > > > Thank you for your reply. Are you suggesting to only use the gyro and > > > forget about the accelerator? how about the Freescale accelerator? Is > > it > > > noisy too? Thanks! > > > > > > Robert Rolf wrote: > > > The accelerometer signal needs to be differentiated to get > > > velocity. The ADXL signals are quite noisy so you are better > > > off having a direct velocity signal from a gyro, particularly if > > > using PID control. > > > Robert > > > > > > James James wrote: > > > > > > > Hi everyone, > > > > > > > > I am thinking to build something like the nBot from > > > > David: > > > > http://www.geology.smu.edu/~dpa-www/robo/nbot/ > > > > > > > > I think it would be very cool to put the Feedback > > > > Control Theory I learned to practice. I am currently > > > > gathering information/parts to build the robot. > > > > Anyways, I have few questions: > > > > > > > > 1. Isn't the accelerator alone enough? I mean all > > > > you need to know are how fast the robot is tilting and > > > > the current tilt angle, right? Couldn't the > > > > accelerator alone do all that? > > > > > > > > 2. What's the role of the gyroscope? I understand > > > > that the output voltage change of the gyro is > > > > proportional to the speed or rate of the tilt angle. > > > > Isn't it the same as what the accelerator does? > > > > > > > > I am refering to the DXRS150 gyro and the > > > > ADXL203/MMA7260 accelerators. > > > > > > > > Best regards, > > > > James > > > > > > > > > > > > > > > > > > > > > > > > __________________________________ > > > > Yahoo! FareChase: Search multiple travel sites in one click. > > > > http://farechase.yahoo.com > > > -- > > > http://www.piclist.com PIC/SX FAQ & list archive > > > View/change your membership options at > > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > > > > > > > > > > > --------------------------------- > > > Yahoo! FareChase - Search multiple travel sites in one click. > > > -- > > > http://www.piclist.com PIC/SX FAQ & list archive > > > View/change your membership options at > > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > > > > > > --------------------------------- > > Yahoo! FareChase - Search multiple travel sites in one click. > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist