Author Topic: Number of Microcontrollers Required  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

Offline Builder1Topic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Number of Microcontrollers Required
« on: July 15, 2008, 04:54:44 PM »
Hello Everyone,
I am trying to build a robot and currently I am in the planning phase. Since I am a complete noob to buiding robots, I  ordered a book on PIC Controllers but, it has yet to arrive. I have designed the chassis and the steering system for the robot, so the mechanical part of it is pretty much done. Now, I only need to know how to control the motors with the microcontrollers and that is what I have questions on. My first question is how precisely can I control the number of turns the motors make with a microcontroller? My second question has been asked before but I didn't get any satisfying answers, so I am asking it again. My second question is if I have multiple devices on a robot and they need to be able to communicate with one another, how do I get them to communicate with a microcontroller.  So if I use a motor to drive the robot and proximity sensors for navigation, how do I get them to talk to one another? Are there web materials out there that go into details on how to do this? Please
give me a link to a site on this subject if you know of a good one. I guess I can wait for my book to arrive but I'd like to start learning as soon as possible. Thank you in advance for your response.
« Last Edit: July 15, 2008, 05:09:41 PM by Builder1 »

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: Number of Microcontrollers Required
« Reply #1 on: July 15, 2008, 05:27:51 PM »
You keep phrasing things strangely, which is probably why you haven't gotten a satisfactory answer.  An analogy to the way you're stating your questions would be:

I want to walk down the street.  How do I get my eyes to talk to my feet so they know what to do?

On a robot, your sensors aren't communicating with each other, they are merely providing information to a central processor (or processors) that decides what to do based on that information.  The microcontroller on your robot is like your brain.  In my analogy, the information from your eyes is interpreted by your brain, which then proceeds to issue commands to your legs that cause you to walk.  Similarly, your microcontroller will read data from its sensors and then decide what control commands to send to the motors.  It's up to you to write the program that reads the sensor data, figures out what needs to be done, and then issues the proper commands to the motors.

- Ben


Offline Builder1Topic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Re: Number of Microcontrollers Required
« Reply #2 on: July 15, 2008, 06:58:42 PM »
Hi there Ben,
Thanks for taking the time to answer my questions. I guess I was a little bit vague when I said I wanted to know how to get the sensors and motors to talk to each other. I should have been more specific. What I would like to know when I said " talk to one another" is how do I hook up the sensors and motor to the microcontroller so that the microcontroller can recieve input from the sensors and send commands to the motor to control it. And please answer the following question. Is it possible to precisely control how many turns the motor will make ?  I'm planning to use a rack and pinion type steering system for my robot which is relatively big, so it is crucial that I can precisely control the number of turns the motor makes. Please keep in mind that I am a noob so my questions may not make much sense. Please answer as best you can, thank you again for your input.
« Last Edit: July 16, 2008, 03:23:49 AM by Builder1 »

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: Number of Microcontrollers Required
« Reply #3 on: July 15, 2008, 07:15:15 PM »
If you want to control motor rotation to that degree, you basically have two options:

1) Use a stepper motor with a stepper motor driver.  Stepper motors move in discrete steps so you can control their rotations very precisely.  Stepper motors are used in things like printers and slot machines.

2) Use feedback to achieve closed-loop control of your motor.  Basically you have a sensor or set of sensors that monitor your motor's rotation and you can use this information to precisely control your motor's rotation.  You might want to start by doing some research on encoders.

- Ben

Offline BANE

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: Number of Microcontrollers Required
« Reply #4 on: July 15, 2008, 07:20:49 PM »
From what you told us (as far as motors and rotory encoders) you can use 6 I\O pins.  The first four pins you would want them to  control your dual H-bridge (main motor drivers) and the other two for your opitical encoders (to provide position info).  As for your steering system, I'd recommend a 180 servo, which your going to need a pin that can emit a frequency.

Bane

Offline BANE

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: Number of Microcontrollers Required
« Reply #5 on: July 15, 2008, 07:28:37 PM »
as far as motor control, if you use an dual h bridge that is.
low p0
high p1

something like this will tell the H-bridge to make a motor turn in a specific direction, if you want to reverse the direction then.
high p0
low p1

It really is simple with an H-bridge, also you have to enable the h-brigde which requires ether another I\O pin (ex high p2 = enables motor to be rotated, if low p2 then regardless of p0 and p1 your motor won't go). 

Bane

 


Get Your Ad Here