Go to Post Learn the subjects that interest you, but at the same time know how it relate to real life situations, and how it is applied. - Ryan Dognaux [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-08-2007, 18:05
3dude_2231's Avatar
3dude_2231 3dude_2231 is offline
no one messes with a Thingy =|
AKA: Menscher,Ran Menscher =]
FRC #2231 (Onyxtronix)
Team Role: Leadership
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Shoham, Israel
Posts: 233
3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough
Send a message via MSN to 3dude_2231
driving motors using A PIC microcontroller

Hi there,

building a robot, and need help:
a PIC gets PWM signal from an R/C Rx,
I'm not sure what is the best option for processing the signal,
for controlling a small DC motor.

option 1: simplifying it to something like:
if(channel_X > 127)
{
motor1 = 1;
motor2 = 0;
}
else
...
(you get the point)

plus using a motor driver.
************************************************** ****
option 2:another option is to keep it as PWM,
calculating the values for both engines,
the problem is later interpreting that PWM signal for the motors.
**
I know you can get that result using a transistor,
but I have no experience with that.

and I cant afford "Victor 884"s
**
any other suggestions?



thanks,
Ran.
__________________
Redefining the word "Rookie". (for 2 years now..)


Israeli Off Season Games: WINNERS!
check out this cool project I'm into..


Last edited by 3dude_2231 : 21-08-2007 at 19:13.
  #2   Spotlight this post!  
Unread 22-08-2007, 04:25
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: driving a motor

Could you explain what tools do you use in this curcit? (motors, Victors, Spikes, etc...)
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
  #3   Spotlight this post!  
Unread 22-08-2007, 06:54
3dude_2231's Avatar
3dude_2231 3dude_2231 is offline
no one messes with a Thingy =|
AKA: Menscher,Ran Menscher =]
FRC #2231 (Onyxtronix)
Team Role: Leadership
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Shoham, Israel
Posts: 233
3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough
Send a message via MSN to 3dude_2231
Re: driving a motor

OK, I'm sorry if it's not clear, (I shouldn't post threads at those hours).

I'm using a small PIC 16f690 as a microcontroller,
I have 2 small everyday DC motors (those you find in RadioShack for around 0.5$)
my PIC receives a PWM signal from an R/C receiver,
and my problem is that I'm not sure which is the best way to control the motor,
I have explained 2 options above
__________________
Redefining the word "Rookie". (for 2 years now..)


Israeli Off Season Games: WINNERS!
check out this cool project I'm into..

  #4   Spotlight this post!  
Unread 22-08-2007, 11:49
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: driving a motor

How small is small? Can you live with like 5A max drive, 1A or so continuous?

Do they need to go forwards AND backwards (please say no!). If they need FWD and REV operation, then you'll need to build up a H-bridge.... which if your motor currents are like the ones mentioned above, you'd be fine with something like a 15030 transistor or the like.

Does your pic device have any ECCP modules? If so, you can set up that module to run all four lines of a full bridge... if you just need to go up to 5A, you should be able to run the lines to the transistor's bases straight out of the PIC.

Hope that gets you started....

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #5   Spotlight this post!  
Unread 22-08-2007, 11:53
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: driving a motor

Just checked, your chip has ONE eccp module, so..... you can run up to two half bridges like that. See your datasheet for details on how to split the four output lines between two half-bridges.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #6   Spotlight this post!  
Unread 22-08-2007, 12:50
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,829
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: driving a motor

You don't mention what chip or circuit you have in mind to serve as the motor driver. Since a PIC typically outputs around 25mA on any given pin (enough for an LED, and actually a rather skookum output for a microcontroller, but nowhere near enough for a motor) you need to amplify that output signal somehow.

It can be done with discrete components... a transistor and such... but I have had very good luck using the L293DNE with my Engineering 11 students when we build our mini sumo robots. The cool thing about using this chip is that because it is an H-drive it now makes it very easy to drive the motors both "forwards" and "backwards". You can even use it to do speed control if you set it up correctly.

That doesn't mean the L293 is necessarily the best choice for you... it is rated to 600mA and works well with the small motors in the Tamiya Dual Motor Gearbox, but the 3953 can go higher. Other chips are also available... perhaps you have something in mind already.

Good luck with the project,

Jason
  #7   Spotlight this post!  
Unread 22-08-2007, 13:43
3dude_2231's Avatar
3dude_2231 3dude_2231 is offline
no one messes with a Thingy =|
AKA: Menscher,Ran Menscher =]
FRC #2231 (Onyxtronix)
Team Role: Leadership
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Shoham, Israel
Posts: 233
3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough
Send a message via MSN to 3dude_2231
Re: driving a motor

thank you Qbranch and dtengineering.
I decided to go with the L293DNE connected to the PIC (only X axis input)
I'll be using the Tamiya Dual Motor Gearbox, so it's OK, no need for anything
over 1A.

thanks a lot :-)
__________________
Redefining the word "Rookie". (for 2 years now..)


Israeli Off Season Games: WINNERS!
check out this cool project I'm into..

  #8   Spotlight this post!  
Unread 22-08-2007, 21:41
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: driving a motor

hmmmm those are some nifty chips dtengineering ..... think i might be using a few of those in my future.... sometimes you do just need a little current, and that sure is the right price...

thanks,

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #9   Spotlight this post!  
Unread 23-08-2007, 01:52
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,829
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: driving a motor

Thanks for the kind words Qbranch... and you should have good luck with the Tamiya gearbox and L293 3Dude... over the past five or six years we must have made more than 100 mini robots using this set up in my shop alone.

One issue that you might come across is that depending on what your power supply is, when you start the motor it may pull the supply voltage down below the minimum voltage that the PIC requires to operate. As soon as the PIC shuts down, so does the motor... the PIC reboots... tries to restart the motor... and, well... you can see a loop there. The solution we use is to put the logic voltage on one circuit (a 5v regulated 9V battery) and the drive voltage on another (4 x AA battery pack). This is far from the only solution, but this situation and solution is quite common... witness the backup battery for the RC on your team's robot for the exact same situation.

I'll attach an older .pdf of one of my handouts... some of the stuff is a bit out of date... we don't use the 16f84a chip anymore, so the crystal and such aren't necessary, but the last two pages have some info on how we hook up the electronics that should be relevant to your project.

I'll also include a worksheet I give my students on the Sony IR protocol. Any Sony remote (or any multi-brand remote set to emulate a Sony) can easily be read by a PIC if you attach a PNA4602m (less than a buck each, if I recall) to one of the pins on the PIC and throw in a few lines of code.

You might find this a fun and cheap alternative to RC.

Have fun,

Jason
  #10   Spotlight this post!  
Unread 23-08-2007, 08:26
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,365
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: driving a motor

One thing you should add are 10K resistors on the pic IO's to the motor chip. Check the spec sheet to make shure your version includes internal clamping diodes. The TI sn754410 does. If you are going to run the motors at close to full load get a clip on heat sink for the motor chip. You could add a diode for reverse battery protection. The pic chip mention I don't believe has the capability of generating 2 PWM signals to control the motor speed . You would have to choose a pic with an ECCP. The other way to go is buy a motor control board that has a pic on it and comunicats with the pic chip by serial ttl commands. Some boards have current draw feed back and status monitoring. Check this link. http://www.pololu.com/products/elec.html#motocon
  #11   Spotlight this post!  
Unread 23-08-2007, 13:13
3dude_2231's Avatar
3dude_2231 3dude_2231 is offline
no one messes with a Thingy =|
AKA: Menscher,Ran Menscher =]
FRC #2231 (Onyxtronix)
Team Role: Leadership
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Shoham, Israel
Posts: 233
3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough3dude_2231 is a jewel in the rough
Send a message via MSN to 3dude_2231
Re: driving a motor

thanks you both dtengineering and Gdeaver, for your replies.

dtengineering,
about the voltage, the PICs and the motors are fed seperatly,
so no worries here.

and I know there are alternatives for the R\C sysytem,
but, I already have one, it's handy, easy, and I have experience with it.
so, no worries here as well, (money IS an issue ).

GDEAVER, thanks you,
I'm not getting near using full load,
actually, I'm working right now, choosing the best waveform to send to the motor driver.
It WON'T BE PWM, but something very similiar.

Ran.


Edit:I thought of sending the motor-driver, a pulse of 10mS, every 30mS, ("1" for 10mS, then "0" for 20mS).
so it won't have long peak times, nor motor-grinding-quick changes.
I used that as a reference, what do you think?
__________________
Redefining the word "Rookie". (for 2 years now..)


Israeli Off Season Games: WINNERS!
check out this cool project I'm into..


Last edited by 3dude_2231 : 23-08-2007 at 13:49.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Driving Experience Revolverx7 Rules/Strategy 20 27-03-2005 11:11
Driving to events Kevin A Chit-Chat 17 10-02-2004 23:48
driving at noon Adam Collet General Forum 6 20-09-2003 23:40
Driving a clutch Kevin A Chit-Chat 18 03-07-2003 16:02
Driving Skill Andy Grady General Forum 24 23-03-2003 02:34


All times are GMT -5. The time now is 15:07.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi