Help with microcontrollers and making 'em control servos.

cheesehead

Lifer
Aug 11, 2000
10,079
0
0
I'm currently in a Science Olympiad competition which requires a robot that can, by remote control, pick up and move objects. Due to the absurd price of a programmable transmitter/reciever (Futaba 6-channel = ~180$) and speed controllers for the motors (2x Novak Spy ESCs = 100$), I decided to build my own radio gear and electronics. (The robot's already mostly done.)
Anyway, what I need is pretty complex, but hardly impossible with a few PICs. The idea is to have one PIC, which would encode the signal, take the output from two standard "gameport"-connector joysticks and send it through a cheap-o transponder. (These can be found with appropriate recievers for about ten bucks). On the other end, another PIC would decode the signal and turn it into at least two servo outputs (which use PWM) and two variable-voltage outputs, which would control the motors via H-bridges. I'm only farmilar with QuickBASIC at this time, but if someone can link me to some appropriate code, I know some people who can help me cut-and-paste it into a discrete program.
So, can anyone reccomend a PIC for starters?
 

xxXXDeathXXxx

Junior Member
Jun 26, 2005
10
0
0
You don't give any explanation about what precision is necessary. For example: would manual motor full on full off open loop type control be suitable? do you need programmable motions? what kind of speed/position/acceleration error will be acceptable?

I am also confused about where the robot comes from...do you have to invent and build it or do you just need to interface with an existing robot?

What is the range of size and weight of the objects this robot will need to seize and move?

What are the environmental conditions this robot will operate in?

The answers to these questions will help narrow down the types of answers that will make sense for the first questions you asked. It just seems like you haven't given enough information to for someone to really help you out.
 

cheesehead

Lifer
Aug 11, 2000
10,079
0
0
I apologize for the lack of detail. The robot is already (mostly) built; I'm currently trying to make my own transmitter/receiver unit.
I'm hoping to have at least three steps forwards and backwards for each motor. Control will be through H-bridges, so I have no idea what would work and what would'nt.
The robot is of my own design. It's got "tank-style" steering, and uses 2 6-volt motors for moving about. I have yet to recieve the details as to exactly what is required in terms of robotic arms and the like, so I figure that a few servo outputs would cover almost anything I would need to do; four steps in each direction should work, although more would be better.
 

xxXXDeathXXxx

Junior Member
Jun 26, 2005
10
0
0
It is starting to sound to me like what you want will be very complex indeed.

You may want to start studying up on control system theory and more specifically controlling servo motors as it is not a trivial thing. I find it highly unlikely that a canned approach will work, ie drop in this pic code and walla. You will likely need a specialist (not saying you can't be that specialist) to dial in an appropriate system whether homade off the shelf.

Personnaly I can't imagine how you plan to use an H-bridge to do what you want unless it is the final stage of your drive amp or something, although the right PIC with an analog out might be able to drive an H-bridge in it's linear region, I just haven't looked into that. It would definitely take a skilled designer to pull it off if it is possible. Typically servo motor amps/drives are somewhat complex beasts containing several stages.

Another thing you will need to consider early if you plan on going the servo motor route is the type of feedback you will use. From what you say it seems obvious to me you are talking about a closed loop system to accomplish your goals, but maybe some more experienced guru will prove me wrong.

You can try asking me/the others more questions here or offline but I will warn you now... I am certainly not the worlds foremost expert on this subject, and from what you are saying it sounds like this project could get into the real nitty gritty of control system design which is some what of an art form and can take a lifetime to master. I just piped up because it is an interesting subject for me and no one else was saying anything.

If I could give you one piece of advice it would be: why not use some stepper motors instead of servo motors? It would be alot less work to come up with something with stepper motors and they are naturally more suited to the Hbridge type driver you want to use. Servo systems can cost less if you plan on manufacturing many of them but as I said it is a very complex task and getting the first working prototype from scratch could be overwhelming for a beginner.