Cheap DC Motor Controller?
Moderators: BeligerAnt, petec, administrator
-
- Posts: 441
- Joined: Mon Mar 03, 2014 7:01 pm
Re: Cheap DC Motor Controller?
Right, I think I've cracked it - that is if the battery and receiver share the same ground contact on the board.
Here is my revised and hopefully correct wiring diagram. Please tell me what you think (is it correct, pretty colours etc). Thanks!
Here is my revised and hopefully correct wiring diagram. Please tell me what you think (is it correct, pretty colours etc). Thanks!
- Attachments
-
- Baby O Wiring_b copy.jpg (199.2 KiB) Viewed 7592 times
- peterwaller
- Posts: 3213
- Joined: Fri Feb 15, 2002 12:00 am
- Location: Aylesbury Bucks
- Contact:
Re: Cheap DC Motor Controller?
I think the wires to the battery and receiver you have marked as -5v should be 0v other wise you will be running you receiver from 10v.
Re: Cheap DC Motor Controller?
Yeah the -5V should all be ground.
Nuts And Bots - For all your components and ready built antweights!
Alex Shakespeare - Team Shakey / Nuts And Bots / Team Nuts:
AWS 44, 45, 49, 51 & 55 Winner - Far too many robots!
Alex Shakespeare - Team Shakey / Nuts And Bots / Team Nuts:
AWS 44, 45, 49, 51 & 55 Winner - Far too many robots!
-
- Posts: 441
- Joined: Mon Mar 03, 2014 7:01 pm
Re: Cheap DC Motor Controller?
Thanks for that - I did mean 0V or ground as you would call it. So can you use the ground pin for both the receiver and battery 0V wires? I think it would be possible as all components need to have a common ground but I' not sure. Is there another ground pin/hole/socket/something else that I am missing here or is that diagram basically accurate apart from the -5V labels. Thanks for your help!
- peterwaller
- Posts: 3213
- Joined: Fri Feb 15, 2002 12:00 am
- Location: Aylesbury Bucks
- Contact:
Re: Cheap DC Motor Controller?
All 0v or grounds within the robot would be connected together.
-
- Posts: 441
- Joined: Mon Mar 03, 2014 7:01 pm
Re: Cheap DC Motor Controller?
Right, the controller should be in the post and I was hoping to get it all wired up and working by Saturday. Seeing as I ordered it last week, I should stand a pretty good chance but right now, things seem to be conspiring against me.
I tried to access this link: http://garya.org.uk/software/embedded-c ... controller but found that the site was down as the bandwidth was exceeded. Very annoying. Furthermore, the Marto code I have heard about does not seem to work one bit which is also rather irritating. When I compile it, it just throws up a load of exceptions.
I am a bit stuck here. If somebody could point me to a working version of Gary's code (which I like best as when I opened it, it appeared to work but I then stupidly did not save it locally because I didn't expect the site to go down) that would be very much appreciated.
Also, if I did not use the battery balance plug to detect the voltage (I shall be using a 6v NiMH battery, would it still work or, if not, could I just remove that section of the code?
Thanks in advance to anybody who can help - time is short and I really need to get this working for Saturday!
I tried to access this link: http://garya.org.uk/software/embedded-c ... controller but found that the site was down as the bandwidth was exceeded. Very annoying. Furthermore, the Marto code I have heard about does not seem to work one bit which is also rather irritating. When I compile it, it just throws up a load of exceptions.
I am a bit stuck here. If somebody could point me to a working version of Gary's code (which I like best as when I opened it, it appeared to work but I then stupidly did not save it locally because I didn't expect the site to go down) that would be very much appreciated.
Also, if I did not use the battery balance plug to detect the voltage (I shall be using a 6v NiMH battery, would it still work or, if not, could I just remove that section of the code?
Thanks in advance to anybody who can help - time is short and I really need to get this working for Saturday!
Re: Cheap DC Motor Controller?
Marto's code is written in arduino, not C, so I imagine that's what's causing your issues. Look at the second and third links on this website for instructions.
http://www.robowars.org/wikka/PololuB328
Marto's code has always worked seamlessly for me. Alternatively, here's a different C code for the controller
http://www.pololu.com/docs/pdf/0J37/rc_3pi.pdf
http://www.robowars.org/wikka/PololuB328
Marto's code has always worked seamlessly for me. Alternatively, here's a different C code for the controller
http://www.pololu.com/docs/pdf/0J37/rc_3pi.pdf
-
- Posts: 441
- Joined: Mon Mar 03, 2014 7:01 pm
Re: Cheap DC Motor Controller?
Thanks so much for that Rhys! The code appears to compile OK but seeing as the board itself hasn't yet arrived, I can't test it out. It's looking a bit risky for Saturday!
I'm just unclear on a few things about programming this board:
1) Do you have to have everything unplugged from the board to program it?
2) Must the board be powered by means other than the AVR programmer such as a battery?
3) I can see a pin marked with an arrow on the board. I presume it is there so I am able to plug in the 6 pin programming connector the right way round. However, on my programmer, there is no arrow, presumably because it has to use a 10 pin to 6 pin adapter. It has pins which are labeled as follows: GND, MOSI, VCC, MISO, SCK and RS1. I presume RS1 connects to ISP pin 1 which I have now seen on a diagram but I am still unsure.
4) I can also see that it is using pins 7 and 4 (if I am not mistaken) for the receiver input. Which pins are these? Are they definitely PD0 and PD7 as mentioned in a previous post?
5) Do I just change the 1 in this line: #define MIXING 1 to 0 if I don't want mixing?
Thank you all ever so much for your useful help! Sorry to post so many questions but I am a bit unsure of what I'm doing here! Hopefully should be able to get something ready for Saturday. That is if the board arrives and my exams are OK!
Thanks again!
I'm just unclear on a few things about programming this board:
1) Do you have to have everything unplugged from the board to program it?
2) Must the board be powered by means other than the AVR programmer such as a battery?
3) I can see a pin marked with an arrow on the board. I presume it is there so I am able to plug in the 6 pin programming connector the right way round. However, on my programmer, there is no arrow, presumably because it has to use a 10 pin to 6 pin adapter. It has pins which are labeled as follows: GND, MOSI, VCC, MISO, SCK and RS1. I presume RS1 connects to ISP pin 1 which I have now seen on a diagram but I am still unsure.
4) I can also see that it is using pins 7 and 4 (if I am not mistaken) for the receiver input. Which pins are these? Are they definitely PD0 and PD7 as mentioned in a previous post?
5) Do I just change the 1 in this line: #define MIXING 1 to 0 if I don't want mixing?
Thank you all ever so much for your useful help! Sorry to post so many questions but I am a bit unsure of what I'm doing here! Hopefully should be able to get something ready for Saturday. That is if the board arrives and my exams are OK!
Thanks again!
- BeligerAnt
- Posts: 1872
- Joined: Wed May 15, 2002 12:00 am
- Location: Brighton
- Contact:
Re: Cheap DC Motor Controller?
I've emailed you my code, sorry about the Spambots using up all my bandwidth
To answer your questions:
1) No, you shouldn't need to disconnect anything unless it connects to the pins used for programming.
2) Yes, the programmer only senses the voltage it doesn't supply power to the board.
3) The pin marked with an arrow is pin 1. the pinout is shown here: http://www.atmel.com/webdoc/stk600/stk6 ... g_ext.html
4) The Baby Orangutan has the Atmega port pin names shown in the schematic and written on the silk screen: http://www.pololu.com/picture/view/0J663 and http://www.pololu.com/picture/view/0J659
5) Sounds reasonable but I'm not familiar with that code.
To answer your questions:
1) No, you shouldn't need to disconnect anything unless it connects to the pins used for programming.
2) Yes, the programmer only senses the voltage it doesn't supply power to the board.
3) The pin marked with an arrow is pin 1. the pinout is shown here: http://www.atmel.com/webdoc/stk600/stk6 ... g_ext.html
4) The Baby Orangutan has the Atmega port pin names shown in the schematic and written on the silk screen: http://www.pololu.com/picture/view/0J663 and http://www.pololu.com/picture/view/0J659
5) Sounds reasonable but I'm not familiar with that code.
Gary, Team BeligerAnt
Re: Cheap DC Motor Controller?
My mistake, it is indeed PD4 and PD7.