Offline
Newbie
Karma: 0
Posts: 3
|
 |
« on: March 13, 2012, 09:30:32 am » |
Hi
I have been working in a project to create and drive a small vehicle to start from a point drive to a wall touch it and return to the same point. My group and i planned on doing this by driving the vehicle from a 3v geared motor. also to measure the distance we used a slotted disk attached to the shaft which ran through an optical sensor. the plan was once the vehicle had travelled to the wall a micro switch on the end would reverse the polarity of the motor and send it back in reverse and match the distance recorded from the optical sensor.
At first we tried to achieve this by using and circuit of 3 up/down counters but encountered several problems. we have now been advised to use and program an arduino board and use a h-bridge to reverse the motors polarity. However we are all new to arduino boards and are quite rushed for time to get it done?
If anyone can give any help or give suggestions on how to achieve this it would be really appreciated!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #1 on: March 13, 2012, 09:35:30 am » |
Hi
I have been working in a project to create and drive a small vehicle to start from a point drive to a wall touch it and return to the same point. My group and i planned on doing this by driving the vehicle from a 3v geared motor. also to measure the distance we used a slotted disk attached to the shaft which ran through an optical sensor. the plan was once the vehicle had travelled to the wall a micro switch on the end would reverse the polarity of the motor and send it back in reverse and match the distance recorded from the optical sensor.
At first we tried to achieve this by using and circuit of 3 up/down counters but encountered several problems. we have now been advised to use and program an arduino board and use a h-bridge to reverse the motors polarity. However we are all new to arduino boards and are quite rushed for time to get it done?
If anyone can give any help or give suggestions on how to achieve this it would be really appreciated!
|
|
|
|
|
Logged
|
|
|
|
|
"The old Europe"
Offline
Edison Member
Karma: 0
Posts: 2003
Bootloaders suck!
|
 |
« Reply #2 on: March 13, 2012, 09:40:25 am » |
You should have a look at the 'playground' wiki. It can be found on the main arduino site. Especially the section 'interfacing with hardware' should answer a great deal of your questions: H-bridge / rotary encoder / counting pulses ...
|
|
|
|
|
Logged
|
• Upload doesn't work? Do a loop-back test. • There's absolutely NO excuse for not having an ISP! • Your AVR needs a brain surgery? Use the online FUSE calculator. • My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets... • Microsoft is not the answer. It is the question, and the answer is NO!
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 146
Ugi was not declared in this scope
|
 |
« Reply #3 on: March 13, 2012, 11:11:22 am » |
An Arduino seems like a good choice for this - you can interface the optical counter, the motors, the switch and even a distance sensor to give you a warning of when to expect to reach the wall.
You will probably want an Arduino Uno, a motor controll shield (which will have the two h-bridge circuits for controlling the motors) plus the vehicle you have now. Connection should be fairly easy - you'll need something like 2 PWM and 1 control pin for each motor, plus one for the counter, one for the limit switch and perhaps a couple more for an ultrasonic ping sensor. That's 4 PWM plus 4 general I/O pins out of 6 + 8 digital pins and 6 analogue. That gives you plenty of pins.
I don't know how much coding you have done but if you work through a few of the examples in the learning section of arduino.cc you should get it quickly enough.
|
|
|
|
« Last Edit: March 13, 2012, 11:13:38 am by Dr_Ugi »
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #4 on: March 13, 2012, 02:39:34 pm » |
Just to keep things straight, you are not the 1st engineering student in need of help. Nor are you the first that doesn't really know if he/she needs help.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #5 on: March 13, 2012, 06:38:39 pm » |
@madworm cheers mate  @Pauls cheers.... for being a ****! yeah i did clearly need help hence the reason why i posted in this forum. not sure why you even bothered to comment? are you that much of a loser you go on electrical forums to unhelpfully reply to posts? Moderator edit: personal insult diluted. Keep it civil.
|
|
|
|
« Last Edit: March 16, 2012, 11:24:17 am by AWOL »
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #6 on: March 14, 2012, 04:16:33 am » |
I'm glad I didn't post my comment. Try to retain a sense of humour. It helps. Paul was just making a light joke about your subject. Perhaps you meant "1st year engineering student in need of help!" The question mark led to the second part of the comment. I was going to say that I hoped it didn't mean there was a queue behind you. Not particularly funny, I know.
|
|
|
|
|
Logged
|
|
|
|
|
Canada
Offline
Sr. Member
Karma: 0
Posts: 319
Sometimes teaching, always learning,
|
 |
« Reply #7 on: March 14, 2012, 05:27:43 pm » |
PaulS is one of the best and most informative and helpful participants on this forum. You just have to post a compilable code, a clear circuit diagram, and a description of why your code doesn't do what you think it does if you want him to help. 
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, Canada
Offline
Edison Member
Karma: 2
Posts: 1233
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
|
 |
« Reply #8 on: March 16, 2012, 11:26:51 am » |
First. I agree with John_S responce. Need schematics, code, possible block diagram and a step-by-step of what you want the robot to do.
Let see if I understand correctly...
Input : A bumber switch Opto coupler sensor of a encode disk
Output : 2 motor
Process : Arduino
So far... Correct ?
And you want us to code for you ? Hmm... Good luck on that one. If I have a robot being build, I will share my code, but the hardware maybe differents.
Let see for a pseudo-code...
Move motors Check Switch - hit --> Back up Read opto Store opto data repeat...
That it. Unless you forgot to mention others things like com link and others stuffs.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: March 16, 2012, 11:28:15 am » |
I've merged the two near identical posts. Do NOT cross post, it simply wastes time.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|