Post by claudep on Aug 14, 2014 15:38:55 GMT -8
Greetings
Question - Can the PI-Bot record the number of rotations that the motor makes?
Discussion -
Recently got my PI-Bot and as a project would like to record a room layout including distance traveled using motor rotation count, gear ratio and tire circumference to get distance traveled. I think this would be better than setting robot speed and measuring time to travel eg 10 ft and using this conversion factor to calculate distance traveled.
The robot would use the sonar sensor on a 45 deg angle (two would be better, one facing side and one ahead.) The robot would start from a corner, and travel recording distance until it reached an inside or outside corner. Eg wall change, furniture, etc. It would then stop, record distance (length of wall) , then make appropriate turn, calculate angle and record or transmit a stream, then proceed along next wall leg and repeat. Inside corners might be a little tricky with only one sensor. The robot would continue until a net angle of 360 deg is reached. (initially doors would be closed) The recorded data could be streamed or uploaded from Stem board. Could also try to send data to Raspberry PI via serial or other port connection. Here is a video I made if you are interested youtu.be/kAMaUuBVK9I
I currently have one of my Raspbery PI's ( B+) setup with opencv using the instructions from this UK group. blog.dawnrobotics.co.uk/2014/06/programming-raspberry-pi-robot-using-python-opencv/
This provides a web interface and their robot includes a pan/tilt camera mount as an option. This is a learning experience but eventually I would like to build my own self balancing, opencv vision capable somewhat autonomous robot. I am currently looking at power packs with built in photo cells. It would be nice to have the robot monitor batter and self charge by finding a sunny spot in the house to recharge itself.
Anyway one step at a time. I expect it will be a while before my goal is reached but everyone has to have a vision.
After building the PI-Bot it struck me that this was like the early days of computers. Like when I got my original Apple ][. Each computer company produced it's own unique computer hardware, OS, software with no interchangeable parts, component standards, cable connectors or fasteners. There were computer clubs to provide support. Assembling the PI-Bot was more like a mechno set with nuts and bolts, tiny wires, no built in cable management or cable standards, no standard mounting or snap in fasteners. Even cars and truck use snap in fasteners. It is a leaning tool but I have build many computers from scratch and at least power supplies, cables, cable connectors, card slots, accessories, Etc. are standardized to a great extent.
The price of computer components, reliability and computing power has steadily improved over the years so that we take things for granted. I believe this is where personal robotics should be heading. All kit building aside. After putting the PI-Bot together and redoing wiring once to get it to work OK, It appeared to me that if personal robotics is to achieve what the PC industry has done, it needs to have standards with USB style plug-in components and sensors, standard high level operating systems, robot app store, standard robot connections, communications protocols, robot training protocols Etc.
At any rate I believe personal robotics has a long way to go.
Thanks for listening
and If someone can answer my distance question, that would be great.
Update - After doing some searching again it looks like motors are pretty dumb and don't provide feedback as far as I can tell. Might be able to put a white tape line on one wheel and have light sensor read each wheel rotation via the white mark on the tire. Cludgy but will give it a try.
Found these www.pololu.com/product/2459 light sensors. Will try them out with one on each wheel that has a stripe pattern on the inside of the tire or hub alternating black and white. This would give a more accurate distance. Problem will be that I may need light source (white LED) since it relies on reflected light and won't work on when it is dark or low light conditions. Hoping beam will be narrow enough to not get false readings. Using one on each wheel will allow calculating radius of turn and average distance to center line of robot. (average distance between each wheel. This might give a more accurate reading. Need to see how hub speed affects reading as well. If the wheel turns too fast then possibility that light pulse will be missed.
Still looking at the possibility of using motor PWM signal to motors to get shaft revolutions. Not sure why rotation counter is not part of motor design. Cost I guess.
Claude Pageau