go_away

Author Topic: First Robot - Help needed :)  (Read 1770 times)

0 Members and 1 Guest are viewing this topic.

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
First Robot - Help needed :)
« on: October 28, 2010, 06:18:12 PM »
Hey :) I only started with robotics couple of days age and already have quite ambitious idea for a robot.
The robot has 3 basic functions:
  • Going in a circle ;)
  • Avoiding walls
  • Going after an object (using edge detection)

The robot itself is very similar to $50 robot (the only difference really is that i don't use electrical design and instead of photoresistors I want to use Sharp IR Range Finder). I did chose that robot mainly because it seems to be quite popular (thus quite a lot of tutorials on it) and also because it's simply cool ;)

I have already finished electronic scheme and design.

>Link to image<
Also i only just started learning how to use CAD software so i apologise for the quality of the design.

The parts are as follow:
  • PRG - Programmer header for PicKit2
  • PIC - Most likely PIC18F1320
  • LEDBAR
  • P1 - PCB Interconnects for battery pack (5V+) used for servos
  • P2 - PCB Interconnects for battery pack (5V+) used for microcontroller/sensors/buttons
  • S1-3 - PCB Interconnects for Servos (HS-322)
  • SRF - PCB Interconnects for Sharp GP2D12 sensor
  • DCJ0202 - DC supply (alternative to battery packs)
  • VR1-2 - Voltage regulators (both 5V)
  • R1-6 - Resistors rated about 295 ohms (or the closest i can find)
  • R7-8 - Resistors rated about 100 ohms (or the closest i can find)
  • SW1-2 - tactile switches (one for run and one for mode changing)
  • SW3-4 - Slide switches for power control
  • C1 - 1000uF 10V Radial Electrolytic Capacitor
  • C2 - 470 10V Radial Electrolytic Capacitor
Servo 1 and 2 are used as motors (modified) and Servo 3 is used to move Sharp IR sensor.
By my calculations I will get 610mA in servo circuit in worse case scenario and 230mA in microcontroller circuit.
Also I thought about op amp for sensor but is this really required?

If somebody could please have a look at this design and verify this has at least a slight chance of working I would be very thankful :)

Thanks.

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: First Robot - Help needed :)
« Reply #1 on: October 28, 2010, 07:27:52 PM »
Nothing jumps out at me.

I believe you'll find it easier to make the board wrong and troubleshoot it than to wait for people to look over your designs  :P
Save yourself the typing. Just call me Zach.

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: First Robot - Help needed :)
« Reply #2 on: October 28, 2010, 07:35:42 PM »
@z.s.tar.gz
Thanks ;) Putting it together and then finding errors is probably going to be the case. As i only started with robotics (and electronics) i wanted somebody to tell me there isn't an obvious error that i made because of lack of knowledge. I didn't have much about electronic engineering in school (yet) and most of my knowledge comes from 2 weeks of reading about it.

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: First Robot - Help needed :)
« Reply #3 on: October 29, 2010, 04:27:03 PM »
don't worry I did the exact same thing when I started with robots. it really comes down to this: unless you've made something really crazy the only way to see small problems is to actually build it.

I guess just remember that error is a part of "trial and error" and you'll be fine  :P
Save yourself the typing. Just call me Zach.

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: First Robot - Help needed :)
« Reply #4 on: October 29, 2010, 05:07:18 PM »
Thanks for that you really got me more confident about that ;) And yeah trial and error works most of the times. Thanks a lot :)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: First Robot - Help needed :)
« Reply #5 on: October 29, 2010, 08:59:44 PM »
Hi,


SW4 should go on the other side of C2

The DC connector shouldn't be shorted in the switch, the purpose of the switch is disconnecting a battery supply when you use an external supply and batteries going *Kaboob* is not funny.

You should use less capacitance on the input of C1 and C2 AND use around 20..25F on the output of the voltage regulators.

I don't see the point in using two voltage regulators and unless there should be a reason that I just cannot dig out of your (slightly confusing) schematic, you should remove VR2 - it won't work anyway, as it isn't grounded as is.

You should use the correct symbol for the controller - if you make a layout for a PCB  from what you have, you're gonna have a hard time plugging in the PIC ;)

You need decoupling caps on the controller supply lines.

Not that it matters a lot, but the connector row marked "PRG" is upside down - it's pin 6 that isn't used (marked "AUX" in some descriptions) and pin 1 is Vpp.

You need to control the unused lines (I'd suggest pulling them to Vdd via 80k to 100k resistors), or you'll see "funny" behavior.


I did got the point that you haven't got much experience with Eagle CAD or schematics in general, so here's a few pointers that would go a long way to make them readable...
- An important, but much overlooked "rule" is that positive supply lines are drawn on top. Most negative supply (here Gnd) is drawn at the bottom. Inputs go on the left and outputs on the right. There will be situations where this is not possible, practical, or plain "misuse" of the drawing area, to follow, but whenever possible... It makes a schematic so much easier to read.
- Using bus lines cut down on the hard to follow wires.
- You are using an unspecified "LEDBAR" without linking to a datasheet or even just making notes of how the LEDs are connected within it. From the schematic I can decrypt that the anodes are on the left and cathodes on the right, but it's not an instant read.
I see that you use two LEDs for "Power Good" signals from the regulators, but as mentioned, you should be able to make do with a single regulator, so, unless you have the bar already, using plain old 3mm LED's makes more sense IMO, as you're only utilizing half the bar (if you get rid of the 2'nd regulator) and bars are usually more expensive than "loose" LEDs.

If, by chance, you don't intend to make a PCB layout from the schematic, you're wasting time drawing it in Eagle - ink and paper is way faster.

If you post the Eagle files ".sch" and ".brd" (if you've made it), I'll fix it up a bit and make it more readable.
Regards,
Sren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: First Robot - Help needed :)
« Reply #6 on: October 29, 2010, 09:08:53 PM »
Did I mention that the best advice is to ask somebody who's not me?  :P
Save yourself the typing. Just call me Zach.

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: First Robot - Help needed :)
« Reply #7 on: October 29, 2010, 09:43:18 PM »
Dear Soeren,

Thanks a lot for your replay :)

The idea about DC and two power supplies was that it would be either DC jack or battery packs connected at the same time, and switches simply enable me to disable any power input instead of plugging them off. However I must admit that knowing me I would be very likely to forget to plug DC jack and watch my battery packs fry ;)

For capacitors you are absolutely right... I just noticed that it should be 1-10uF for every amp (from one of electronic tutorials) NOT 1-10uF for every miliamp... That is a huge failure from me, thanks for pointing it out.

The general idea behind VR2 was that I limit power supplied to servos so that I have a constant one. This would make me feel a bit more secure about my other calculations (such as current drain) and keep things more static in the circuit. I suppose this is not necessary it's just my insecurity showing up. I will go with your advice and remove it.

I am currently considering few microcontrollers (all of them have the same or very similar pinout so it doesn't pose much of a problem) so i didn't put the correct one on the design. The one i am most likely to use is PIC18F1320, I could not however find a footprint for it for EagleCAD.

What rating decoupling capacitors should I get? Do you know any good tutorial about decoupling you could recommend. I did go through two already but the way in which it was explained was very chaotic for me as a beginner.

I didn't notice that PRG was upside down in fairness... Just my inability to spot simple and obvious things. I am sure however that the pins are connected to the right pins on the PCI microcontroller.

The LEADBAR on the item list is linked to the item on onlineshop. I should have made it a bit more visible. The datasheet can be found here: http://www.rapidonline.com/netalogue/specs/55-0190e.pdf
The main reason why I wanted to use LED bars, is because in my opinion it looks better ;) I know its my first robot and it's not going to be all shiny and beautiful but I am trying to keep it neat.

With the board it's a bit more difficult (as to make a scheme for it) situation. I am using 1.6mm thick, stripboard (10cm by 7.5cm). Firstly this enables me to have as many layers as i would only want (as effectively the connections can cross each other as cables are isolated) and I have not got that far in operating EagleCAD. In fairness I am used to using computer for most things in my life. It would probably be a bit easier to use pen and paper to start with but i just feel more comfortable using computer (especially that it gives me experience with CAD software) also if I want to send some design on forum or to friend its easier. My scanner is hid deeply in my room and digging to it might be a problem ;)

*.sch file: https://docs.google.com/leaf?id=0BxQyH5TZT5u1ZWY4YWEwYTktOTdiNy00ZTg1LTkwYTgtMTQyMWFiZWIwOTY2&hl=en
If had some time and could make small changes to it I would be thankful :) On side note if you could also let me know what/how/why have been changed so that i can understand more behind what i did wrong and do it right next time it would be great :) If you dont however find time to play with it it's fine :)

Thanks a lot for all your help it probably saved me a lot of time wondering why this doesn't want to work properly :)

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: First Robot - Help needed :)
« Reply #8 on: October 29, 2010, 10:35:03 PM »
Also what about op amp for sharp IR? Reading datasheet (http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf) output voltage varies between 0.5V-2.5V... Would simple op amp with 2 gain suffice?

Thanks.

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: First Robot - Help needed :)
« Reply #9 on: October 30, 2010, 02:38:49 PM »
Use an analog pin - Sharp IR sensors have nonlinear output, so it wouldn't really be all that helpful to amplify it.  An A/D pin at the PIC's 10bit reading will be fine.  Take a look at admin's IR tutorial for how to code it.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: First Robot - Help needed :)
« Reply #10 on: November 03, 2010, 09:04:06 AM »
Hi,

The idea about DC and two power supplies was that it would be either DC jack or battery packs connected at the same time, and switches simply enable me to disable any power input instead of plugging them off. However I must admit that knowing me I would be very likely to forget to plug DC jack and watch my battery packs fry ;)

OK, it could be switched by the switch in the DC connector (most, but not all have them).
When you plug in an adapter, the battery is disconnected - easy and nothing to remember :)


For capacitors you are absolutely right... I just noticed that it should be 1-10uF for every amp (from one of electronic tutorials) NOT 1-10uF for every miliamp... That is a huge failure from me, thanks for pointing it out.

Caps on a voltage regulator is not so-and-so-much capacity for a given current (I'm not talking about the buffer cap that should follow a transformer supply here). These are to keep the regulator from oscillating and to suppress noise.

For eg. an LM317, around 220 nF on the input and 22F on the output is a good solution, both should be mounted as close to the regulator pins as physical possible.


The general idea behind VR2 was that I limit power supplied to servos so that I have a constant one. This would make me feel a bit more secure about my other calculations (such as current drain) and keep things more static in the circuit. I suppose this is not necessary it's just my insecurity showing up. I will go with your advice and remove it.

Don't worry, just ask if you're in doubt of how to size things :)


I am currently considering few microcontrollers (all of them have the same or very similar pinout so it doesn't pose much of a problem) so i didn't put the correct one on the design. The one i am most likely to use is PIC18F1320, I could not however find a footprint for it for EagleCAD.

I have made a circuit with the PIC13F20. A few connections is still missing on the board, so here is a tentative schematic:

Full resolution
You cannot tell the pins used, as I didn't put it down yet, but the busses got them embedded, so it will come out right in the end.
 I made it with 3 busses (in, out and program), but normally, I'd have made just one bus, as that makes the schematic cleaner. I added a reset circuit (and button) and pull up resistors too.


What rating decoupling capacitors should I get? Do you know any good tutorial about decoupling you could recommend. I did go through two already but the way in which it was explained was very chaotic for me as a beginner.

As mentioned, 220nF and 22F is OK for most regulators. LDO regulators may be a bit more hysterical on values and you need to know the specific type and consult the data sheet - Which one are you planning to use?


I didn't notice that PRG was upside down in fairness... Just my inability to spot simple and obvious things. I am sure however that the pins are connected to the right pins on the PCI microcontroller.

Yes, as mentioned, it doesn't matte that much, it just annoys me, when I have to connect my programmer "reversed" when I make this hickup myself.


The main reason why I wanted to use LED bars, is because in my opinion it looks better ;) I know its my first robot and it's not going to be all shiny and beautiful but I am trying to keep it neat.

Fine with me - I made a symbol for it in Eagle that shows as LED's in the schematic, on the board, it's got the "IC" layout.


With the board it's a bit more difficult (as to make a scheme for it) situation. I am using 1.6mm thick, stripboard (10cm by 7.5cm). Firstly this enables me to have as many layers as i would only want (as effectively the connections can cross each other as cables are isolated) and I have not got that far in operating EagleCAD. In fairness I am used to using computer for most things in my life. It would probably be a bit easier to use pen and paper to start with but i just feel more comfortable using computer (especially that it gives me experience with CAD software) also if I want to send some design on forum or to friend its easier. My scanner is hid deeply in my room and digging to it might be a problem ;)

Well, I find it a waste of time laying out on a PC for stripboard (you can get CAD programs for that as well though) and smaller circuits, I don't even draw ahead when using stripboard.


If had some time and could make small changes to it I would be thankful :) On side note if you could also let me know what/how/why have been changed so that i can understand more behind what i did wrong and do it right next time it would be great :) If you dont however find time to play with it it's fine :)

I do it in between "chores", so it might take a bit longer.
Sometimes, I don't notice why I make a change (I just do it unconsciously, based on decades of working with electronic design), but I'll try to jot it down on the schematic and what I don't, just ask.

BTW. If you like to use the LED from the supply #2, it could be used to show whether it's running on battery or mains. And if you're gonna use rechargeables, a simple charger could be added, so it charges when on mains (with a LED to show that too).
Regards,
Sren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline norfavrellTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: First Robot - Help needed :)
« Reply #11 on: November 05, 2010, 05:03:34 PM »
Hey Sren,
Thanks a lot for your replay ;) Sorry that I didn't write anything for past two days; I just had series of physics tests that needed quite a bit of revision thus I didn't get time too.

OK, it could be switched by the switch in the DC connector (most, but not all have them).
When you plug in an adapter, the battery is disconnected - easy and nothing to remember :)

I did read about it somewhere, but I couldn't find any decent explanation how it works, only how to make it work. Do you have a link to any good explanation of that? (I will search for it again so quite likely I will find something myself but if you have something that could help please share ;))
Also what is +UB symbol on your schematic?

I am slightly confused now. In one of the tutorials (on societyofrobots.com as far as i remember) it said that circuits like that should have two supplies: one for microcontrollers and sensors and one for motors. My idea was to use two battery packs, and additionally add one DC jack. Two battery packs would then go one for microcontroller and one for servos, and in case DC jack was plugged it would server both servos and motors (since my DC supply should be able to cope with sudden changes I decided to just use one DC jack for both purposes instead of two jacks). On your schematic I can see only 1 input for both purposes. Is it my inability to read schematics or is it intentional? Is that rule of having two supplies even valid/important?

As mentioned, 220nF and 22F is OK for most regulators. LDO regulators may be a bit more hysterical on values and you need to know the specific type and consult the data sheet - Which one are you planning to use?

I am planning on using TS7805CZ (datasheet-> http://pdf1.alldatasheet.com/datasheet-pdf/view/100156/ETC/TS7805CZ.html)
I used them for quite a bit and they seem to be quite stable and efficient.

What application did you make that schematic in? Eagle? Looks quite nice like that. ;)

Thanks for help :)

 


Get Your Ad Here