destroying my last pic? driving a miniature motor


Closed Thread
Results 1 to 21 of 21
  1. #1

    Unhappy destroying my last pic? driving a miniature motor

    Hi everyone,
    Please help me if you can....I don't want to destroy my last pic....

    I'll get right on topic:
    I had partial success driving a 4mm motor directly from the 4 pwms of my 16f690. I was using pulse steering to output hpwm signal on 4 pins. Testing this, I realized that this would not allow me enough current on the motor i am using.

    Here's what I did initially:
    I chose 250 ohm resistors for each pwm output because 5v/250ohm is 20 mA the max a pic can source or sink. After the resistor these lines converged going to the positive terminal of the motor. Because I gave moter 4 pwm signals, the resistance to 5v(supplied by PWM) was actually 250/4=62.5ohm.
    My motor has 9.6ohm internal resistance
    62.5ohm divider: 9.6/9.6+62.5ohm x 5V==>motor was only getting .666v….
    Current through the motor 5v/72.1ohm = 69.3mA
    This was not enough to get it spinning nicely...


    Here's where I destroyed 2 pics:
    I quickly tried hooking up one of the 4 pwm signals through a 2n2222 to
    boost the current. Although i thought i had enough protection using diodes when I ran the program, not much happened... Also some sensors on i2c and power lines didn't blink as they normally do at startup. Only removing the pic 16f690 got those sensors blinking again. After adding some more diodes, safer resistor values I tried again with another pic....Same result... Unfortunately I can not reproduce the exact schematics as it was 5am and I was tired a little impatient and yes...drinking...
    I think I may have left the other pwm pins floating, or possibly switched the collector and emitter. All I know is that I didn't even get to see smoke...


    Can anyone advise me on a lowest partnumber/smallest parts solution that would do the beforementioned. HERE IS WHAT I HAVE IN MIND...
    Attached Images Attached Images  
    Last edited by Michael Wakileh; - 5th August 2007 at 13:34. Reason: added schematic

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Question

    That diagram's a little hard to follow.
    Does this look like what you were thinking of?

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

    Hope not.
    <br>
    Attached Images Attached Images  
    DT

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    With a 2N2222A, here's what I think would work.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1915&stc=1&d=118632654 6">

    If you don't have a good, solid, well filtered power supply, the PIC will have problems. Resetting, or just doing weird stuff.

    And the motor's proximity to the circuit, may have the same effect.
    <br>
    Attached Images Attached Images  
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks Darrell... you always come to the rescue.... I will try this out tomorrow. You redrew my schematic nicely, but I did have the emitter going to ground (btw, which program do you use?)... Is there a difference in connecting the load between emitter and ground, or between collector and vdd (besides resistance increasing base to ground when the load is on the emitter side)? For power I try to stay mobile. Here I used just a 9V battery, 7805, 100nFcap, and an electrolytic cap.... Eventually I will be using 4 or 5 of these motors and probably a seperate power supply...

  5. #5
    Join Date
    Jun 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default app note

    Have you had a look at the MicroChip app note AN 893 . Hopefully it might be of some help.

    This should be the link to it.
    http://www.microchip.com/stellent/id...pnote=en012134

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Is there a difference in connecting the load between emitter and ground, or between collector and vdd (besides resistance increasing base to ground when the load is on the emitter side)?
    With transitors, the current you get out is dependant on the current from the base to emitter. If the voltage on the emitter changes, then the base to emitter current will be reduced. So if the load is between the emitter and power, ... as the transistor starts to conduct, the emitter voltage changes and counteracts the base current that's trying to turn it on. While it seems to kinda sorta work a little bit, you always end up with a lower current output.

    So basically, you want the emitter to be at a constant voltage, either GND or V+.

    But the difference is ... if you want to "source" current to the load from V+ (like in the first schem.) you would use a PNP transistor. Then output HIGH from the PIC is OFF, and LOW is ON.

    And as I read this back, it doesn't even make sense to me. (I'm a software guy).

    Alain!!! Help!!!! Anybody!!!
    DT

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Good explanation

    Thanks Darrel,
    I have seen it in print that the transistors should go one way but not the other, but never an explanation as to why.
    Thanks!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Michael Wakileh
    ...You redrew my schematic nicely
    Darrel.... what do you use for schematic drawings?
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Simple rules ...

    Quote Originally Posted by Darrel Taylor View Post
    And as I read this back, it doesn't even make sense to me. (I'm a software guy).

    Alain!!! Help!!!! Anybody!!!
    Hi, Darrel

    For simplicity :

    1) Motor ( or load ) has one terminal connected to GROUND

    - use a PNP Transistor w/Emitter to POwer ( or P- Mosfet W/ Source to Power ). the "ON" state will be with a LOW state from the PIC.

    2) Motor has one terminal Connected to POWER

    - use a NPN Transistor W/Emitter to GRound ( or N Mosfet w/ Source to GRound ). the "ON" state will be with a HIGH state from the Pic.


    That's all !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Darrel.... what do you use for schematic drawings?
    I guess I forgot to answer that part.
    Or maybe I was unconsciously avoiding it, since the program I use is a constant source of mental anguish.

    I use IVEX WinDraft/WinBoard.

    Ivex went out of business a couple years ago, and now there's no one to fix all the bug's.
    Which is probably why they went out of business in the first place. (there's a lot of bug's).

    And when the company closed, so did it's online Auto-Router server.
    So now everything has to be routed manually. And of course that's hard to do because of the Bug's.

    The last board I did, ... 18F6720, 10 other chips, 101 resistors,35 capacitors, etc. took almost 2 months to route manually.

    I've got to find another program. And PCB123 just doesn't do it for me.
    <br>
    DT

  11. #11
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Have you tried this?
    http://www.expresspcb.com/
    I can not complain about the service (fast board turn around) and the free program is easy to use.
    Dave
    Always wear safety glasses while programming.

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Darrel Taylor View Post
    I've got to find another program. And PCB123 just doesn't do it for me.
    <br>
    Hi, Darrel

    Did you had a look to the Ulticap/board/Route SUITE ???

    http://www.ewbeurope.com/fr/u_board.html

    a bit expensive, but works fine ... really fine !!!


    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  13. #13
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Have you tried this?
    http://www.expresspcb.com/
    I have.
    But just like PCB123 it's geared towards bringing business to that specific PCB manufacturer. So you can't take those files to another board house (that's probably cheaper). And if I'm designing a board for a customer, I can't lock them into 1 specific vendor. They want the gerber files and NC files so they can have them made wherever "They" choose.

    Quote Originally Posted by Acetronics View Post
    Did you had a look to the Ulticap/board/Route SUITE ???

    http://www.ewbeurope.com/fr/u_board.html
    No, I've never seen that one. The screenshots look nice, but I don't understand a word they're saying.

    I'm thinking of looking at PADS or something.
    One that'll be the last program I have to learn, and will still be around in 15 years.
    <br>
    DT

  14. #14
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I have.

    No, I've never seen that one. The screenshots look nice, but I don't understand a word they're saying.

    I'm thinking of looking at PAD's or something.
    One that'll be the last program I have to learn, and will still be around in 15 years.
    <br>
    Hi,

    I didn't understand exactly what was going on with their site ... in English, it's redirected to National's site ... but no more Ulticap ( Scheme drawing ) just Ultiboard and Ultiroute !!!

    For price, I saw ~ 2500 Euros for the 1400 pins limited version.

    I think the best to see is to ask for the free demo CD ...

    For personnal use, I could send you a copy of the "elder" 5.5 v CD ( dating 1998 ? ) ... but some little bugs ( easily avoidable !!! ) are still existing.
    It's legal ... cause the Ultimate Technology Society ( original creator) no more exists nor supports this version ... which was NOT Copy-protected !!! ( hahaha !!!!)

    Personnally, I use the 5.71/72 Unlimited Student version ... that need a DONGLE.
    If you want samples ... just ask : Malc C train Controller for Example !!!

    The look is very close to today's versions (9.x or 10.x ). just the 3D show didn't exist.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  15. #15


    Did you find this post helpful? Yes | No

    Thumbs up

    I finally got around to actually testing the above circuit and it works perfectly! I used a seperate power supply for the motor, because my program slows down when everything runs off of my old battery. I got the impression that my communication routines take much longer when the motor is on, and I suspect this is due to undervoltage (I will post results with a new battery). Anyway I just wanted to finally thank you all for the great help and links, especially Darrel for his great transistor explanation...

    While searching for schematics and layout programs I did stumbled upon eagle (http://www.cadsoft.de/). I've started using the free version which is limited to 4 x 3.2 inches, two signal layers, and one sheet for the schematics.... Doesn't seem that hard to learn because there's lots of good tutorials out there (for example on programming new parts etc) and there's a lot of downloadable parts libraries. It can output in a lot of formats (some for 3rd party board production, some vector formats for home etching, and also there's a ULP addon for producing G-code directly), but it doesn't do any simulation. I prefered the graphics of the schematic layout on IVEX Windraft (color contrast makes it easier to follow and nicer for web publishing..) and I'm not sure if there's a lot of eagle users in the US, but if you're looking for a solid program that will probably be around for quite some time you could give it a shot...

  16. #16


    Did you find this post helpful? Yes | No

    Default

    Also there seems to be a library for 3d show...
    http://www.matwei.de/doku.php?id=en:eagle3d:eagle3d

  17. #17
    Join Date
    Jan 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Thumbs up

    Last edited by Sean_Goddard; - 21st August 2007 at 13:13.

  18. #18
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default IVEX WinDraft and/or WinBoard

    Quote Originally Posted by Darrel Taylor View Post
    I guess I forgot to answer that part.
    Or maybe I was unconsciously avoiding it, since the program I use is a constant source of mental anguish.

    I use IVEX WinDraft/WinBoard.

    Ivex went out of business a couple years ago, and now there's no one to fix all the bug's.
    Which is probably why they went out of business in the first place. (there's a lot of bug's).

    And when the company closed, so did it's online Auto-Router server.
    So now everything has to be routed manually. And of course that's hard to do because of the Bug's.

    The last board I did, ... 18F6720, 10 other chips, 101 resistors,35 capacitors, etc. took almost 2 months to route manually.

    I've got to find another program. And PCB123 just doesn't do it for me.
    <br>
    I use IVEX WinDraft and WinBoard--and PentaLogix ViewMasterEZ for post-editing the Gerbers. Never much anguish, mental or otherwise. My last upgrade was to 3.12 on WinDraft and 2.26 on WinBoard.

    I rarely have problems with WinDraft/WinBoard. Which bugs are "bugging" you? The only chronic, serious difficulty I've encountered is laying in copper zones (such as ground or power planes) with WinBoard, but I started doing that with ViewMasterEZ.

    On routing, I don't know what to say--I learned PCB layout before CAD, when it was done on a drafting table!--so I find "manual" routing with WinBoard is a breeze (I never used their auto-routing service). As you've probably already discovered, the first secret of easy routing is starting with the right component layout--and that's more nearly art than science!

    But if I can help you (or anyone) out with WinDraft and/or WinBoard problems, let me know. Fundamentally, they are good, powerful products and, since the company is gone, now very accessible.

    IVEX was around for over a decade (that's a long time for a small company in a technology field) and did not fail because of a "buggy" product. While in business, they constantly improved and updated their offerings and were even distributed by NTE. They were, I believe, "caught in the middle" between the low end, inexpensive (or free) manufacturer-specific products (PCB123 is an example) and the high end (ORCAD). The founder decided to shut down and move on. I don't agree with how he did it, but I understand the why. And there are still a lot of IVEX users out here.
    Last edited by RussMartin; - 28th August 2007 at 08:50.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  19. #19
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    That would be great if you could tell me how to keep it from corrupting the file when it gets big.

    Once it goes over about 500 pins or so, things start going haywire. (I have an 850pin license).

    I'll be working away and suddenly after moving something, the rats nest goes crazy.
    Yellow lines between things that shouldn't even be connected together. When you hit F2 over a trace, it shows it's not assigned to any nets anymore, it's just blank.

    If I don't have the rats nest turned on when it happens, it may go unnoticed and get saved that way. Then I'm really cork-screwed. I have to search thru the auto-saved files hoping it hasn't gone too long, or it gets over-written. When that happens I start searching through the dozens of saved files I have, since I have to save after every successful placement, if not I lose hours at a time worth of work.

    It's a serious PITA.
    <br>
    DT

  20. #20
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    See my private message.
    Last edited by RussMartin; - 28th August 2007 at 09:45.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  21. #21
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Well, the first things I would need to know: Are you talking about WinDraft (for schematics) or WinBoard (for board layout)? And which version of either?

    Generally speaking, when you start crowding your pin limit (yes, 500 is crowding an 850 limit) with WinBoard, things can sometimes get a little flaky.

    One reason I may have fewer problems is that I'm an old guy and have never completely trusted personal computers. So whenever I'm doing something that creates a file, I automatically hit CTRL + S anytime I make a significant change. (I started doing this over 25 years ago, I think with WordStar on a CPM system--it was a Kaypro. It's still a habit.)

    Another reason I likely have fewer problems is that I run all of my IVEX stuff on a separate computer that does nothing else but schematic and board work--it's a cheap old clunker (Compaq Presario 1700), but it does the job just fine, since I don't use it for word processing and Internet and E-mail and who knows what else. All the programming duties on the bench are handled by another even older clunker (Compaq Armada 1700).

    You may have noticed with WinBoard that, anytime you move something, it recalculates.

    The simplest recovery (if you've saved the file regularly) is to close the file, re-open it, and simply re-import the netlist.
    Last edited by RussMartin; - 28th August 2007 at 17:45.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. Controlling stepper motor with PIC
    By The Master in forum Off Topic
    Replies: 3
    Last Post: - 1st July 2008, 10:21
  2. Driving Stepper Motor with PBL3717
    By crhomberg in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th November 2007, 20:59
  3. Replies: 5
    Last Post: - 12th September 2007, 15:59
  4. Driving a DC motor /w 16f84a
    By Lilmanmgf in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 15th May 2007, 12:39
  5. Motor Control PLC with a PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 2nd November 2006, 07:59

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts