Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #15 on: April 07, 2012, 10:51:36 pm » |
Nick,
I have the same setup as you to in this tutorial, but i cannot get the bot to move for more than .5 seconds per direction. I havent changed any code at all and double checked the wiring.
Also in the code, to a novice, it appears you are using pins 8 and 9 as pin A & B respectively, but in the diagram they are not hooked up.. Could you please explain that to me.
Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #16 on: April 07, 2012, 11:13:10 pm » |
Pins 8 and 9 were for the rotary encoders which I didn't use in the end, although the article talked about them. It stops after about a second if it doesn't get another message from the remote, so it sounds like the connection might be flaky. You could change this: const unsigned long TIME_BEFORE_WE_GIVE_UP = 1000; // ms Where 1000 mS is 1 second. But you probably need to work out the underlying problem. Do you have an aerial at all? I stuck a short bit of wire in to help with that.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #17 on: April 07, 2012, 11:15:05 pm » |
Also for the interrupt 0 assignment, that doesnt seem to be hooked up either,. Sorry I am rather new at this.
To clarify, my rover is going thru the fwd, left, backwards, right sequence but it is only moving for like .25 to .5 a sec before changing to the next direction in the list.
|
|
|
|
« Last Edit: April 07, 2012, 11:18:33 pm by troymcklure »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #18 on: April 07, 2012, 11:26:17 pm » |
Oh I thought you were referring to this: http://www.gammon.com.au/forum/?id=11506The forum is incredibly slow right now, it's taking 5 minutes for a page to load, so please bear with me. Here, in the code on page 1 of this thread: delay (500); } // end of loop So it changes direction every 1/2 a second. Change that to a bigger figure if you want.
|
|
|
|
|
Logged
|
|
|
|
|
Yuma, AZ
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #19 on: April 07, 2012, 11:33:43 pm » |
The forum is incredibly slow right now, it's taking 5 minutes for a page to load, so please bear with me.....
Your not alone, the site is sooo slow lately. Whats goin on? ... Wait don't answer that. I will start my own thread to hijack.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #20 on: April 07, 2012, 11:44:49 pm » |
Might I ask what the delay is in there for? It was my understanding the objective of the code was for it to fw/backward for 10 sec and turn for 1.2 sec.
Thank you for your patience with answering my questions.
EDIT** I am assuming that is the delay between direction changes?
By the way, I changed that value to 2 seconds, and it pulses in a direction for about .5 seconds then waits 2 seconds before changing directions to pulse again. I will try to get a vid.
thanks.
|
|
|
|
« Last Edit: April 07, 2012, 11:53:30 pm by troymcklure »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #21 on: April 08, 2012, 12:02:50 am » |
Er, maybe I was wrong. My mind is still seething over the lengthy delays trying to ban spammers on the forum.  This code here: // check current drain while (millis () - start < time_to_go) { if (analogRead (0) > 325) // > 1.46 amps break; } That makes it stop if the current drain exceeds 1.46 amps. You might want to tweak that a bit. Perhaps your motors are drawing more than mine did. So if you make it higher, it will draw more current before stopping. I am assuming that is the delay between direction changes? Yes.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #22 on: April 09, 2012, 10:55:33 pm » |
So far, I have to crank up that current drain value beyond 600, and even still, it will cut out when going in half the directions..  Is there something potentially very wrong with my setup to cause that?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #23 on: April 10, 2012, 12:15:44 am » |
Hard to say. Try commenting out the check, and testing. Be ready to hit the power switch if things start smoking. 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #24 on: May 01, 2012, 07:36:46 am » |
hi, dagu photo.png, could you please tell me why you need power from arduino board icsp?
and why don't you use the jumpers of motors on the chassis?
thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #25 on: May 01, 2012, 03:57:19 pm » |
hi, dagu photo.png, could you please tell me why you need power from arduino board icsp?
Those two wires (red and black) are just +5V and Gnd, which were available on the ICSP pins. Since they are pins on both ends it was easy to wire-wrap them. and why don't you use the jumpers of motors on the chassis?
What jumpers are you referring to?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #26 on: May 01, 2012, 05:28:53 pm » |
hi, thanks your reply.
abt q1, can i get V5 from other pin of arduino board? it's hard to find f/f jumper wire, where did you get it?
q2, i saw about 5-6 female pin jumper out of the chassis motor, where there should be connected to?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #27 on: May 01, 2012, 06:58:47 pm » |
abt q1, can i get V5 from other pin of arduino board?
Yes, wherever you want to. it's hard to find f/f jumper wire, where did you get it?
http://www.adafruit.com/products/266q2, i saw about 5-6 female pin jumper out of the chassis motor, where there should be connected to? 4 wires are the encoder on the motor, the other 2 drive the motor. See close-up photo:  Of course there is another set for the other wheel.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14121
Lua rocks!
|
 |
« Reply #28 on: May 01, 2012, 07:03:16 pm » |
The red and black wire you see going across the board is just for the voltage readout I stuck on the front, so I could see when the LiPo battery was going flat: 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #29 on: May 02, 2012, 07:01:46 pm » |
hi my rover works now, thanks a lot
and in Arduino_forum_779785.jpg
why the jumpers come from rover motor are single but the heads on controller board are two rows.
|
|
|
|
|
Logged
|
|
|
|
|
|