Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Why do my pics keep going away?

Status
Not open for further replies.

Tableleg

New Member
I'm finishing up a circuit to control some mirrors (I've posted here before needing help with my code if you remember me) using two 16F628's. Since I've hooked everything up, the 'Motor Control" pic has died. Twice!

Can anyone spot my problem looking over my schematic? The e-mosfets Q1 ~ Q4 are IRF620s and Q5~8 are NTE2388's. The 12 volt power supply is an old LCD power converter, and the 5v regulator is an NTE960.

**broken link removed**

A little about the program: the "Logic Controller" polls two control switches, and 4 motion limit switches (entering RA0~5) to determine what is where (via the limit switches) and what the user wants (the control switches). The PIC then has an associated output depending on the input states (output being RB0~3).

The Motor Driver pic then generates patterns of outputs (using PORTB) dependent on what inputs it senses (on PORTA) to drive two stepper motors. The common of each stepper motor is connected to the 12V supply and therefor when the gate of the mosfet gets the 5v from the pic turning it on, the coil is grounded, completing the circuit.

It has to be something about the e-mosfets taking the pic out, but I don't know enough about them to know one way or another. Thanks everyone for any help you can give!

Jason
 
There seems a general lack of components there?, I would also suggest you post the pictures on here, rather than using ImageShack or elsewhere. Simply click on 'Go Advanced', and 'Manage Attachments'.
 
The components there are what are on my bread board minus the stepper motors I have connected with long wires. (connected to the drains btw, I forgot to mention that) And when I program a new Motor Controller, stick it in there and it works for a little while. I can't figure out if there's something specificly blowing them (a specific output sequence for example).

As far as the schematic, the image posted is a link to the bigger file. I thought I'd be nice to Imageshac and post their bandwith friendly version. :) Click the thumbnail and it'll take you to a bigger version.
 
Did you add clamp diodes to the stepper? Where are your decoupling caps and filter caps, you're going to have lots of noise with a stepper.
 
I second Bluerooms idea, Also I would try adding resistors between the PIC and the gates of the mosfets and see if that helps. Experiment with the value I would start around 1K.
 
I don't have a pin out for that PIC in front of me, but since you have a pullup and switch to ground connected to pin 4 of the "Logic_Controller" chip, I take it for granted you left the RESET pin on the "motor_driver" chip floating. I'd say just connect it to pin 4 of the controller PIC and reset both at the same time.
I don't see any resonator or crystal/caps combo. Are you using internal clocks in this design?
I agree, you need bypass capacitors at the regulator and PICs, and resistors in line with the FETs.

FWIW,
kenjj
 
Blueroomelectronics,
I'm new to all this motor stuff. I took basic AC/DC/digital/semiconductor classes in high school (geez that's going on 5 years ago... lol) but we never covered any stepper motors. This entire project has been a learning experience! It was kinda funny, because I programed the outputs to fire in a four wire order, but these particular motors are run off of just two wires per direction! So if you toggle wire 1&2 back and forth, it'll move one direction; toggle wire 3&4 it'll move the opposite. It wasn't hard to chage the code, but little things like that (such as CHECK THE MOTOR YOU'RE TRYING TO MAKE A CONTROLLER FOR BEFORE YOU MAKE IT!!!) I've enjoyed figuring out.:p

As far as the decoupling caps (or d.c.), I need to pass the 5V to the mosfet to turn it on. I thought a d.c. was only for a DC separation of different parts of a circuit (amplifier stages of an amplifier circuit for example)? So in this case, wouldn't a cap in series between the pic output stop the mosfet from turning on? (I wish I could try this out, but alas, after hours...) What would you recommend for a decoupling cap in this case?


Brevor, kjennejohn,
I initially had a resistor (a 1k as a matter of fact) from the gate to ground. But with this resistor there, I couldn't reliably open the mosfet; the voltage there referenced to ground was not enough to turn the fet 'on'. I'm not sure whether it's because the resistor was loading down the PIC (5V/25ma=200ohms I would think would be the maximum resistor value before loading happens... it didn't occur to me to lessen that resistor down to 200ohms) or what, but I took it out, and it worked fine. Well, until the Motor Controller stopped working... lol I'll give that a try tomorrow and see what happens.

Filter caps: Should they only go on the input and ouput pins of the 5V regulator, or on every output pin on the pics? What should their values be? Maybe this question would be better answered by a link explaining them and I can figure it out myself?

Kjennejohn,
When I first started working with pics, that RESET drove me nuts!!! I've finally figured out how to disable it in my code, and instead use that pin as a general I/0. And yes, the 16F628 has an internal 37KHz oscillator that I haven't found a reason not to use yet. I've only been working with pics for a few months now (this is really my first project I've used them in) so I'm not used to having to supply an external clock frequency.


Much thanks for the help guys! I'm often glad there are people in the world much smarter than I am!:D
 
Here's something that may help, if your steppers are under 1/2A you can use an ULN2803 which is an octal darlington array with clamps. This one chip can drive a pair of solenoids.

As for the caps you could try 470uf and 0.1uf (near the PIC power pins)
**broken link removed**

**broken link removed**
 
hi..

Tableleg said:
The Motor Driver pic then generates patterns of outputs (using PORTB) dependent on what inputs it senses (on PORTA) to drive two stepper motors. The common of each stepper motor is connected to the 12V supply and therefor when the gate of the mosfet gets the 5v from the pic turning it on, the coil is grounded, completing the circuit.

It has to be something about the e-mosfets taking the pic out, but I don't know enough about them to know one way or another. Thanks everyone for any help you can give!

Hey..

why dont you try for ULN2803 or ULN2003 for interfacing with 12 volt stepper motor..?

See google images for its circuit diagram..

it is easily available in market , very easy , very cheap and very flexible to use..

you can even use it for relays..

Regards,

Simran..:)
 
Tableleg said:
As far as the schematic, the image posted is a link to the bigger file. I thought I'd be nice to Imageshac and post their bandwith friendly version. :) Click the thumbnail and it'll take you to a bigger version.

The point is you can do EXACTLY the same here, store your picture with a thumbnail.
 
Tableleg said:
The Motor Driver pic then generates patterns of outputs (using PORTB) dependent on what inputs it senses (on PORTA) to drive two stepper motors.
Jason

Hi Jason do you use PWM for this? Looks like you are directly turning PIC pins ON & OFF.

Have you ever heard a bridge driver called L298?For your application its an ideal solution.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top