PDA

View Full Version : TreadBot



dragons_fire
- 10th April 2007, 23:28
Here are a couple pics of the robot im working on. I do this just for fun, and for the challenge of getting it all together and working the way i want it too...

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7965.jpg
the chassis is made from 1/8" polycarbonate and 3 layers of 6oz glass cloth. the wheels are turned from 3/4" aluminum. the battery pack is a 7.4V 730mAh li-poly RCplane battery.


http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7963.jpg
A better pic of the chassis construction. you can also see the hall effect sensor and the magnet in the wheel. i think i will probably add 2-3 more magnets around the wheel for more resolution.



http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7966.jpg
robot with mock-up of PCB. it uses a PIC18F6585 controller, Pololu Micro Dual Serial Motor Controller, Rogue Robotics uMMC Serial Data Storage Module with 1Gig Card, memsic 2 axis accelerometer and a Paralax Ping ultrasonic sensor.


Im still adding 4-8 IR detectors for base station detection, Lynx 433MHz data transmitter, temp and air pressure sensors (just for the fun of it).

so now I need a mission for it and i cant think of anything... the memory card is going to be for mapping data, so it can remember where its been, and easily get back to any of those places. It cant climb stairs and doesnt have enough clearance for outdoor use.

if anyone has any ideas or opinions, i would be glad to hear them...

Danny

skimask
- 11th April 2007, 00:23
Put a couple of IR LEDs on the cat blipping out a signal for the rover and have it follow the cat around ALL DAY!!! Then when the batteries run down, since it's got the house mapped, it can find it's way back to the charging station where it doesn't plug into anything...it 'hovers' over a charge transfer coil (magnetic recharging?)...waits until it's recharged. When it's recharged, it looks thru its map (all the while it's been chasing the cat, it marks where the cat has been the most), goes to the spot or area where the cat usually hangs out and then POUNCES on the cat!

dragons_fire
- 11th April 2007, 01:28
HAHA!!! thats a great idea... Exactly the kind of ideas im looking for... Only probelm is that i dont have a cat (and dont want one), and the dog sleeps on hte couch all day where this thing cant get too...

the mapping idea is just for the challenge of trying it, but im still debating my method of using the revolutions to tell how far its gone.. the room (the main floor of the house) has linoleum, hardwood and a couple rugs.. i can almost guarantee its going to slide trying to go from one to the other.. it looks like i may need to add a compass into it somehow, or add IR transmitters on different frequencies around the room, and have the robot detect them and figure out where it is...

im curious as to what other people think about what it can do, or how to figure out where it is...

dragons_fire
- 11th April 2007, 01:47
we also have the western canada robot games being held in my city, so i was thinking about making it for the minesweeper competition. its a great idea, but i dont think i could have it ready by the competition this year, and i dont want to build it just to wait until next year...

skimask
- 11th April 2007, 02:23
the mapping idea is just for the challenge of trying it, but im still debating my method of using the revolutions to tell how far its gone.. the room (the main floor of the house) has linoleum, hardwood and a couple rugs.. i can almost guarantee its going to slide trying to go from one to the other.. it looks like i may need to add a compass into it somehow, or add IR transmitters on different frequencies around the room, and have the robot detect them and figure out where it is...

im curious as to what other people think about what it can do, or how to figure out where it is...

Mapping - are you using stepper motors or regular 'just add volts and it spins' motors? Regular motors - good luck getting them to spin EXACTLY the same speed to go straight! Not saying it's impossible, but it'll be tough without good electronics. And what happens when the treads slip on the floor? The 'bot could think it's moving forward, when it's actually getting nowhere. Keep an eye on current draw could help with that. Motor draws X current, it's moving normally, motor draws 2X current, tracks are probably hanging up, motor draws .5X current, tracks are probably slipping like they're on ice.

Compass - magnetic compass 'could' work. How about an RF/IR link? A master RF TX sends out a pulse at X intervals, say 10 seconds. 1 second later, an IR LED on wall X1 pulses, 1 second later, an IR LED on wall X2 pulses, and so on and so on. The 'bot 'hears' the master pulse and starts looking for IR pulses. Depending on which IR sensor sees it and at what time, it can figure out which way it's pointing, limited accuracy of course.

dragons_fire
- 11th April 2007, 02:42
the motors are just regular brushed motors, they have a gear ratio of 298:1 which equals out to 71RPM and 30oz/in of torque. im using a serial dual motor controller, and with the hall sensors, i should be able to adjust the motors to get it to move straight forward...

my big issue, is that it will turn better on shiny hardwood, than it will on carpet, so if i tell it to turn 90*, it will turn 95* on wood, and 80* on carpet.. what i was thinking with the IR link, was to have 3 transmitters around the room, and then have 16 (or more) sensors around the top of the bot, and it could somewhat triangulate where it is by the angles to all 3 transmitters. it could do that maybe every 5 minutes, just to make sure its where its supposed to be...

skimask
- 11th April 2007, 02:59
the motors are just regular brushed motors, they have a gear ratio of 298:1 which equals out to 71RPM and 30oz/in of torque. im using a serial dual motor controller, and with the hall sensors, i should be able to adjust the motors to get it to move straight forward...

my big issue, is that it will turn better on shiny hardwood, than it will on carpet, so if i tell it to turn 90*, it will turn 95* on wood, and 80* on carpet.. what i was thinking with the IR link, was to have 3 transmitters around the room, and then have 16 (or more) sensors around the top of the bot, and it could somewhat triangulate where it is by the angles to all 3 transmitters. it could do that maybe every 5 minutes, just to make sure its where its supposed to be...

Motors - That kind of gear ratio sounds a bunch better than direct drive. Should be able to keep track of that fairly well.

Turning/mapping/whatever - too bad a guy couldn't 'easily' add a circuit like an optical mouse. Ya get 2 of those, one at the front in the middle, one at the back in the middle, you can do some math to figure out how far the 'bot actually turned.

This could turn out to be a lllooonnnggg thread...

dragons_fire
- 11th April 2007, 03:38
definately could be a long thread... there are a bunch of different ways to do everything... like figuring out how far it turns... there is: gyros, compass, "mouse balls", hall sensors on the wheels, IR base stations (celestial navigation), and im sure there has to be another 100 ways that i didnt mention...

right now im thinking i might just make it so it hides from light (photophobic) during the day, and then comes out to play at night... at least until i can come up with something better for it to do...

skimask
- 11th April 2007, 03:48
right now im thinking i might just make it so it hides from light (photophobic) during the day, and then comes out to play at night... at least until i can come up with something better for it to do...

Just like in Gremlins...(you said 'mouse balls').

dragons_fire
- 11th April 2007, 04:05
HAHA i havent seen that movie in forever....

mackrackit
- 11th April 2007, 08:29
Turning/mapping/whatever - too bad a guy couldn't 'easily' add a circuit like an optical mouse. Ya get 2 of those, one at the front in the middle, one at the back in the middle, you can do some math to figure out how far the 'bot actually turned.

Why not use a "ball" mouse. xy axis could keep track of turns to. Might take a bigger ball to go across the floor. The optos in the mouse are easy to use too.

dragons_fire
- 11th April 2007, 15:00
i didnt know computer mouses had balls??? i thought they all used lights and lasers!!!!! :P

i like the idea, but i think it would have problems getting up from the hardwood to the rug, (about 1/4" bump) and still be somewhat accurate with out using a massive ball, and i dont really have much room for a big ball...


Not trying to put down all the ideas, im just trying to get some ideas and start a conversation about different ways to do it... its really interesting how many ways there are to do different tasks and some of the weird ways that no one would ever think of.

mackrackit
- 11th April 2007, 20:50
"i didnt know computer mouses had balls???"

That is how you tell the difference, male or female... You really are a NEWBIE:)

The ball and optos could mount on a spring loaded platform in the front or back.

This is an interesting problem, in my work we use doppler radar along with gps for applicators that move across the field at 20 mph. Even then things could end up depending on plowed or disked - satellite coverage - etc- 50 cm off in a couple of km.

Run a "female" mouse over paper with lines and you will see the problems with that. I bet the RF idea with beacons would be the most accurate.

If I think of something very small and cheap will let you know.

skimask
- 11th April 2007, 21:00
Awhile back I had an idea for tracking a push type lawn mower.
I'd put IR LED transmitters in the 4 corners of a square lot, each with it's own pulsing IR code. On the top of the mower would be an IR detector that could move 360 degrees. I slowly go 'round until I saw 1 of the IR LEDs, mark that angle, and keep going until I saw at least 2 of the 4 IR transmitters. As long as I had two angles to work with, I could triangulate my position inside the square lot (ignoring the fact that there are really 2 places an object could be in 2D space using that method, one inside the square, one outside). The more the IR LED transmitters, the better the accuracy, and the better the chances I'll see them if the platform was to somehow get off level.

dragons_fire
- 12th April 2007, 00:19
yup im a newbie... im also almost to young for that kinda stuff!!! haha

it doesnt have to be perfect, its just for fun.,.. im thinking that although i love the size of this thing, it might be a tiny bit too small for experimenting with all this stuff...

Skimask, thats exactly the same thing i was talking about.. haveing a bunch of base stations around, that all emit different pulses, and have the robot decode that, and triangulate where it is...

im hoping i can fit everything into the pic now.. im using the 18f6585 because it had the specs i wanted for another project that fell through... so mow i have it left over, and would like to use it...

heres the specs:
48 k bytes 24 k words
1024 eeprom
53 i/o 12adc

i would just like to say, you guys have all been great. i have been on some other forums (mostly for other stuff like offroading and RC stuff) and people just tell you that there is only one way to do things, and that it wouldnt be worth the effort to attempt to do certain things..

skimask
- 12th April 2007, 00:29
it doesnt have to be perfect, its just for fun.,.. im thinking that although i love the size of this thing, it might be a tiny bit too small for experimenting with all this stuff...

Well, you could always go vertical with the PCBs, stack them with interconnecting header pins for power and use some IR emitter/detector pairs to communicate data, or whatever...then again, that might make the thing too tall to go under stuff...


Skimask, thats exactly the same thing i was talking about.. haveing a bunch of base stations around, that all emit different pulses, and have the robot decode that, and triangulate where it is...

Might be a bit of an MCU intensive process, might involve floating point math, then again, might be able to make it 'just good enough' and not 'perfect'.

As far as the PIC goes, the only thing I see limiting is program space. And when that happens, you could do what I said earlier, offload some processing to a daughterboard vertically stacked.

This almost sounds like too much fun! I outta be building one myself...as soon as my 'lab' in the basement gets done.

dragons_fire
- 12th April 2007, 04:23
right now (without the PCB and components) it will fit underneath 3/4 of the doors in my house!!! the only think that could stop it is stairs!!!

I was thinking i could stack the boards 2 or 3 high, and that would give lots of room for all the sensors and other "gadgets" that i would like to add.. It would also be a lot smaller if i went with all SMT stuff and make everything myself instead of using prebuilt components. at the moment in designing it to use a serial motor driver, which uses a 9-pin header, a pic12f629 and a dual h-bridge chip. if i put the h-bridge directly on my board, and ran it off of the 18f6585, it would be tiny... at the moment, im using it for simplicity, it uses a 4byte command to control direction and speed or both motors.

With the mapping, i was thinging of doing it somewhat like a micromouse would. the room would be divided into little squares, and then it would decide which squares it can go in, and which ones it cant..

i would like to make a list of different "missions" for robots, not just for me, but for anyone else that just plays around with this stuff. to start, here are some of the things im working on, and some others that i would like to make someday:
workin on:
house mapping
cave exploring - lots of old mines around my place
snowplow

others:
photophobic
phottropic
lawnmower
sumo competition
micromouse
firefighting
minesweeping

if anyone has any others, lets hear them... im sure there are lots of other things out there...

dragons_fire
- 12th April 2007, 04:47
this is a neat idea, a little expensive for hobby robotics though....

http://www.robotshop.ca/home/products/robot-parts/sensors/gps-modules/evolution-robotics-northstar-system.html

mackrackit
- 12th April 2007, 09:06
this is a neat idea, a little expensive for hobby robotics though....

http://www.robotshop.ca/home/products/robot-parts/sensors/gps-modules/evolution-robotics-northstar-system.html

Looks similar to Skimask idea, I was going to suggest sonar also. I have a cheap sonar measuring tape that is pretty accurate. Use two to have a location.

Let us know what you plan to use and we will see if we can help.

dragons_fire
- 12th April 2007, 15:56
i was thinkin about using one of those "laser" measuring tapes.. i had a parallax ultrasonic sensor, which is probably not much different (although mine is only good to about 10 feet). i was thinkin about maybe adding a small servo to it, and mount a distance sensor on top, then it could sweep and it would be able to tell what distance at what angle (by using what pulse is sent to the servo).

my motors and motor controller dont arrive here till tomorrow, thats why its all just 'ideas" right now... when they get here, it will be time to start designing the PCB and putting it all together...

dragons_fire
- 13th April 2007, 00:38
so... i ordered some motors and a motor controller from robotshop.ca, and it gave me 3 shipping options... it could come on monday for $6, friday (3 days before) for $10 or thursday for $28.. i picked friday, so i would have them mto play with over the weekend.. well, guess what i just found in my mailbox (its thursday today for those of you who dont know) !!!

so im sitting here putting it all together and thinking.. i need a way to connect all these things together...
up until now, i have always used .10 headers for all my connections such as servos and sensors.. basically everything uses headers.. so my next question is:

does anyone know of any small 2pin and 3-pin connectors, that are smaller than .1 headers?? preferably with digikey part numbers if possible...

thanks again...
Danny

skimask
- 13th April 2007, 04:03
so im sitting here putting it all together and thinking.. i need a way to connect all these things together...up until now, i have always used .10 headers for all my connections such as servos and sensors.. basically everything uses headers.. so my next question is: does anyone know of any small 2pin and 3-pin connectors, that are smaller than .1 headers?? preferably with digikey part numbers if possible...

I would stick with the .1 headers for now, easy to put together, easy to tear apart if/when you make a mistake or a modification....but that's me, I'm crazy that way... As far as the smaller types go, flat flex cable maybe?
Have fun! Don't fry anything...at least anything that's not replaceable!

dragons_fire
- 15th April 2007, 06:16
SO i got my board designed now, and i used the .1 headers. i managed to fit everything on there, plus 18 I/O pins that can go to anoterh board on top. my issues that im having now, are that i dont think i can easily do thru-hole plating at home (i managed to fit everything on the board, using only 5 vias that i will need to solder a pin through), and i took a copy the design to staples for a copy, and they charged me 4 times as much because i wanted it dark, and its not good enough for me to use. now im looking into either getting my own laser printer, or trying out the inkjet transparencies. (i have about 8 injets lying around, they come free with almost everything now. within the next year or two, im sure we will see them at the bottom of cereal boxes!!!)

mister_e
- 15th April 2007, 18:07
transparencies film work great with inkjet printer. That's what i use here. Set your printer to the best resolution mode... yeah slower but better.

I tried laser printer in the past. i gave up, sometimes the toner don't do a nice and perfect job on 10-12mils traces.

Home made Thru-hole plating would be nice... but not a trivial thing. Sure there's some rivet kit available here and there... but it's a little bit expensive for what it worth. Better to outsource your PCB to some cheap PCB fabs.

Good luck!

skimask
- 15th April 2007, 18:11
transparencies film work great with inkjet printer. That's what i use here. Set your printer to the best resolution mode... yeah slower but better. I tried laser printer in the past. i gave up, sometimes the toner don't do a nice and perfect job on 10-12mils traces. Home made Thru-hole plating would be nice... but not a trivial thing. Sure there's some rivet kit available here and there... but it's a little bit expensive for what it worth. Better to outsource your PCB to some cheap PCB fabs. Good luck!

Inkjet? Really? I didn't think that worked at all! I tried the 'Press-n-Peel' method awhile back, used the good laser printer at OfficeMax, was really careful and all that. But it seemed like my problem was with the toner.
Does the ink actually dry on the transparency or do you have to be fairly careful with it (i.e. don't bend it, etc.)? How small are you able to get reliably on the traces and circles and the like?

mister_e
- 15th April 2007, 18:25
I've never had enough guts and patience to try the press and peel method. Yeah i like dealing with chemicals and black-rooms ;)

Depending of your printer, you won't need to care about film handling. I'm a Canon printer fan. I use a IP4200. I print the film, wait 20-30 second (just for safety sake) then do the exposure job.

The ink stick on those film really well, you can bend them as you wish. no real problem. Just make sure you select the right film model for the right printer brand and you're in business.

I'd compare few film brands to see if there's any difference between them. Not really. I use those from staples.

PCBs brand make a difference. Here we can have those from C.I.F (circuit imprimé francais) or MGChemicals. By far, i prefer MGChemicals. Hassle free, work all the time.

dragons_fire
- 15th April 2007, 18:27
i tried a transparency on my injet on the last board i did, it worked amazingly well, nice and dark, with nice edges and all... my printer doesnt have rollers after the printing head, so i dont have to worry about it smudging, i just have to let it dry for 10 minutes after..
unfortunately, with the last board, my overhead got scratched and the board came out bad...

i think what i may try, is getting a laser printer, adn try ironing the toner onto regular (not-presensitized) boards. that way, i can use cheaper boards, and skip some of the chemicals..

mister_e
- 15th April 2007, 18:49
this method may have it's advantage for sure. My biggest concern, and also why it doesn't turn me on, is the precision of your layout alignment when doing a double sided PCB. With transparencies film it's just soooo simple to do.

You place your 2 films on a white sheet (or lightened table if you have any) align them perfectly, stick them together with tape on 3 edge (create a kind of pouch) and VOILA!

Place your film on your exposure gizmo, place your PCB the way you want without having to care about alignment, start neons, few minutes later it's done... on both side!

But yeah... you have to deal with exposure time, chemicals etc... but it's working really well. I did many successful prototype PCB using fine pitch SMD components, i can't confirm if the toner method would work as this well. But as long as it's working for you... life is good :D

If you scratch your film, or you use a fine tip ink pencil.. or simply print it again. Make sure you inspect them carefully first.

If you mess the toner transfer, what happen? is this easy to remove? What is the aprox cost of a toner-transfer sheet?

Films can be reuse again and again.

skimask
- 15th April 2007, 22:06
Place your film on your exposure gizmo, place your PCB the way you want without having to care about alignment, start neons, few minutes later it's done... on both side!

But yeah... you have to deal with exposure time, chemicals etc... but it's working really well. I did many successful prototype PCB using fine pitch SMD components, i can't confirm if the toner method would work as this well. But as long as it's working for you... life is good :D

If you mess the toner transfer, what happen? is this easy to remove? What is the aprox cost of a toner-transfer sheet?

Films can be reuse again and again.

I didn't realize you were using the pre-sensitized boards. I tried that too... used a couple of 15w flourescent bulbs for exposure (not even close to the right equipment to be sure), couldn't really get the hang of it. I suppose it was because of those bulbs I used.
Toner Transfer Sheets $ - they weren't cheap, cheaper than presensitized boards, but a guy still has to buy the blank copper. If you screw up the toner, sure you can take it off with a steel wool pad, but then you have to start over again, transfer it somehow, blah blah blah.
I'd really love to get my hands on one of those Protomat S62's for the house...only $25K with the options...pocket change! NOT! :D

mister_e
- 15th April 2007, 23:21
Yeah it's one of those machine some may want to have hanging on their bench ;)

Maybe your tube haven't the right specs, were to far of your PCB, or your exposure time was not appropriate. You have to use special wave lenght tube (UV). regular Black-light tube (or lamp)have nothing to do with that. I usually pre-heat my tube before for 1-2 minutes.... once again for safety sake.

Once you have did few experiments, you know how much time your exposure time will be... it's almost the same everytime.

At least you will scrap 1 big PCB. if you're using 2-3 tube, this MUST take less than 2.5 minutes.

Start the exposure lamps and hide major part of your whole PCB with an opaque material
wait at least 1.5 minutes
move the opaque material to reduce the 'hidden from UV' PCB area every 5-10 seconds
develop the whole PCB and look where your PCB look the best.
At the bottom of this link, it's almost what i said... but in english :D
http://www.turbokeu.com/myprojects/pcb.htm
Enjoy and have fun with the pcb etching and... drilling job :D

EDIT: i heard some use now ultraviolet LEDs...

dragons_fire
- 16th April 2007, 15:54
the board is done now, and some of the stuff is mounted to it. im using the pic18lf6585, which is the low voltage one (but should work from 2 - 5.5V) and i have a 5V 5A regulator. when i connect the battery without the chip in its socket, everything works fine, as soon as i stick the chip in, the PIC and the Regulator heat up... i havent let the smoke out "yet" but they did heat up lots, and might not be any good anymore... i checked to see if i had Vss or Vdd backwards (so when i put the chip in, it would short out) but everything looks good.

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7999.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7995.jpg

if anyone has any ideas of why its doing that, please let me know.. heres a pic of the bottom of the board on my first attempt with the toner transfer method. the top didnt turn out as good, but there is only 3 traces on the top, and they werent affected.
http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7994.jpg

my last question for everyone is: For PICs that have multiple Vss and Vdd's, do they all need to be connected (they are on this board), or are they connected internally?

mister_e
- 16th April 2007, 16:17
All VSS and VDD have to be connected.

From what i see on your picture, there's few potential traces short-circuit. Assuming there's no routing mistake and the original design worked, You should do a visual inspection first then use you Multimeter.
<img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1538&stc=1&d=1176736238">

Seems to be caused by a lack of etching time or toner transfer... i can't tell.

The overall layout and routing looks good, the final results... so so. I try to avoid 90 degree routing, the etching process work better. It have also other benefits in high frequency.

I also try to avoid unconnected 'ground plane dedicated' copper islands.

Check if there's any polarised capacitor connected backward.

skimask
- 16th April 2007, 16:29
my last question for everyone is: For PICs that have multiple Vss and Vdd's, do they all need to be connected (they are on this board), or are they connected internally?

All Vss's must be connected together outside of the chip, same with Vdd.

And nice job on the PCB...really. The only things I was going to mention...mister_e already covered them...

As far as overheating, with the PIC out of the socket and power disconnected, if you put a meter between any Vss and Vdd, what do you get for a resistance reading? How about a Vf reading (normally seen as a continuity test on a meter when really it measures a diode's forward voltage)... Now try it with the PIC in the socket and power still disconnected?
Then hook up the meter to Vdd & Vss, turn it on volts, put the PIC in the socket, and plug in power just long enough to read the meter. Did the meter come up to system voltage? In other words...dead short somewhere on the board?

dragons_fire
- 16th April 2007, 17:53
As far as overheating, with the PIC out of the socket and power disconnected, if you put a meter between any Vss and Vdd, what do you get for a resistance reading? How about a Vf reading (normally seen as a continuity test on a meter when really it measures a diode's forward voltage)... Now try it with the PIC in the socket and power still disconnected?
Then hook up the meter to Vdd & Vss, turn it on volts, put the PIC in the socket, and plug in power just long enough to read the meter. Did the meter come up to system voltage? In other words...dead short somewhere on the board?

1.036kohm across vdd and vss "with" and "without" the chip. i tried another regulator that isnt mounted to anything, and it comes back with the same reading.

5V without chip, 4.48V with chip

when i put my meter on the doide symbol (i have never used it before and dont know what it is), i get .324V without any power applied to the board (im assuming there isnt supposed to be)

skimask
- 16th April 2007, 18:09
1.036kohm across vdd and vss "with" and "without" the chip. i tried another regulator that isnt mounted to anything, and it comes back with the same reading.

1-ish Kohm... hmmmm...no dead shorts. Something is turned on by the PIC.


5V without chip, 4.48V with chip

Something's loading it down! Try disconnecting the motors? Try disconnecting and unsoldering stuff until you find the 'leak'. Maybe change your program a bit to make absolutely sure nothing is being driven for X seconds before something starts to happen.?.?


when i put my meter on the doide symbol (i have never used it before and dont know what it is), i get .324V without any power applied to the board (im assuming there isnt supposed to be)

Try this with the 'diode' symbol on the meter. Hook the meter up to a plain ol' diode, 1N4148, whatever you've got handy. Whatever the meter reads (within range of course) is what the forward voltage drop of the diode is and if the meter leads are connected correctly. The datasheets on the diode will tell you what the nominal values are. You can also use this function to correctly identify leads on a transistor.

dragons_fire
- 16th April 2007, 18:40
to be honest, when i said everything was soldered to the board, i really meant there a couple things soldered to the board... right now it has the regulator, the PIC, OSC, power switch, headers and i have a diode, resistor and cap on the MCLR pin.. they are connected exactly the way it says too in the march 2007 nuts and volts... mclr goes to the programmer, then there is a diode off of that, with a 4.7kohm resistor to dvv, and a 1uF cap to ground.

it gets so hot so quick, that i havent programmed anything into the pic yet, and because its a plcc, i cant really use my breadboard to try it...

im heading to work though, so if i get a chance, i may look at it some more to see if i can find any shorts on any pins, and make sure i have the mclr stuff on right..

skimask
- 16th April 2007, 19:41
I'll put money on the MCLR diode put in backwards.
Any takers for odds? :)

mister_e
- 16th April 2007, 21:41
i'll bet on at least one I/O short to GND (Vss) or short to another I/O. Try to set all unused I/O to input. But before, remove the PIC, measure impedance between ALL i/o and Vss, then Vdd.

Something suck juice here...

OR, a VSS is connected to VDD and so on... kind of routing mistake

If the MCLR pin was just put backward... the PIC would just act oddly... not suck as this juice.

How about the current measure?

Darrel Taylor
- 16th April 2007, 22:01
I'll put money on the MCLR diode put in backwards.
Any takers for odds? :)

I'll take that bet.

It's got to be the Plethora of shorts that mister_e pointed out in the picture.
<br>

skimask
- 16th April 2007, 22:40
I'll take that bet.

It's got to be the Plethora of shorts that mister_e pointed out in the picture.
<br>


But the poster did say that the regulator/etc didn't get hot until he put the PIC in the socket. Doesn't really make sense to me either. Maybe the stress across a couple of pins on that socket are shorting out only when the chip is in.

mister_e
- 16th April 2007, 22:50
Yes.

Now to clear uyp things... what would happen if the unused pin are set to output... and their initial state is high????

BTW once a PIC becomes hot... his lifetime is already reduced.. if it isn't already finished...

too bad :(

mackrackit
- 16th April 2007, 23:21
Your board looks good for a first try or two. Your problem is like the others said “a short”. Are the stand-offs causing the trouble? Looks close in the picture. An exacto knife or insulator will fix it.

A few more things to keep in mind for the next one.

Traces should be no closer than 0.007 to each other 0.010 is better.

If VSS and VDD are next to each other, try to allow more, 0.010 may not be enough in the long run. Solder will grow “whiskers” over time and cause the gap to close. The more amps the more gap and wider the trace.

Clean all rosin from the board. Rosin will become conductive at elevated temperatures. Then use a sealer when finished testing. Spray lacquer works good to keep the air off.

Think of you board as a capacitor. Components and traces from top to bottom may have a capacitor effect. The large fields of copper that mister e spoke of will add to this problem. For fun you can build high voltage caps from pc board.

Most of all triple check your routing.

You will pick up more as you go.

dragons_fire
- 16th April 2007, 23:27
come on guys, give me at least a little credit... all those shorts he pointed out have been scratched away, and tested with my multimeter..

i looked at it again quickly (while i was stopped at a red light), and i think the diode is the right way, but i did just notice i have a 470 ohm resistor instead of a 4.7kohm. could be part of the problem!!! :) stupid colour codes... too many different ones!!!

mackrackit
- 17th April 2007, 01:46
come on guys, give me at least a little credit...
Easy now, we are not bashing you. Your problem sounds like a short. Sometimes this happens. I have been at this for a long time and just two weeks ago when all of the parts were stuck in the box things started just as you tell us yours is. Guess what. SHORT mashed a wire. Took a while to find it. replaced reg and chip. ..IT HAPPENS.

I normally use a 470 from MCLR to VDD. I know this is not what is recommended but for some reason, can not remember, started doing it a few years back. So I would say that part is OK.

Take you board off of the machine and strip/unplug all you can. Add parts until you see smoke. If you have a box of chips:) Otherwise check solder joints, routing , stand offs, etc. VERY VERY VERY carefully.

Like some one else said, look for somethin external that is hooked up causing the problem.

How are you driving the motors? Are the hooked up when the problem occurs?

dragons_fire
- 17th April 2007, 02:19
i know no one is bashin me... im just jokin around a bit... when nothing is on the board, it works great, as soon as i add the PIC, i get problems. almost nothing is soldered to the board yet, just the essentials to get the pic running.. the reg, plcc socket, mclr stuff, the OSC and a header for ICSP...

i might go back to photoetching my boards, i just got a laser printer, so i thought i would give it a try for the toner transfer method.. this board came out ok for a first attempt at it, but it takes so long to get the paper off after its heated... i do like how i can see the design before i etch it, and if its not good, i just use a bit of acetone and start over... no transparencies (i dont have to go to staples to get them either), less nasty chemicals, ability to start over fairly easily and cheaper boards (because they arent presensitized.. i also dont have to worry about timing and stray light..

reading how others have done it, i used staples photo paper, and it took forever to get off the board. i tired using regular paper, and it seemed to work just as good, so i might experiment with it a bit more too...

it was a late night last night when i was soldering this stuff on... upon closerr inspection, im pretty sure it has to do with my MCLR stuff.. it looks like i might have confussed Vdd and Vss, so i think my resistor goes to ground when i think it should go to Vdd right??? im still in my van workin, so when i get home im going to check all the MCLR connections and make sure i got it right... but im almost positive thats where the problem is.. i cant see any shorts on the board, and everything works great without the PIC..

skimask
- 17th April 2007, 03:25
If VSS and VDD are next to each other, try to allow more, 0.010 may not be enough in the long run. Solder will grow “whiskers” over time and cause the gap to close. The more amps the more gap and wider the trace.
Clean all rosin from the board. Rosin will become conductive at elevated temperatures. Then use a sealer when finished testing. Spray lacquer works good to keep the air off.
Think of you board as a capacitor. Components and traces from top to bottom may have a capacitor effect. The large fields of copper that mister e spoke of will add to this problem. For fun you can build high voltage caps from pc board.


I just got back from a circuit card repair school, 7 weeks, got my Class 3 CCR Tech certificate. I got some serious training on the effects of 'tin whiskers' and old Rosin. Those 'tin whiskers' aren't nothing to play with. Got really good pictures of whiskers approaching 1/8" long after only a year on a PCB. And we took ohm readings across old, warmish rosin, and they were LOW...less than 1K in a lot of cases. Cool class though...


i know no one is bashin me...
Far from it... I'm relatively impressed at the quality of that home-brew board.


upon closerr inspection, im pretty sure it has to do with my MCLR stuff.. it looks like i might have confussed Vdd and Vss, so i think my resistor goes to ground when i think it should go to Vdd right???
Could you post a picture with and without the components? Might be a lot easier for us to help you troubleshoot this...

dragons_fire
- 17th April 2007, 05:25
heres a couple pics of my boards:

first one, an old board from about 2 years ago, made with a sharpie marker.. PIC16F84A robot controller
http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8002.jpg


second one, a board i made about 6 months ago using a presensitized board and on overhead transparency.... GPS interface for robot
http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8003.jpg


third one, the one for this robot, using the toner transfer method...
http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7994.jpg

dragons_fire
- 17th April 2007, 05:32
here is a copy of the board layout im using for this thing, i have modified it a bit since i used it.. im not happy with this one that i made..
looking top down, blue is silkscreen, red is top and green is bottom copper layers.

top left 9-pin header is motor controller (wired properly, not installed yet), big thing in the top middle with 7-pin header is an SD card writer (not installed yet), top right labeled "tilt" is a memsic 2-axis accelerometer (not installed yet), 3-pin header in middle left is switch, right below the switch is the vreg, to the right is a 6-pin and 10-pin and 2 x 2-pin headers to go to top board (not made yet), OSC on right side of Socket, 10-pin header below socket goes to top board. LCD and my ultrasonic sensors arent installed yet..

http://i163.photobucket.com/albums/t305/dragons_fire_photo/scan0038.jpg

Darrel Taylor
- 17th April 2007, 06:21
What regulator are you using?

You said 5V @ 5A

The 5amp TO-220 ones I'm familiar with have Vout on the Tab.
It looks like your tab is connected to ground.
<br>

mackrackit
- 17th April 2007, 11:03
My earlier statement about a 470 from MCLR to VDD is not quite correct for this chip. I have not used this one and after looking at the data sheet for it things are just a little different. VDD does go to MCLR but MCLR on this chip can also be used as an INPUT and has some different characteristics.

If I am looking at your board layout correctly, you may want to look at page 34 of the data sheet. I see MCLR going straight to VDD on your board. Do not know if this is the problem and I am getting a little fuzzy. Been up for 48hrs. :)

skimask
- 17th April 2007, 11:24
first one, an old board from about 2 years ago, made with a sharpie marker.. PIC16F84A robot controller

Lots of fingerprints...gotta clean those boards good before you etch. Pretty nice for a sharpie.


second one, a board i made about 6 months ago using a presensitized board and on overhead transparency.... GPS interface for robot


Lots of extra flux, but no fingerprints I can see. And again, pretty good. 90 degree corners aren't the best though once you start dealing with higher frequencies.


third one, the one for this robot, using the toner transfer method...

Get some rubbing alcohol and those soft acid brushes ( http://www.tecratools.com/pages/assorted/graphics/15215l.gif ) to break down and clean off the excess flux when you're done soldering. That stuff will harden up over time and eat away at everything, as well as possibly cause high resistance shorts (low resistance opens? :) ) over time. In that class I mentioned, they stressed to go ahead and use loads and loads of flux while you're soldering, but also to clean the heck out of it when you're done.

dragons_fire
- 17th April 2007, 15:14
youre right, the vreg im using has an output on the tab. so thats been fixed now, but i still dont think that was part of my probelm, since everything works when the pic isnt in it..

i tired taking out all the MCLR stuff so it doesnt connect to anything, and it still heats up pretty quickly.. im starting to wonder if the chip is destroyed and that causing it to heat up now, or if there is still something wrong..

in the schematic, MCLR is connected through the diode to the resistor and cap. its also connected to the prog pin. i see where you thought it connected to Vdd, but it actually doesnt.. the data sheet i have, its a notes page on page 34. page 35 has stuff about resets and shows the same wiring that i have.

when i etched this board, there is copper on the top too, and some of my pins dont match up perfectly, so there could be a short under the socket. i checked before i soldered, but i could have missed something..

im going to play around with the toner transfer, and see if i can get it any better. if not, i will probably make a new photoetched board.
so changes to the board now are:
vreg tab connected to output,
no more ground planes
MCLR stuff layed out better,
copper pads on top are gone, (except for the top traces)
.01 gap between pads and traces, .02 betweeen traces
more gap between Vdd and standoffs (Vss)

thanks for the comments on the old boards i made.. when i started, i thought the sharpie was the only way to do it, and that it needed sprecial equipment to make boards any other way. the photoetched one, was actually something called RCAP, its an autopilot for RC planes. its an opensource project, and the board layout was straight out of their website. it runs at 2400 baud, so i dont think it will have too many problems with 90 degree corners.

but i will stop typing now and go play with my toner and see what i can do..

skimask
- 17th April 2007, 15:46
i tired taking out all the MCLR stuff so it doesnt connect to anything, and it still heats up pretty quickly.. im starting to wonder if the chip is destroyed and that causing it to heat up now
All of the MCLR stuff? resistor and all?
Chip destroyed - entirely possible it's shorted internally... :(


when i etched this board, there is copper on the top too, and some of my pins dont match up perfectly, so there could be a short under the socket. i checked before i soldered, but i could have missed something..
I wouldn't throw that board out just yet. There's plenty you can do with an exacto knife, fix-it-jumper-wires, and a soldering gun.


so changes to the board now are:
vreg tab connected to output,
no more ground planes
MCLR stuff layed out better,
copper pads on top are gone, (except for the top traces)
.01 gap between pads and traces, .02 betweeen traces
more gap between Vdd and standoffs (Vss)
Nothing wrong with ground planes, as long as they're connected to ground! It's the unconnected ones that may cause trouble. Also, a big slab of copper under a part also makes an effective heat sink, whether it's connected to ground or not. Good calls on the rest of the notes...


it runs at 2400 baud, so i dont think it will have too many problems with 90 degree corners.
It's not the communications at 2400 baud that you'll have trouble with, it's those signals running at 10mhz+ hitting that 90 angle, causing a reflection, that reflection bouncing back on it's input and possibly pulling an input back low somewhere else, or something this or something that.
Don't forget, just because your PIC is only running 10mhz or whatever, each edge of each signal (square wave) is a small chunk of a wave of a much higher frequency (depending on how fast it rises and falls). The higher the frequency, the worse the problems. Suffice to say, 90 bad, 45 good enough, at least it's worked for me up to about 80mhz.

dragons_fire
- 17th April 2007, 16:27
i needed a little sense of accomplishment, so here it is!! it running off of an 877A with a pololu micro dual serial motor driver..




http://i163.photobucket.com/albums/t305/dragons_fire_photo/th_Movie.jpg (http://s163.photobucket.com/albums/t305/dragons_fire_photo/?action=view&current=Movie.flv)

dragons_fire
- 17th April 2007, 18:17
heres the .PCB file (PCBexpress) of my board as it is right now.. if anyone is bored and wants to take a look and see if they can see anything wrong, let me know...

if you have any suggestions on how to make it better, those would be appreciated too..

i think im going to remake the board.. i like making them, its half the fun..


i had to ZIP it or else it wouldnt let me upload it...


thanks for all the help guys.. i like playing with this stuff until i can get it to work... but this time its getting a little frustrating because i cant really seem to find the problem..

skimask
- 17th April 2007, 18:21
heres the .PCB file (PCBexpress) of my board as it is right now.. if anyone is bored and wants to take a look and see if they can see anything wrong, let me know...

A lot of people, myself included, would be more than happy to have a look-see.
Could ya dump the file as a pdf or some sort of 'standard' file besides that PCBExpress file?

mackrackit
- 17th April 2007, 18:36
Skimask- PCB Express is free and a small download, turn layers on and off, nice program.

Dragonfire- by chance have you breadborded this this yet, at least the parts giving trouble? Looking at your layout now.

dragons_fire
- 17th April 2007, 18:45
well, i was thinking about a pdf, but the reason i left it as a PCB is that it will still have the layers... but here it is as a jpg


i think i will attempt a new board, i just wanna make sure everything is good before i do it...

did you watch the video???


http://i163.photobucket.com/albums/t305/dragons_fire_photo/scan0041.jpg

mackrackit
- 17th April 2007, 18:53
Video is good. When it is finished it would make a good kit.

mackrackit
- 17th April 2007, 19:15
Again, I have not used this chip.
The trace I mentioned before was the program trace. But I still think the MCLR part is different than the data sheet, data shows diode going VSS?

Other than that and a few sharp turns, I do not see a problem.

The sharp turn thing also give a real nice place for arcs to show up.
Whats the law? Things in motion want to keep going in the same direction? Even electrons.

dragons_fire
- 17th April 2007, 19:48
im at work now, but i will have a look at the MCLR diode when i get home... like i said, im just going by what the nuts and volts says for ICSP, it may be wrong for this chip.. and thats exactly why i appreciate youre help... because i have never used this chip before either, so im learning lots as i go..

about breadboarding, is there an easy way to put a PLCC on a breadboard?? without making a board with a header than can be plugged into the breadboard???

when you said "kit" i dont know if you meant selling it, cause im just doing this fur fun, but i guess anything is possible...

i will look at the sharp corners... i know they arent good, but i didnt think it was as big of a deal as it seems....

skimask
- 17th April 2007, 21:16
like i said, im just going by what the nuts and volts says for ICSP, it may be wrong for this chip..

If I had a dollar for every one of those magazine articles I've seen that was obviously wrong (well, I'd have about 10 bucks, but the point remains the same).


i will look at the sharp corners... i know they arent good, but i didnt think it was as big of a deal as it seems....

It's not as big of a deal as we're making it out to be....but again, it could kick you in the arse in the future...

P.S. Watched the video...pretty neat stuff...

dragons_fire
- 17th April 2007, 21:39
i just remembered that the MCLR schematic is also in the stuff that came with my programmer... i should look there too!!!

if i had a dollar for everytime something is going to come back and kick my in the arse, i would be rich!! (at least until i die from the viscious arse kickins!!!)

thanks for the comments on the video. the controller does 128 speeds, so i made it ramp up from 0 to 127 with a pause 20 between each step..

i also get an unbelievable amount of noise when the motors are running.. with both going full speed, i cant even make out the picture on my tv. i think i may need to add some caps to the motors..

skimask
- 17th April 2007, 23:03
i also get an unbelievable amount of noise when the motors are running.. with both going full speed, i cant even make out the picture on my tv. i think i may need to add some caps to the motors..

Cap's across the motor may help, but it's probably the result of the frequency of your PWM. What is the freq anyways? Maybe we can help you come up with something a bit higher so you can't hear it (but your dog will go nuts!!!).

dragons_fire
- 17th April 2007, 23:07
could be from the PWM, im using a serial motor driver, to keep things simple.. so i cant "easily" change the freq. its not the "hearing" noise im worried about, its the static (snow) on the tv. im just worried that it may affect my circuit since the motors are only going to be an inch from the board..

skimask
- 17th April 2007, 23:15
could be from the PWM, im using a serial motor driver, to keep things simple.. so i cant "easily" change the freq. its not the "hearing" noise im worried about, its the static (snow) on the tv. im just worried that it may affect my circuit since the motors are only going to be an inch from the board..

The noise showing up on the tv shouldn't affect the motors (ever noticed when you run a blender in the kitchen that the tv in the living room goes nuts?).
Can you 'scope the PWM to the motors or put a meter with a freq reading on it?
Any reason why you're using serial motor drivers? Other than it's already done and one less thing to worry about...which is handy...
And I just thought of something. You said the gear ratio is something like 298:1. All that noise is probably just regular motor noise. How do the motors sound on straight DC battery type power?

Which reminds me...where did you get the tracks? I've been wanting to build another R/C lawnmower and want to drive it with tracks instead of tires...

dragons_fire
- 17th April 2007, 23:44
im using them because they are already done... all i need to do is output a serial command, and the motors drive...

example command:

serout2 motor, motorbaud,[$80,0,lfwd,speed]

$80,0 are commands for the driver. lfwd is left forward. and speed is one of 128 speeds

i send one command and the motor driver keeps it at that speed until i tell it to change.. lots less for the PIC to worry about..

im jsut worried about the "electronic" noise affecting the PIC and other stuff on the board...

my tracks are probably a little small for you... the "tiles" on the floor are 6 inches across, so my tracks are tiny... they came from a tamiya dozer kit, it was the leftover track parts. each side has 3 pieces of track connected together...

when i get home, i will upload a picture of the tracks on one of my other toys... they would be almost perfect for a lawnmower, except that they would rip up all the grass!!!!

dragons_fire
- 18th April 2007, 04:18
heres pictures of my tracks on my bigger robot... (its not really a robot yet, its controlled my RC right now... ) theres a 9v battery on top for a size reference...

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8006.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8008.jpg

this link is for the programmer im using.. its wired almost the same as mine, except they dont have the cap.

http://www.melabs.com/images/icsp1.gif

reading about what they say about ICSP, i need to modify my board some more.. it looks as though i need to connect AVdd and AVss too, and it says i need to pull PGM low with a 100k resistor. i also forgot a cap across the vreg.

skimask
- 18th April 2007, 04:54
this link is for the programmer im using.. its wired almost the same as mine, except they dont have the cap.
http://www.melabs.com/images/icsp1.gif
reading about what they say about ICSP, i need to modify my board some more.. it looks as though i need to connect AVdd and AVss too, and it says i need to pull PGM low with a 100k resistor. i also forgot a cap across the vreg.

You're right on everything you mentioned so far. AVdd and AVss NEED to be tied to Vdd and Vss during programming only. During normal ops, they can be seperated. And pulling PGM low is a good idea (in my mind) whether you are using HV-ICSP or LV-ICSP, maybe throw a jumper in there or something for future 'optionability'.
And put .1uf cap's across every chip, every Vdd/Vss pair, heck throw a couple extra in there when a power or ground trace runs for a few inches without one, if you've got the room for it whether you actually plug one in or not. It'll save you future headaches and give you extra spots to pull a power or a ground.

Since you are wanting to redo your boards, you might want this hint...
For a couple of years now, every time I design a board, I put extra via's on every trace/signal/line/whatever, whether I actually use them or not. Doesn't matter where I put them, I just put them wherever they can fit, and they don't have to be double-sided via's. This way I leave myself a load of future re-config options. I can cut a trace here or there and install jumper wires if I want (or more likely, fix a screw up! :) ).

And those tracks...that's a good idea. I didn't think of putting cleats on chains like that. How well do the chains track over the sprocket when the bolt heads hit the teeth on the sprockets?

Motor drivers - can't argue with that...

dragons_fire
- 18th April 2007, 05:19
my problem with this board, is that i rushed into it, without fully thinking things through, and doing my research.. now that i have done some research, snd thought about this board more, i feel more confident that its going to work.. im also going to omit the pads in the top that arent being used (pcbexpress automatically makes pads on the top and bottom of holes). i have been thinking about the 90 degree angles all evening (ive been installing IPTV all evening, and even using staples that hold the wires snug can destroy the signal.. wires need to have a certain radius for each corner, and cant be kinked...) so i angled some traces so they have 45 degree bends now..

i will upload another copy of the board later, to see what people think..

if you look closely to the sprockets, some teeth are actually cut out to make clearance for the bolt heads. imworking on changing that design too. i think im going to use only one chain for drive, and make some kind of wheel to support the otehr side. the chains dont stay on well now, because it was almost impossible to make both sprockets line up perfectly... i also want to say, its driven by 2 windshield wiper motors, with 3 x 8.5A 12V sealed Gell cells. one for each motor, and one for the headlights.. we have lots of old coal mines and caves around, so its meant to be able to explore them...

skimask
- 18th April 2007, 05:34
if you look closely to the sprockets, some teeth are actually cut out to make clearance for the bolt heads. imworking on changing that design too. i think im going to use only one chain for drive, and make some kind of wheel to support the otehr side. the chains dont stay on well now, because it was almost impossible to make both sprockets line up perfectly... i also want to say, its driven by 2 windshield wiper motors, with 3 x 8.5A 12V sealed Gell cells. one for each motor, and one for the headlights.. we have lots of old coal mines and caves around, so its meant to be able to explore them...

Maybe spot weld those cleats to the top of the chain links?
And the bigger bot---do I see one (or more) of those cheap Walmart wireless camera's (one of those that transmit direct to channel 3) on your shopping list? I've got one of those...works pretty good with crappy antenna's out to about 200ft with a bit of overvoltage at the TX (11.1v vs 9v, 12v w/3 diodes in series).

dragons_fire
- 18th April 2007, 05:57
never seen wireless cams at walmart.. gonna have to go tomorrow... i already have some wireless cams though, and one of them is a lot more powerful than most of the "consumer" ones.. its great havin a "ham" license...

i tried welding the cleats to the chain, but it wrecked the "bearings" in it, and so the chain couldnt "flex" very well. the bolts work great, i used to have 3/4" ones on every second cleat, and there was no way it would slide then. it had some trouble turning though because of it, and it scratched the driveway pretty good.

so do ineed the cap in on the MCLR to ground? or should i just leave it in??

my chip has a max speed of 40mhz but all i have is 20mhz resonators. most equipment on the board is meant to use serial commands at 2400 to 9600 baud. i would also like to experiment with some mapping. would it be worth it for me to run it higher than 20mhz, or do you think it will be fine?

mackrackit
- 18th April 2007, 08:41
im at work now, but i will have a look at the MCLR diode when i get home... like i said, im just going by what the nuts and volts says for ICSP, it may be wrong for this chip.. and thats exactly why i appreciate youre help... because i have never used this chip before either, so im learning lots as i go..

about breadboarding, is there an easy way to put a PLCC on a breadboard?? without making a board with a header than can be plugged into the breadboard???

when you said "kit" i dont know if you meant selling it, cause im just doing this fur fun, but i guess anything is possible...

i will look at the sharp corners... i know they arent good, but i didnt think it was as big of a deal as it seems....
An adapter is the only way I know to board a PLCC making one should be easy or http://www.arieselec.com/products/18014.pdf

Yes, selling it. Looks like something that would get some interest.

BIG BOT looks like a better snow plow than lawn mower:)

I think 20 mHz will work, as you say, the motor drivers free up the PIC.

So your a fellow HAM north of the line, cool.

skimask
- 18th April 2007, 13:27
They're really cheap cams. Resolution isn't all that good, color's a bit off, but they work.

Welding - I didn't think of that. The pins on those chains are probably pretty cheap metal anyways.

MCLR cap - usually, it's there to keep MCLR held off for a split second during power up. The built-in power up timer handles that for 72ms if enabled. And the cap will also help with keeping transient power flux's from tripping MCLR.

40mhz vs. 20mhz - If you've got anything 5-10mhz laying around, try enabling the internal 4XPLL. The board should run at 40mhz, especially since you aren't trying to interface with anything major like static ram or whatever...yet...

dragons_fire
- 18th April 2007, 16:04
i actaully thought about it, there the backup cams arent they?? i have seen them...

we have a wonderful store here called "princess auto", its a surplus store. sprockets were a dollar each, chains were $8 for 6 feet.

it was actually designed as a snow plow, not a lawnmower. we have a driveway big enough for about 6 cars, and its a real pain to shovel it. at no load, the motors run at about 1.4amps each, and when im sitting on it, riding around, it runs at about 3.5 amps each. in a couple minutes, i will upload the new board design, and see what you guys think, then maybe i will make a new one..

dragons_fire
- 18th April 2007, 16:39
heres the board as it is now.. rught below the tilt sensor, i have a resistor, its supposed to be a cap, i just put the wrong symbol, so that has already been fixed..

http://i163.photobucket.com/albums/t305/dragons_fire_photo/scan0035.jpg

let me know if you see anything wrong, i will probably start making it soon.. or if you have any opinions on what i should do differently.

skimask
- 18th April 2007, 17:29
let me know if you see anything wrong, i will probably start making it soon.. or if you have any opinions on what i should do differently.

Nothing wrong that I can, but I think I would make another +5v line run from your regulator up the left side of the board to make a complete loop instead of a half a loop. The way you've got it right now, whatever is at the 'end' of your 5v run will probably pick up a lot of noise, and if it draws any sort of load, it'll really put spikes on the run going back towards the PIC. Might mess it up.
Maybe a 'sprinkling' of .1uf cap's across +5v and ground here and there, if you can fit an extras in there, might not be a bad idea, even if they're surface mount and you have to solder them across the traces themselves. I've done that a few times just as a precaution, used 0805 sized, just laid them right there, no marking or anythiing, just added them in...

And I think it looks much better without all those 90 degree angles in there...

mackrackit
- 18th April 2007, 17:49
I knew it! Been 20 years since I have seen snow, BIG BOT brings back memories.

The board looks good. Agree with Skimask about the VDD trace, if you do not have room put the caps at the end of the run.

skimask
- 18th April 2007, 17:59
I knew it! Been 20 years since I have seen snow

Want me to send you some snow? :D

dragons_fire
- 18th April 2007, 18:09
i think it looks better too without the 90 degree angles.

i added a complete loop around for the power. the thing at the end, was the motor driver. it uses battery voltage for the motors, and 5V for the components on the board..

i also added 2 more caps around the board.

dragons_fire
- 18th April 2007, 18:10
im actually supposed to be getting snow here today.. its gonna be fun workin outside...

i just looked it upo, and we have a snowfall warning here today

skimask
- 18th April 2007, 18:13
i just looked it upo, and we have a snowfall warning here today

Wow! You get warnings! Actually, it's 62F right now for me. Where are you at anyways? I see AB,Ca. I'm in Minot, ND. If you're getting snow right now, we'll probably get it in about 12-18 hours.

dragons_fire
- 18th April 2007, 18:32
right now, its 3.3C wind is 18KM/h and we are supposed to be getting 6" of snow this evening... im in alberta canada...

skimask
- 18th April 2007, 18:33
right now, its 3.3C wind is 18KM/h and we are supposed to be getting 6" of snow this evening... im in alberta canada...

I know you're in AB,Ca...that's why I put AB,Ca. Where at in AB?

mackrackit
- 18th April 2007, 18:58
Want me to send you some snow? :D
NOPE!!! I like my sand. It gets to 120+f here in the summer, but I do not have to scrape it off the windows or shovel/plow it out of the way.

At the moment it is about 85, with a slight breeze:)

skimask
- 18th April 2007, 19:01
NOPE!!! I like my sand. It gets to 120+f here in the summer, but I do not have to scrape it off the windows or shovel/plow it out of the way. At the moment it is about 85, with a slight breeze:)

120+ ... my thoughts... you can always start something on fire to stay warm :D and it's more expensive to cool than it is to heat.
You might not have to scrape the sand off your windows, but, over time, the sand will scrape the paint off your car! :)

mackrackit
- 18th April 2007, 20:15
120+ ... my thoughts... you can always start something on fire to stay warm :D and it's more expensive to cool than it is to heat.
You might not have to scrape the sand off your windows, but, over time, the sand will scrape the paint off your car! :)

Cooling is not as bad as one might think, low humidity.

No paint on car, thats camouflage for us. Half way between Yuma Proving Grounds and Luke Air Force Bombing Range

dragons_fire
- 18th April 2007, 21:47
im in calgary alberta.. when you wrote CA, i thought maybe you thought i was in california..

its just starting to rain/snow right now. thats why i switched from big outdoor robots to making small indoor robots...

im not sure im happy with my battery choice for this bot. its a 730mAh 7.4V li-poly battery. my biggest issue is that its really not good to drain them past 2.5V/cell, so this pack can only go down to 5V. i may need to set up an ADC to measure battery voltage and have it shut down if it gets too low. and that gives me one more thing to worry about,.. i might remake the body so that its big enough to fit an alkaline 9V (its fibreglass and only took about 10 minutes to make). if i go to an alkaline, i cant charge it from a base station though, and nicads or nimh dont have much capacity.. alkalines are just ofver 500mAh at 9V, and the nicads are about 150-200 at 7.2V and nimh are about 300mAh at 7.2V....

skimask
- 18th April 2007, 22:27
i might remake the body so that its big enough to fit an alkaline 9V (its fibreglass and only took about 10 minutes to make). if i go to an alkaline, i cant charge it from a base station though, and nicads or nimh dont have much capacity.. alkalines are just ofver 500mAh at 9V, and the nicads are about 150-200 at 7.2V and nimh are about 300mAh at 7.2V....

You've got the base set up so you can stack PCB's on top of it. Make a board that'll hold a pack of AAA NiMH batteries laid flat and sits on top of your other PCB. They go up to about 700mAh in the AAA types. As far as shutting down at 2.5v/cell on the Li-Poly packs. Easy to set up an ADC pin to handle that for you. Kill the motor drive once you hit about 2.8-2.9v/cell, and that gives you plenty of time to put the thing on a charger. Have it beep or something to let you know.
I most definetly wouldn't go with alkaline batteries. It'll end up like a kids toy...run it for 5 minutes, then change batteries...

dragons_fire
- 19th April 2007, 00:06
i dont really have a problem with stacking it vertically, if i do, i can actually fit about 5 AA batteries (nimh are 1800-2500mAh) which would give me 6 volts for the motors and lots of capacity for it.. and they are rechargeable..
only problem with that is finding a 5-cell holder. or i can make a 5-cell pack, and mountit somehow, but it would be nice to use a holder, cause then i can change them out quickly while im testing...



PS. we have freezing rain mixed with snow now!!!

dragons_fire
- 19th April 2007, 00:12
double post!!!

skimask
- 19th April 2007, 04:03
i dont really have a problem with stacking it vertically, if i do, i can actually fit about 5 AA batteries (nimh are 1800-2500mAh) which would give me 6 volts for the motors and lots of capacity for it.. and they are rechargeable..
only problem with that is finding a 5-cell holder. or i can make a 5-cell pack, and mountit somehow, but it would be nice to use a holder, cause then i can change them out quickly while im testing...

PS. we have freezing rain mixed with snow now!!!

And it's heading my way!

Swap the AA's for AAA's and you'll get a few more volts for the motors.
Less capacity, but maybe you can parallel them...

dragons_fire
- 19th April 2007, 04:38
thats what i did... i just picked up 2 x 3-cell AAA holders.
im going to change stuff around a bit, and add the switch and Vreg to the board with the battery holders..

skimask
- 19th April 2007, 04:47
thats what i did... i just picked up 2 x 3-cell AAA holders.
im going to change stuff around a bit, and add the switch and Vreg to the board with the battery holders..

And then...and then...and then...you could...ummm...ummm...put another PCB on top of that one...and then...and then...and then...put 9v worth of small solar cells on that...to..umm...ummm...umm...trickle charge the AAA's...

Are you planning on using a linear reg or switch mode?
Check out the LM2825-xx types. Self contained, DIP28/.6", a bit thicker than normal DIP28 types, but have the coil and everything inside the package. And it'll save you some power.

dragons_fire
- 19th April 2007, 05:16
to be honest, i dont really know much about voltage regulators (or anything). im using this reg: http://www.st.com/stonline/products/literature/ds/9035/LD1084.pdf

it may not be the best, but ive used them before, and i have some laying around...

and... and... thats why there is so many headers with pins going nowhere right now.. just so i can add more boards on top...

should mention i did look at solar panels.. one the size of this robot, would output around 20mA at 6v. just not worth it.. it would take forever for that to charge enough...

skimask
- 19th April 2007, 13:31
to be honest, i dont really know much about voltage regulators (or anything). im using this reg: http://www.st.com/stonline/products/literature/ds/9035/LD1084.pdf
That's a linear regulator, but it is a low-drop-out type. Don't know how much you know about regulators, quick explanation:

Linear - takes voltage in, say 10v @ 1amp, you want 5v @ 1amp, it dumps off 5v @ 1amp as heat, 5watt wasted...in this case, 50% efficient.

Low Drop Out - All regulators need some overhead to work right. A 5v regulator might need 7v at full load to work, below that, things go haywire. A Low drop out type might only need 5.5v input under the same conditions

Switch mode - takes that same voltage in, turns a mosfet on/off really fast and uses an inductor to help keep an output cap charged up to the regulated voltage, but there's just a tad bit of ripple on the output (which can be smoothed out). It's not 100% efficient, but depending, they can approach 98% under the right conditions.


should mention i did look at solar panels.. one the size of this robot, would output around 20mA at 6v. just not worth it.. it would take forever for that to charge enough...

Well, I was just thinking that there will be days when it's sitting not doing anything...and if you had any laying around, they'd help...

dragons_fire
- 19th April 2007, 15:13
to be honest, i really dont know that much about electronics in general.. i learn by seeing what other people have done, and putting stuff together and trying it till it works..

that switch mode regulator, cost almost 20 times as much, and i dont really have much room on my board for it, (it looks like its about 5 times the size).

we have lots of floor area that gets sun most of the day, so its not entirely out of the question for solar panels.

skimask
- 19th April 2007, 15:32
that switch mode regulator, cost almost 20 times as much, and i dont really have much room on my board for it, (it looks like its about 5 times the size).

Guess I should've checked the price before I mentioned it. Digikey is getting $30USD for them nowadays. Back when I bought them, they were only about $8USD. There's got to be a better option out there.

dragons_fire
- 19th April 2007, 18:18
so here it is... power board is done, and works great... the main board underneath, is the old one thats not working.. i havent made a new one yet..

batteries are duracell AAA 1.2V 1000mAh. i havent measured current draw on the motors, but the datasheet says 50mA no load...


http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8016.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8011.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_8017.jpg

dragons_fire
- 21st April 2007, 18:13
new board is made, it turned out a hole lot nicer. everything powers up ok except for when i put the chip in.. i did find a short in the old board, so maybe my PIC is destroyed and thats why its not working now..

i measure "open" across vss and vdd with no PIC, and 1M ohm with PIC.

i dont know what im doing wrong, ive been over the pin-outs a million times, and everything seems right..

dragons_fire
- 21st April 2007, 19:59
i just realized that im using a PIC18LF6585, not an 18F6585. from what i have read in the dtasheet, the only difference is that the LF will work at lower voltages, but i think it will still work at 5V.. does anyone know if thats true or not?? if its not meant to run at 5V, then that would explain my problem...

i dont get any heat now, but it pulls my voltage down to about 2V when the PIC is in it...

mackrackit
- 21st April 2007, 21:49
I can not comment about the differences in the two chips.

Have you used this v-reg before? This is one part you may want to breadboard. I looked at the data sheet and did not see a minimum voltage, are you sure the batteries are charged. Try putting a known load on the v-reg and watch the output. Could be something wrong with the v-reg or cap size.

It still might be a good idea to build an adapter and bread board the PIC. Try another power supply.

Just looking back to basics. To many variables going straight to finished product.

dragons_fire
- 22nd April 2007, 03:09
i just used my "power board" to power a 16f877A, the motor driver and both motors.. works good.. i would prefer to use teh 18f6585 because of # of I/O, memory size and speed..

i might just go back to using a 877A for now, just because i know i can work it..

i just dont know what else to do to get this 18f to work...

skimask
- 22nd April 2007, 06:34
i just used my "power board" to power a 16f877A, the motor driver and both motors.. works good.. i would prefer to use teh 18f6585 because of # of I/O, memory size and speed.. i might just go back to using a 877A for now, just because i know i can work it..
i just dont know what else to do to get this 18f to work...

You've got a 6 cell NiMH (or NiCad, doesn't really matter). Open circuit, they've probably got 1.3-1.4v per cell when fully charged. You put a load on them, they'll probably drop down to, say, 1.1v per cell, maybe less. As I stated earlier, with a regular linear regulator, you need a certain amount of 'voltage overhead' to keep the regulator working correctly...usually about 2 volts. Anything less and your regulator basically freaks and starts outputting a lot less voltage.
So, you've got that 6 cell pack, roughly 6.6v under a load, more likely less since you're driving motors (50mA no-load doesn't mean squat when you're trying to drive this thing around).
Looking at that datasheet you linked to earlier (Page 11, Figure 11), you need at least 6.1v @ 1.5amps of load to keep the regulator happy.
Try this for grins... lift the Treadbot up so it's wheels can free spin, power it up and see what your voltage is.
I'm thinking that you're going to have to run an 8 cell pack of AAA's instead of 6 AA's.

dragons_fire
- 22nd April 2007, 06:53
well, right now my power board works great with a 16f877a, the motor driver and the motors. (both motors togetehr are around 200mA at full speed). when im playing with the 18f6585, i dont have the motors, motor driver and all the other little stuff isnt hooked up. just the pic and an led!!! when i measure the resistance across the board, (with the PIC in) i get about 1 Mohm. input voltage is around 7.4 (fully charged cells). but ohms law says that 5V going through 1Mohm, there is almost no current... not a short... even when i hook my multimeter up, it shows no current.. but the voltage drops right down to around 2V

mackrackit
- 22nd April 2007, 07:05
The PIC that is giving trouble is the same one that was in the boad with a short?

What is the exact part number of the PIC giving trouble? I will get one or two and try.

skimask
- 22nd April 2007, 07:19
well, right now my power board works great with a 16f877a, the motor driver and the motors. (both motors togetehr are around 200mA at full speed). when im playing with the 18f6585, i dont have the motors, motor driver and all the other little stuff isnt hooked up. just the pic and an led!!! when i measure the resistance across the board, (with the PIC in) i get about 1 Mohm. input voltage is around 7.4 (fully charged cells). but ohms law says that 5V going through 1Mohm, there is almost no current... not a short... even when i hook my multimeter up, it shows no current.. but the voltage drops right down to around 2V

Ok, all notes noted....
You're using a '6585 now...
You didn't by chance get the pinouts between the TQFP and PLCC pinouts mixed up did you?

dragons_fire
- 22nd April 2007, 15:47
yeah, i was trying to use a 6585... i did use the pLCC pinouts. i need to look into that some more though, cause i was thinking that maybe my pins dont match.. in expresspcb, when i click on a pin, it tels me the #, i think maybe its wrong, or it might be different than my socket, and that could be causing my problem..

nothing heats up anymore, i just lose voltage, and my "power" LED dims. maybe this PIC is shot from my mess up earlier, that its not allowing things to work now..

i put this project on hold for the weekend, im building a lightning trigger for my DSLR camera. sensor works great on the breadboard, im just trying to figure out my optoisolator to keep my circuit seperate from the camera... im using a 16F88 for this (i was going to use a SMT 12F675, but i have lots of room and lots of 88s).

im still thinking about my robot, so i didnt give up on it, so im open to any suggestions.. im trying to avoid making an adaptor to breadboard it first.

Darrel Taylor
- 22nd April 2007, 23:14
Hey Dragon,

It appears that all the VDD and VSS on your PCB are backwards.

Here's a 68-PLCC socket and 18F6585 pinout

<table><tr><td valign=bottom>http://www.pbpgroup.com/files/68-PLCC.GIF</td><td valign=top>http://www.pbpgroup.com/files/18F6585.GIF</td></tr></table>

and here's your PCB

http://www.pbpgroup.com/files/TreadBotPCB.jpg

I haven't checked the rest of the pins.

HTH,

Added: Oops, and PIN 49 is VDD

AddedMore: No doubt the original chip is Fried.
<br>

mister_e
- 23rd April 2007, 01:25
:D that confirm my thoughts 72-73 post ago :D

dragons_fire
- 23rd April 2007, 01:26
thank you so much!!! i have been over this board so many times, with the datasheet in one hand, and the schematic in the other..

i new it had to be something stupid like that, i just couldnt find it..

i definately feel like a retard now!!! 2 different boards (designed from the beginning both times) and a weeks worth of going over and measuring..

thanks again!!!

mister_e
- 23rd April 2007, 01:29
**** happen my friend. I guess you will'nt do it again :D
http://www.mister-e.org/Pics/explosion2.gif

Darrel Taylor
- 23rd April 2007, 01:51
http://www.darreltaylor.com/files/ROFL.gif

Never done THAT before. :rolleyes: ... Yes I have.
(that's how I knew to look for it)
<br>

dragons_fire
- 23rd April 2007, 02:01
it is actually my first time doing that... but im sure it wont be the last..

at least i enjoy making the boards, i think its part of the fun. i also only soldered on the basics, so its not much of a loss of money...

i cant believe i didnt notice it.. i started from scratch on the second board, and i still didnt get it right...

thanks again!!

skimask
- 23rd April 2007, 02:48
it is actually my first time doing that... but im sure it wont be the last..
at least i enjoy making the boards, i think its part of the fun. i also only soldered on the basics, so its not much of a loss of money...
i cant believe i didnt notice it.. i started from scratch on the second board, and i still didnt get it right...
thanks again!!

Good..you found the problem!
You would think it wouldn't be that hard to cut some traces and run a few jumpers to fix the board. It's not optimal, but it should work.

dragons_fire
- 23rd April 2007, 03:13
it may not be too hard to cut some traces and run a couple jumpers.. i like having everything nice and clean.. and like i said, i enjoy making the boards... later on, i will try to post a pic of my 16f88 controlled lightning trigger for my camera. seems to work using a camera flash, hopefully it will work with lightning....

i used a photocell (resistor) connected to an ADC pic on the PIC, and it takes 2 samples, and compares them. if the second one has a greater value, then it triggers the camera. if i use a flash (disposable camera parts) it will take a picture and capture the flash, so it should be fast enough for lightning...

skimask
- 23rd April 2007, 04:18
seems to work using a camera flash, hopefully it will work with lightning....
I'd bet the photocell won't respond fast enough. A camera flash is usually quite a bit slower than lightning.

dragons_fire
- 23rd April 2007, 04:32
well, i have only breadborded it, so i can always change it to a transistor.. http://www.solorb.com/elect/lightning/

i dont think that a flash is slower than lightning. i may miss the initial bolt, but i have gotten a few stikes by just pressing the shutter button when i see the flash...

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_2961.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_3259.jpg

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_3256.jpg

skimask
- 23rd April 2007, 04:48
well, i have only breadborded it, so i can always change it to a transistor....................................
i dont think that a flash is slower than lightning. i may miss the initial bolt, but i have gotten a few stikes by just pressing the shutter button when i see the flash...

Are these your pics, 'cause if they are...
COOL...just plain COOL!
Can you keep triggering the shutter for like 5 seconds (give or take) after the initial hit? Might get some neat shots there too...

dragons_fire
- 23rd April 2007, 05:02
im using a rebel XT, it will take aprox. 3 Pictures a second.

two of those pics were taken out my bedroom window, and the other was on a camping trip. it was on the other side of the lake. usually i take around 500 pictures during a thunderstorm, and i get about 15 "ok" pics of lightning...

this trigger im making, uses one of about 10 16f88s i have laying around, a 9V battery and it all fits inside an altoids container that i made a mount for to fit on the hotshoe of my camera. if it doesnt work for lightning, i will just modify it to fire a flash to use as a slave.

thought i would mention that the wire o nthe left side of those pics, is a wire for my video camera that i had mounted on the roof that i wanted to eventually stream onto the internet.. another one of my projects that never got finished...

skimask
- 23rd April 2007, 05:14
im using a rebel XT, it will take aprox. 3 Pictures a second. two of those pics were taken out my bedroom window, and the other was on a camping trip. it was on the other side of the lake. usually i take around 500 pictures during a thunderstorm, and i get about 15 "ok" pics of lightning... this trigger im making, uses one of about 10 16f88s i have laying around, a 9V battery and it all fits inside an altoids container that i made a mount for to fit on the hotshoe of my camera. if it doesnt work for lightning, i will just modify it to fire a flash to use as a slave.

If the photocells don't respond fast enough, I wonder if using a photodiode, prebiased with a little bit of voltage, connected to an A/D input, continuously sampled would respond fast.
It would be neat if I could get pictures like that, but I live in a bit of a valley with trees all around. Not much of a horizontal view unless I get up about 100ft...at least I get deer walking thru the yard every morning and evening.

dragons_fire
- 23rd April 2007, 05:52
yeah, there not bad. i would like to take better pics, but i like being in the safety of my house.. when we get thunderstorms, we usually get some hail with it.. i would like to go out in my sidekick to somewhere good, but im afraid of the hail going through my soft top.


i think i finally got everything with the 6585 right now.. thanks to everyone for all the help.. im just looking through old threads trying to figure out how to get rid of the "warning[230]" config message...

skimask
- 23rd April 2007, 06:06
im just looking through old threads trying to figure out how to get rid of the "warning[230]" config message...

An upgrade to PBP 2.47 should get rid of it from what I've heard.
I'm still running 2.46 (no need for the upgrade yet and I'm a bit lazy), I just ignore the errors.

dragons_fire
- 23rd April 2007, 06:24
i just went in and edited the inc file... added "w = -230"
no more errors..

hopefully i will have a new PIC by wednesday, so i can put this all together and maybe get it moving...

skimask
- 23rd April 2007, 13:24
i just went in and edited the inc file... added "w = -230"
no more errors..
hopefully i will have a new PIC by wednesday, so i can put this all together and maybe get it moving...

Are you just going to 'fix' the old board or what?

dragons_fire
- 23rd April 2007, 19:03
well, i found more stuff wrong with it... so i will probably make a new board... i had the memory card writer header on backwards...

ive been testing the card writer with a 877a, and its pretty neat..

dragons_fire
- 26th April 2007, 04:18
Update:

i havent done too much work on it in the last couple days. the ECM in my truck went bad, so im trying to figure out if its fixable, or if i need to replace it... its a 91 Suzuki Sidekick, adn all the electronics and half the engine parts are made by Mitsubishi.

i have the Rogue Robotics UMMC SD card reader/writer working great now. it just takes serial data and stores it to a card. i can store a "label" and a VAR Byte to it for each one of my variables for this robot.. with a 1gig card, i can fit almost 100,000,000 logs on it and then stick the card into my computer and read it all in notepad. i dont have an actual use for this yet (for this robot, i can think of many uses for other things), but i think its going to be neat to look at everything on my computer..

my new PIC and other parts came today, so i will make the board over the next couple days, and hopefully it will work good this time...

Darrel Taylor
- 26th April 2007, 04:52
If you feel like showing the new board again before you etch it...

I'm up for another looksy.
<br>

skimask
- 26th April 2007, 05:06
If you feel like showing the new board again before you etch it...I'm up for another looksy.
<br>

Definetly let us all have a 2nd/3rd/4th look for you (not that you aren't competent or anything, but it couldn't hurt at all). This is too neat of a project to waste any more pieces/parts on. I wanna see something work! :)

dragons_fire
- 26th April 2007, 13:45
well here it is... hopefully it works this time.. i have changed a lot around since the last time i posted it...

http://i163.photobucket.com/albums/t305/dragons_fire_photo/scan0037.jpg



thanks fof the help guys, and i will keep everyone updated on how it goes...

skimask
- 26th April 2007, 14:05
well here it is... hopefully it works this time.. i have changed a lot around since the last time i posted it...thanks fof the help guys, and i will keep everyone updated on how it goes...

Nice looking board...a couple notes...
--Add in vias on any signal/power line you can fit them on, whether you drill them out or not. That way you can drill the via later and plug in extra wiring or make mod's down the road, goes back to cutting traces and making fixes and stuff like that.
--I might get rid of that big ol' ground plane square on the bottom, unless you plan on coating the board with something (a rattle can of acrylic is a good thing I've found out recently and it scrapes off easily with rubbing alcohol and a cotton swab after it's dried). That plane to me looks like a perfect spot to short something out!
--Very few 90 degree corners, very few corners greater than 45 degrees, decent ground run, I might add a few extra power runs on the bottom (and/or thicken up the power traces you've already got) to help the power get around a bit better. The setup you've got is almost a daisy-chain. Optimally, you'd almost want all the power traces to come back to a central point (same for ground, but you're good there).

mister_e
- 26th April 2007, 14:14
a very little suggestion. Usually the power rails should be 2-3 X bigger than the signal one.

unless, it looks good, nice job. Don't give up

dragons_fire
- 26th April 2007, 14:19
--Add in vias on any signal/power line you can fit them on, whether you drill them out or not. That way you can drill the via later and plug in extra wiring or make mod's down the road, goes back to cutting traces and making fixes and stuff like that.

-- The setup you've got is almost a daisy-chain. Optimally, you'd almost want all the power traces to come back to a central point (same for ground, but you're good there).

think you told me all that before, and i just forgot..

i actually have been using "tremclad" clear on the boards after their etched. then i can drill through it, and it works like a solder mask. it seems to take a little more heat, but im mostly soldering headers and sockets, so it shouldnt make too much of a difference..

the ground plane on the top of the board, is right under the SD card reader. so i put it there to kinda block it from anything..

skimask
- 26th April 2007, 14:26
i actually have been using "tremclad" clear on the boards after their etched. then i can drill through it, and it works like a solder mask. it seems to take a little more heat, but im mostly soldering headers and sockets, so it shouldnt make too much of a difference..

the ground plane on the top of the board, is right under the SD card reader. so i put it there to kinda block it from anything..

Good call on both points...

mackrackit
- 26th April 2007, 19:48
Like Mr_E said about the power traces.

NICE JOB!

Darrel Taylor
- 26th April 2007, 20:23
Just concentrating on the Power&Ground right now.

<img src=http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1578&stc=1&d=1177615348>

mister_e
- 26th April 2007, 20:27
mmm nice catch!

Darrel Taylor
- 26th April 2007, 21:40
I think the PING's backwards too.

<img src=http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1579&stc=1&d=1177619828>
<br>

dragons_fire
- 26th April 2007, 22:52
i have never had this many problems with my boards... i have fixed everything that was mentioned... i took out that cap, increased the sizes of power and ground traces (and made them go all around the board), and i flipped the "ping" around too..

i dont know how i got that one backwards, it was fine all the other times i designed this...

thanks guys....

dragons_fire
- 28th April 2007, 05:24
another update... im still working on trying to fix the computer in my car. its made by mitsubishi, adn apparently the caps go bad, and need to be changed.

i made a new board, and it all seems good. i think the old PIC is still good too (im not sure though). i tried to flash an LED on RF0, but its not working.

i can program fine, and then i can read the code from the PIC and its all the same. i think im just forgetting something somewhere.. and remember, im still somewhat new to this...


DEFINE OSC 20
define xt_OSC
CMCON = 7
ADCON1 = 7

start:
high portf.0

Pause 1000
low portf.0

pause 1000
GoTo start

End

mister_e
- 29th April 2007, 16:49
yeah i already repaired tons of those beauties awhile back, and yes they had Caps failure... but some has Microcontroller failure as well. Maybe you could have a look at the following which explain it to you better than i could :D
http://www.ecmtogo.com/ECMTips2.htm


And yes, they also have plenty faulty contact/wiring problem too... good old time :D

-------------------------------------

Your config fuse setting is wrong, i suggest you open the .INC file in the PBP folder to see how they set the default one AND to have a look at the following
http://www.picbasic.co.uk/forum/showthread.php?t=543

Make sure you really disable ALL analog stuff with your current settings AND that you disable the LVP mode in your config fuses.

dragons_fire
- 29th April 2007, 20:22
thanks mister e, caps are cheap, so its worth a try..

and the config fuses were wrong.. i pretty much knew they were when i posted.. i have got it t flash leds, and to write t my serial lcd. it is also working t the motor driver, but everythign cuts out when the motors get to a certain speed. i think that maybe my batteries might not be able to handle that much drain..

gonnas work on it a bit more tonight after work, and i will post a video of it running on its own when that happens...

skimask
- 30th April 2007, 15:28
thanks mister e, caps are cheap, so its worth a try.. and the config fuses were wrong.. i pretty much knew they were when i posted.. i have got it t flash leds, and to write t my serial lcd. it is also working t the motor driver, but everythign cuts out when the motors get to a certain speed. i think that maybe my batteries might not be able to handle that much drain.. gonnas work on it a bit more tonight after work, and i will post a video of it running on its own when that happens...

Tape a meter up to the top of it and drive around and watch the meter!
Or maybe even make use of one of your analog or comparator ports, kill the motors when the voltage gets too low, use a seperate voltage reference, blink and LED when the volts are good, no blink when volts drop off, etc.etc...(which is why I said add a load of extra vias even if you don't use them, makes it a piece of cake to add this stuff in there)

Batteries - that's what I'm thinking. If I remember right, your motors are driven off a seperate motor driver chip with a mind of it's own and probably doesn't need a full 5v to operate.

dragons_fire
- 30th April 2007, 19:44
ok... so im not sure whats going on now... i think im getting some kind of interference off the motors.. if i move the board about 3" away from the chassis, everyhting works beautifully. then if i put it back near the motors, it cuts off. i havent added caps across the motor leads and case yet, but i may try that tonight..

im not sure, but when the voltage gets low enough, the PIC should reset right? and it appears from my LCD, that everything is just locking up..

it does kinda move though.. i will keep working on it, and let ya all know when i find something...

mister_e
- 30th April 2007, 19:53
mmm, what happen if you try to use the internal OSC (if there's)

Is there a lot of unconnected I/O?

I don't remind your configuration fuses, but you could try to disable the Brow-Out detect or play with it's threshold voltage.

dragons_fire
- 30th April 2007, 20:21
i have played with the fuses, and the threshold... didnt seem to help... im not sure whats causing it to cut out when the motors are close to the chip..

i will try the int osc, and see if that helps...

skimask
- 30th April 2007, 20:41
i have played with the fuses, and the threshold... didnt seem to help... im not sure whats causing it to cut out when the motors are close to the chip..
i will try the int osc, and see if that helps...

For S & G 's, maybe throw a couple of thicknesses of aluminum foil between the board and the motors (taped up or coated somehow of course so it doesn't short out) and ground the foil...see what happens... Might help with the EMI if there is any.

And if it doesn't work...at least it'll keep little green aliens from invading your Treadbot with their evil mind control devices! :D

mackrackit
- 1st May 2007, 01:01
For S & G 's, maybe throw a couple of thicknesses of aluminum foil between the board and the motors (taped up or coated somehow of course so it doesn't short out) and ground the foil...see what happens... Might help with the EMI if there is any.

And if it doesn't work...at least it'll keep little green aliens from invading your Treadbot with their evil mind control devices! :D

The aluminum foil will work for aliens:) but if the problem is a magnetic one you will need something with a high magnetic permeability. Hold a compass near the motors when they are running and see what happens. Use one that you will not care if it gets reverse polarized.

If this is the problem, all you should need is a thin piece of cheap steel (roof flashing) that is a little larger than the board being that the motors are underneath it.

dragons_fire
- 2nd May 2007, 19:02
Ive been playing with it a little bit, and if i move the board up about 3", everything works great... thats what makes me think its an interference problem instead of a "low voltage" thing... i would prefer to keep eveything as close as possible, so its not top heavy..

my sidekick still isnt working, so i have been spending most of my time on it, but when i get it going again, this robot should be driving around my house all the time...

mackrackit
- 2nd May 2007, 21:46
Ive been playing with it a little bit, and if i move the board up about 3", everything works great... thats what makes me think its an interference problem instead of a "low voltage" thing...

To me that sounds more and more like a magnetic problem. A magnetic field will drop off something like an inverse square, RF does not. (some one will want to correct this):) At least if it was RF, it would most likely carry more than 3"

A little info http://www.lessemf.com/guidelines.pdf

dragons_fire
- 3rd May 2007, 15:59
so, i added a sheet of "galvanized flashing" between the board and the motors, and i bent some to make a box that fits perfectly over the PLCC socket, and it seems to help.. its still not perfect, but its a whole lot better than it was before. im going to see what i can do to shield it a little better. i also need to ad caps to the other motor, and im going to see what i can do to make some tubular shields to fit over the motors..

i have also noticed that things get worse if i ground all the shields..

i like the way its laid out right now, but i think it might help if i switch the controller and battery boards, so the PIC would be farther away from the motors. it would also lower the centre of gravity, and make the whole robot a little more stable...

i will try to play with it a little more this evening, and maybe add one more sheet under the one i already have, but idont want to raise the board too much, its already top heavy..

mackrackit
- 3rd May 2007, 16:30
I forgot to mention that grounding the shields will transfer eddy currents.

You might try bending the sheet metal that is between the board and motors down over the tracks (fenders)?

With out a gauss meter the fields will be difficult to map. A compass can sometimes give you an idea.

This is a gadget I use. http://www.forcefieldmagnets.com/catalog/product_info.php?cPath=23_39&products_id=100

dragons_fire
- 3rd May 2007, 18:44
when i first started building this, my intention was to put the battery between the 2 motors inside the red fibreglass. because i wanted lots of capacity, and a higher voltage, i added them to the top. so now i have lots of room insid the chassis.

i will probably make tubes to go around the motors, and hopefully that will help.

I might also cast a lead "brick" to fill in the space between them to make it a little more stable on angles, and for more grip. the only problem is that i will lose some endurance because the motors will need to haul more wieght.

ive been working for the last ten days, but i get the next 4 off, and its raining like crazy here, so i should get some time this weekend to play with it a bit more.

After i get the "interference" problem figured out, i will have a video up here of it driving around. i have written the code for it to speed up, drive, sense obsactles, slow down and then turn and drive that way..

skimask
- 3rd May 2007, 20:29
when i first started building this, my intention was to put the battery between the 2 motors inside the red fibreglass. because i wanted lots of capacity, and a higher voltage, i added them to the top. so now i have lots of room insid the chassis.
i will probably make tubes to go around the motors, and hopefully that will help.
I might also cast a lead "brick" to fill in the space between them to make it a little more stable on angles, and for more grip. the only problem is that i will lose some endurance because the motors will need to haul more wieght.
ive been working for the last ten days, but i get the next 4 off, and its raining like crazy here, so i should get some time this weekend to play with it a bit more.
After i get the "interference" problem figured out, i will have a video up here of it driving around. i have written the code for it to speed up, drive, sense obsactles, slow down and then turn and drive that way..

It was recently (today) suggested in another thread talking about unused pins and running motors and getting interference, etc., to occassionally reaffirm your TRIS assignments for all the pins you're using.

In other words, every once in awhile, or whenever you can spare a cycle or two, redo all your TRIS's, keep your inputs as inputs, and your outputs as outputs.

It seemed to help this other person's problem with motors, magnetics, etc., and it's only a slight software change.
Might help you too...

dragons_fire
- 3rd May 2007, 21:07
well, i just noticed that thread as you were replying.. i will give it a try when i get home... the motor controller has a reset line on it that needs to be held high, so i used a pin from the pic, so i can turn it on or off if i need too, and i think hte pic is probably going low on that pin..

do i want to make all the unused (almost all of them right now) inputs or outputs?? they arent tied to ground or anything, because they will eventually be used.

and im not too worried about program space (yet), i have 24K words, and im only using about 300 words right now... i would prefer to get rid of as much magnetism and electrical noise as possible by physical means, and not just block it out with programming..

thanks for the help guys

skimask
- 3rd May 2007, 21:24
the motor controller has a reset line on it that needs to be held high, so i used a pin from the pic, so i can turn it on or off if i need too, and i think hte pic is probably going low on that pin
Good idea...keep pinging that pin in your program to help force it high if need be.


do i want to make all the unused (almost all of them right now) inputs or outputs?? they arent tied to ground or anything, because they will eventually be used.
Don't really know on that. Almost anyone of them could be causing a problem. One thing is almost for sure though, if a pin is an output, it generally can't cause an interrupt.


i would prefer to get rid of as much magnetism and electrical noise as possible by physical means, and not just block it out with programming..
But the extra programming doesn't cost anything in hardware! :)

SteveB
- 4th May 2007, 03:00
well, i just noticed that thread as you were replying.. i will give it a try when i get home... the motor controller has a reset line on it that needs to be held high, so i used a pin from the pic, so i can turn it on or off if i need too, and i think hte pic is probably going low on that pin..

You could also try using a pull-up, and keeping the pin as input. If you want a reset, then in the program change it to an output, low, pause as needed, high, then back to input.

dragons_fire
- 7th May 2007, 16:24
i dont really know whats going on... ive been playing with it for a bit this weekend, and something funny is going on..

when i hold the board about 2" above the motors, everything works fine, if its closer, it will start to speed up, and then just completely stop, and wont reset.

if i plug in my serial LCD and keep the board 2" away from the motors, they run fine, but the LCD will work for a bit, then go blank, and then work a bit more, and go blank and then work more.

with the board beside the motors, the LCd will start, go all black, and then come back and the motors will stop. then the lcd will keep displaying the speed variable changing, so somewhere in there, i think the motor reset is being tripped and its not restarting.

heres a tiny bit of my code...





baudLCD CON 32 'baud rate for lcd
lcd VAR PORTF.0 'serial lcd port
motor VAR PORTD.0 'serial motor port
motorreset VAR PORTE.7 'reset pin For motor controller
baudmotor CON 84 'baud rate for motor
LBAK CON 1 'left backwards
LFWD CON 0 'left forwards
RBAK CON 3 'right backwards
RFWD CON 2 'right forward
speed VAR BYTE



start:

High lcd
High motor
High motorreset

SerOut2 lcd, baudlcd,[254,"G",1,1,"Treadbot"] 'display treadbot on lcd in position 1,1

Pause 1000

For speed = 0 TO 80 'speed up motor to full speed
SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "] 'display speed var on lcd in position 1,4
SerOut2 motor, baudmotor, [$80, 0, lfwd, speed] 'left motor forward
SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
Pause 150
Next

Pause 10000
'drive at full speed for 10 sec
For speed = 80 TO 1 STEP - 1 'slow down motor until stop
SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "] 'display speed var on LCD in position 1.4
SerOut2 motor, baudmotor, [$80, 0, lfwd, speed] 'left motor forward
SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
Pause 150
Next

JohnH
- 7th May 2007, 22:09
I built a walking (biped) robot and had trouble with motor noise causing the A/D signals to vary. (I use two A/D inputs to read pots coupled to the legs for position information.) Adding .1uf caps from each motor lead to the motor's case solved the problem.

My motors are the cheaper hobby motors used with the Tamiya double gearbox. If you are using the Pololu serial motor controller they recommend the caps too. I use an analog H bridge and still had noise issues even with seperate motor and logic batteries.

I don't know if it will help you but it is something to try....

By the way, you did an excellent job on the project, I hope it works out.
--John

dragons_fire
- 8th May 2007, 02:25
thanks for the compliment John, i have added the caps across one motor, and just forgot about the other motor. i usually add one from each lead to the case, and another across both leads. its one of those things i picked up from RC cars and planes.

heres a picture of one of my motors ontop of the scroll wheel on my mouse. i cant remeber if i posted it before, but here it is again..

http://i163.photobucket.com/albums/t305/dragons_fire_photo/IMG_7988.jpg

i would like to see a pic of that biped if you have any.. its one thing i want to do eventually. heres a hexapod i made, its kinda the same as the Lynxmotion hexapod.

http://i163.photobucket.com/albums/t305/dragons_fire_photo/th_MVI_6750.jpg (http://s163.photobucket.com/albums/t305/dragons_fire_photo/?action=view&current=MVI_6750.flv)

dragons_fire
- 17th May 2007, 05:03
so... i havent forgotten about this, im still working on it. I have just had a lot of work and other stuff to do lately. when i use:

For speed = 0 TO 80
'speed up motor to full speed
SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "]
'display speed on lcd
SerOut2 motor, baudmotor, [$80, 0, lfwd, speed]
'left motor forward
SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
Pause 150
next

both motors will speed up to around 45 or 50, and then just shut off. nothing seems to be overheating, and the voltage doesnt drop. the PIC still keeps running because the LCD will still show the Speed Variable increasing. i have tried pulling the reset pin low and then high again at the end of each cycle of code, but that doesnt help either.

if i tell it "speed = 80" then it will run fine, and have no problems.. i think maybe there is an issue with the motor controller recieving too many serial commands in such a short time, or something is getting messed up in the commands.

do hopefully by the weekend, i will have the ultrasonic sensor working and it driving around...

thanks for all the advice everyone...

JohnH
- 17th May 2007, 10:29
If you are using the Pololu motor controller, make sure it's reset pin is held high. If it dips to 0V, it will reset the controller to its inital state (motors off).

If you are using the Pololu Low voltage Dual serial controller:
The green leds on the controller should also be on for forward settings, see if they are still on when the problem occurs.

It looks like you have enough of a delay after the motor serial commands.

--John

skimask
- 17th May 2007, 13:37
Maybe try a little bit of 'DEFINE CHAR_PACING'?
It add x ms between serial characters on the output.
Maybe at the higher settings it doesn't like having x characters in a short amount of time...who knows...

dragons_fire
- 17th May 2007, 13:50
yeah, i have been keeping the reset pin high. i have also tried to reset it after every loop...and i can get it to slow down from 80 to 0 using the same program without a problem.

dragons_fire
- 22nd May 2007, 05:32
so i got the motors workign by changing the caps across the leads. i found out a couple days ago that the drawers i keep my caps in got messed up, so i ended up putting in 22pf caps instead of 1uf caps.

so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

PulsOut ultra, 5
PulsIn ultra, 1, ping

"ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...

i know i didnt describe it the best, but if anyone has any ideas, please let me know...

skimask
- 22nd May 2007, 05:37
so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

PulsOut ultra, 5
PulsIn ultra, 1, ping

"ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...

Those ultrasonic transducers generate some fairly high voltages while doing their work. I can easily see one of those dumping current across traces and causing your problems. Maybe try putting a series resistor inline with portf.0 and see what happens. Don't run the transducer, start low on the resistance, work your way up until the LCD doesn't work anymore, then back off one or two values. Then fire up the transducer and see what happens...
Have you ever been 'bit' by one? I wouldn't touch the bare metal on it while it's doing it's 'transducing'.

Darrel Taylor
- 22nd May 2007, 06:16
Did you set the ultra pin to 0 before using Pulsout?

Pulsout works by toggling the pin twice. To get positive pulses, the pin needs to be set low first. (if it wasn't already there)
<br>

dragons_fire
- 22nd May 2007, 15:00
yes, i took it low before doing anything. heres a little more of the code:



trigger con 5
baudLCD CON 32 'baud rate for lcd
lcd VAR PORTF.0 'lcd port
ping VAR byte
ultra VAR PORTF.1
PORTF.1 = 0
ping = 0


SerOut2 lcd, baudlcd,[254,"G",1,1,"Ping Test"] 'display test on lcd in position 1,1

start:
Pause 1000

PulsOut ultra, trigger 'send trigger to ping
PulsIn ultra, 1, ping 'wait for ping variable

Pause 1000
SerOut2 lcd, baudlcd,[254,"G",2,2,#ping," "] 'display pin var in position 2,2

GoTo start
End



so wheni take out the "pulsout ultra, trigger" line, everything works great (except the ping sensor cause it doesnt get its pulse). i added in long pauses so i could tell where the problem is. my LCD will display "ping test" in the correct position, then waits a second, displayes a wierd character, waits another second and then displays a couple wierd characters and then the ping variable. when it shows the wierd characters and ping variable, it just adds them right behind "ping test", not in the position its supposed to be in..

skimask
- 22nd May 2007, 15:09
Try this out and see what happens:

trigger con 5:baudlcd con 32:lcd var portf.0: ping var byte:ultra var portf.1: portf.1=0: ping=0:SerOut2 lcd, baudlcd,[254,"G",1,1,"Ping Test"]

start:
Pause 1000
PulsOut ultra, trigger
PulsIn ultra,1,ping
flags.0=0
Pause 1000
SerOut2 lcd, baudlcd,[254,"G",2,2,#ping," "]
GoTo start
End

The flags.0 = 0 basically resets the LCD, might help, might not...never know...

EDIT: And as mister_e noted below, flags.0 don't help here...DOH!!!

mister_e
- 22nd May 2007, 15:19
:( FLAGS work ONLY with LCDOUT... :(

DragonFire, did you set the TRISF as well? unless PORTF.1=0 won't do anything as the default setting for PORTF 'should' be input ... yeah i love guessing ;)

So OR you set TRISF.1 = 0 at the top of your code, OR you can use LOW PORTF.1. LOW/HIGH will do it for you.

It's up to you.

NOW, you can't use PULSIN/PULSOUT as you did, PULSOUT is not working in background, so it will finish to do it's job, then your program will execute PULSIN. As the pulse is already gone, it won't read it.

Of course, an interrupt would do the trick... of course with DT instant interrupt, not PBP ON INTERRUPT.

What i figure to be working, in your ISR, you start a timer, you change the interrupt trigger type (rising/falling edge), then at the next interrupt, you read the Timer value.

Still possible to use the CCP module... it's design for it.

I suggest you to read the following Tips 'n Tricks doc of Microchip. It's all there
http://ww1.microchip.com/downloads/en/DeviceDoc/41214a.pdf

EDIT: i saw you READ/WRITE to the same pin (ultra)?

SEROUT2 should be used with DEC modifier instead of #... maybe this is why you have some weird character.

I heard some LCD may need some CR or LF character to work properly.. not sure if this could apply to yours.

dragons_fire
- 22nd May 2007, 15:51
i just gave that a try, and it does the same thing.... im going to haved to play around with it a little more later...

the pijng sensor im using, only has one I/O pin, it actaully takes the "trigger pulse" in and then waits 200uS and then sends out the ultrasonic pulse, so that part of the code was copied right out of their demo code for the BS2. i have had it working before on a 877a, so i just copied my code from that.. im sure its just a stupid little thing...

it actually seems like maybe the baudrate is just a tiny bit off, but i can send the first command fine...

skimask
- 22nd May 2007, 16:36
i just gave that a try, and it does the same thing.... im going to haved to play around with it a little more later... the pijng sensor im using, only has one I/O pin, it actaully takes the "trigger pulse" in and then waits 200uS and then sends out the ultrasonic pulse, so that part of the code was copied right out of their demo code for the BS2. i have had it working before on a 877a, so i just copied my code from that.. im sure its just a stupid little thing... it actually seems like maybe the baudrate is just a tiny bit off, but i can send the first command fine...

Can you slow down your SERIAL LCD? (notice how I remembered it was a serial lcd this time?) Run it at 2400 baud instead of 9600, or maybe slower, and see what happens?

dragons_fire
- 22nd May 2007, 19:13
when i use: pulsin portf.0, 5
it should put pin f.0 high for .005 seconds right??? i am really realizing how much i dont know about this stuff. most of my robots have been made by trying different code until it works. on this one, i am learning a little more code but i still dont know how all this works..
heres the code:

DEFINE OSC 20
TRISF.1 = 0

'variables
'----------------------------------------------------------------------------------

baudLCD CON 32 'baud rate for lcd
lcd VAR PORTF.0 'lcd port
ping VAR WORD
ultra VAR PORTF.1

Low PORTF.1
High PORTF.0
ping = 0

'Startup Program
'-------------------------------------------------------------------------------------- 'start motor driver

Pause 3000 'pause for LCD startup screen 'reset motor driver 'wait a few seconds
SerOut2 lcd, baudlcd,[254,"X"] 'clear screen
Pause 100
SerOut2 lcd, baudlcd,[254,"X"] 'clear screen again
SerOut2 lcd, baudlcd,[254,"P",140] 'change resolution
SerOut2 lcd, baudlcd,[254,71,1,1,"Ping Test"] 'display test on lcd in position 1,1

'main program
'----------------------------------------------------------------------------------------

start:

PulsOut ultra, 5 'send trigger to ping
PulsIn ultra, 1, ping 'wait for ping variable

Pause 1000

SerOut2 lcd, baudlcd,[254,71,5,3,DEC ping," "]

Pause 1000

GoTo start
End


and heres a video or whats happening...
http://s163.photobucket.com/albums/t305/dragons_fire_photo/?action=view&current=treadbotultra.flv
unfortunately, its not easy to see the LCD screen, so it may not help much


thanks for all the help...

Darrel Taylor
- 22nd May 2007, 20:59
RF0 is AN5
RF1 is AN6/C2OUT

So these might help.
ADCON1 = $0F
CMCON = 7
<br>

dragons_fire
- 22nd May 2007, 21:19
once again, you are amazing!!! i know somehow that makes then digital instead of analog, but i havent ever figured out how all that works...

maybe there will be a video later on...

Darrel Taylor
- 22nd May 2007, 23:13
Then I wouldn't worry about the A/D stuff right now. So far none of your project will be using analog. So you can just leave them turned off.

I think you've got "Bigger Fish to Fry".

If you do add analog stuff later, just take a look at the ADCON1 register (19-2) in the data sheet. There's a table that shows what values to use for whatever analog inputs you need. Same for CMCON.
<br>

dragons_fire
- 23rd May 2007, 15:55
i definately have a lot of "frying" to do!!! i enjoy the challenge of trying to make this stuff work but sometimes its nice to have help from you guys that know what you are doing.

i have another small problem right now. i used if/then (i know they arent the best way to do stuff, but its easy) statements so if the distance is more than "900" then it will drive fast, if its lower than "900" then it will slow down, and if its lower than 350 it will stop and turn, then drive fast again until it senses something..

so it will drive fast, and then when it gets to under "900", it slows down, but then it stays at that speed, and it doesnt send out pings.

im almost positive that im either missing something or things arent in the right order.

im going to play around with it a little more before i "officially" ask for help. that way i can learn all the things that dont work!!!