Protobot - First robot project

i love sandwitch plexygrass

i love sandwitch plexygrass robots

in the past i have tryed a cheap balancing robot, it was made with picaxe 08 and ir diode/photodiode to detect angle…

of course it become the ultimate abort :slight_smile:

you knowledge base is ok, i am sure you robot will work perfectly, have fun!!!

Im not sure about the

Im not sure about the picaxe. Have seen some code from those microcontrollers and after that i totoally ignored them. Probably easier for people without programming skills, but in it didnt appeal to me.

There is a very smart and cheap way to make a balancing robot if you are interested. But in the end you’ll have to add some money to get a good result on this kind of project i think. Of course I dont know since I havent finished it yet, but thats what I assume at least.

Thanks for the nice comment and heads up. You’re robots are very innovativ btw. Like the simple and fun design.

Pretty cool
I think balancing robots are pretty cool. Not yet ambitious enough to build one myself, though.

Hi, Ericski

Hi again, Eric.

Today I’ve come to the point where I tested your Arduino library for the Qik Motor Controller. You’ve done some nice work there and it has made the job of controlling the motors very easy. Find it strange you havent received more comments on it. I did see Pololu linked it on their website - so people will probably start using it with this combination of microcontroller and motor controllers.

Of course I managed to waste a good hour because of a small misunderstanding. Wasnt able to find the mistake 'couse I had done everything right after my own logic. Then I read this on the Pololu forums:

On the qik, the serial pins are labeled from the qik’s perspective, so RX on the qik is the line on which it expects its serial input. Therefore, you should connect TX on your serial adapter to RX on the qik and RX on your serial adapter to TX on the qik.

When I realised the simplicity of my mistake I had to laugh a bit. Almost as much as when I, earlier today, plugged + against + on two battery packs by mistake, but thats a different story :slight_smile:

Enough rambling. Just wanted to say thanks for the work on the library and for sharing it. I’m not sure if it will balance in the end, but it will give me something to do for this summer.

Thanks

I Made the same mistake so I’ll document that better. It is an easy mistake to make. I might try to better encapsulate the NewSoftSerial library for what I think will be the standard deployment (only one NewSoftSerial in use.)

Glad it is working for you. The code base has a few more of the controller’s features implemented but I’m not sure how useful they are (such as changing the PWM frequency.)

Looking forward to watching your progress.

With regard to the drifting

With regard to the drifting issue, are the motors running at full power? When the bot is tilted at an angle and drifting along, the lower half of the platform needs to be able to ‘overtake’ the upper half in order to regain balance. If the motors can’t be driven any harder then you’ll need either:
• More ground speed (faster motors or larger wheels).
• A faster control response, so the bot can correct the tilt before the angle becomes too great.

If you’re feeling like a challenge it could be time to try to master the gyro module, the data from that would allow you to speed up the controller response somewhat.

It doesn’t look like you’re far off having it running smoothly, nice work man!

Hello, Telefox.I dont think

Hello, Telefox.

I dont think its an issue of running at full power, or not the main issue. I believe its an issue of the following; the robot knows how to adjust balance when standing still, but once it gains speed(acceleration) it adjusts to little compared to velocity. Of course you would suggest to just add rate of gyro(angular velocity) to the balanace torque calculations, but I havent managed to get a stable version. What happens is my robot doesnt know it goes at high speed, nor does it always know its not adjusted. If I had a better cam I could have shown exacly how it is. Would make thing kind of easier.

If we look at the code we can see that I’m using the Kalman filter to combine the sensors; accelerometer x-axis and gyroscope. As a byproduct of computing the angle, we also have an ubiased angular rate available. With these readings, theoretically, I should be able to balance my platform. You can look at the balance torque calculations in the code if interested.

Regarding the comment on wheel size, I did some calculations and I think i’m roughly at the maximum diameter related to weight and torque now. If I add bigger wheels my motor torque will be to low compared to what is needed at the force on lever arm(force at wheels). You can look at some of my notes regarding to this, here.

I think I’ll try to figure out a better balance torque calculation, and if that doesnt work out I’ll look at the alternative of getting bigger motors(more rpm and torque) and some wheel encoders to simplify the job. The latter I’m planning on getting sooner or later anyway.

Looking forward to see you build something nice and shiny soon, Telefox :slight_smile:

Ah, my bad, thought you were

Ah, my bad, thought you were just using deadband motor control instead of PWM. Thanks for posting the code, that clears up a lot (like where the pot comes in =D).
Does the platform always tend to drift in the same direction?
In your torque/force calcs, what does 0.22L correspond to?

Hopefully I’ll have a robot worth posting soon, I’ve been working on a bit of an obscure project since I moved house but I keep getting distracted with requests. Once I finish project “stungun suitcase” with one of my friends it’s back on the robot train for me.

This comes out a very cool

This comes out a very cool project! Very well documented and nice to follow the progress. I learned a lot!

Hope you figure out how to stabilize it :wink:

Thanks for the comment,

Thanks for the comment, guibot.

I think learning is often a process of collaborating or at least expressing what you do. It’s easier to understand something yourself if you can explain it. That might sound stupid, but for me its often essential. So documenting the progress is in this case also a part of my learning experience. Which is nice :slight_smile: Of course, sharing will help others as well. I’m very glad to hear you learned a lot. That makes me happy!

My link to the code in the

My link to the code in the update I wrote was probably a bit hard to notice. So i’ll take a note on that and try to structurize my updates better next time. The pot is used different plazes all the time. So mostly for tuning the constantants for debugging. It’s very primitive, but I dont have a 11 pins spare to hook up my LCD - and I dont have the breakboard to connect it via serial.

My platform drifts in the direction its falling. If gravity for some reason adds up on the left side, it will slowly drift that way. When the platform gains some speed that adds to my accelerometer and it thinks its aligned, even though it might tilt at 1 degree. This will cause the robot to drift more and speed up more, and eventually fall over. I’ll try to post a more detailed update before i go to work today.

0.22L is just referring to 22Cm or 0.22 meters. 0.22L is probably not the right way to express this. This isnt used in the current calculations anyway. To be honest, i could have compromized the entire program down to 50~ lines, its just due to ALOT of commenting and also alot of commenting on things I’m not using in its current state, which makes the code big. This makes it easier for myself to work on problems - as I have much of my reference material all in the comments. But I see it can be confusing for you to read.

Not sure what you want with a stungun suitcase, but well, thats your problem :stuck_out_tongue:

That is not stupid at all,

That is not stupid at all, documenting the process is good for the one who creates it and for the others.
I feel that some of my projects would be more rich if I have documented them as you did… sometimes I’m lazy I guess :slight_smile:

thats one well built
thats one well built balancing robot!

Hey Simon, great to see the
Hey Simon, great to see the progress you’ve made since the last big update! Protobot’s motion is a lot smoother than the average DIY balance bot, well done.
So it was the power cable resistance voltage drop that was throwing some of your readings off? Go figure, the simplest problems are always the easiest to overlook.

Hello, Telefox.I’m sorry

Hello, Telefox.

I’m sorry about the lack of updates, but I just havent had the possibility to run down to the public library or local coffee shop each time I found something new. In addition I did move to a new appartment as well. Otherwise I would have kept the public abit more up to date :slight_smile:

Recently I noticed the power cables are causing an awful drop - so I will need to find a better way of providing sensors with fuel. The problem is for example if my 3.3v reference drops to 3.2v or i my 5v drops to 4.65v.This helped me explain drift after a certain amount of time, but wasnt the cause of my troubles getting the platform up balance. That was more of a combination of code/batteries/weigth distribution. Nevertheless, I’m still looking for a way of understanding how to fix the drift I have when soley using the Kalman predictions for my point of balance, since the final platform using the Kalman filter will be 3x times more stable then what i have now(I think).

Kalman or not, my first plan will be to build version nr.2 within a month maybe. Depends on how quick parts arrive etc. and how much trouble i have programming my AVR. Its abit limited what I can improve on my current bot without building a new frame.

thanks might!
thanks might!

the drift

Hey Simon, nice bot!

With regards to the drift you’re seeing, I had the exact same problem on mine. I think just relying on the imu sensor makes it very hard to keep it in balance. I ended up adding a velocity sensor, first by trying to use current sensors to measure the amount the motors were pulling, but found that wheel encoders gave a much better reference.

I have a vid here, if you’d like to check it out ->

http://www.youtube.com/watch?v=l0EFWTlT-BI

The project page I put up for it at zappedlab.com is sorely in the need of finishing, but there’s some details there on my parts list.

Best of luck with version 2!

Thats a very nice and

Thats a very nice and detailed bot you got there. It looks like its dead-stable as well! So good job.

I will make a wheel encoder on my next version so thats allready on my list :slight_smile: Hopefully it will provide me with a more controllable platform, but I dont see how this relates to drift. Of course, once you know you’re moving you can regulate your PID, but I’m still conviced its possible to do this without the encoders soley based on temp/volt reference - since thats the place the drift is caused in the first place. Changes in temperature and volt drop.

That so so bloody stable! i
That so so bloody stable! i may venture into this after i finish my micromouse :stuck_out_tongue:

Try a gyro
may be a little more accurate then an accel.