Hi, I'm new to the forums. I'm a computer science student with an interest in electronics and machining and I'm currently in the process of building a laser engraver. I had a bunch of parts and microcontrollers (specifically PIC18F252 and a few others) left over from a previous project and when I decided to build my engraver, well I decided to build the controller as well.
My problem has something to do with the parallel interface to the laptop I'm using. I'm using EMC2, but I believe the problem has something to do with my circuit and I'm at a loss to why. I don't have time to post a circuit diagram right now, but I can later if that'd be of help but a basic description is this:
I have a pic18F252, I'm regulating a 12V supply down to 5V for the MCU. The 12Vs is used to supply the stepper motor (52 oz/in 6-wire unipolar [6v at 0.8A]). The coils are driven by 4 TIP120 Darlington Transistors (with diodes to protect against back emf) that are wired to PORTB of the PIC (specifically ports 7-4). PORTC handles the incoming information, PortC.7 is used to control the (currently this is the x-axis others will be implemented later) x-steps and PortC.6 is used to control x-direction. If PortC.7 is high the stepper will rotate 1 step, wait 7 uS and then return to the main loop to check if the pin is high again (I can post the entire program later if need be).
Ok on to the problem.
There seems to be line noise and induced voltage on the control pins but I have no idea how. If I first plug everything up and turn it on, it works just fine, start up EMC2 and let it run and it seems to run just fine, but as soon as the job is done, the stepper starts...twitching, moving in random directions and usually continuing for partial rotations before turning back. I tried a 0.1uF cap on the control lines but that had no effect (and actually caused the motor to stop responding). I tried to pull the control pins to ground with a 10k resistor, and a 470 resistor, still random twitching. Lastly I used a diode and a resistor to hopefully pull the pins low enough to not trigger but alas, my stepper is still a twitching.
Oh and here is the really fun part -- I'm sure this will throw you for a loop.
If I unplug both the control lines from the breadboard the stepper stops moving as expected. But, if I move my finger within about 1/2" of the pins (without touching anything) the stepper starts twitching. The closer to the pins my finger moves the faster the stepper twitches, and yes anything conductive including wire and components moved withing the same area induce the same effect.
After hunting down other schematics for Pic based control circuits I'm not seeing anything indicating that this is 'normal'
I'm really at a loss here, has anyone ever heard of or seen this behavior before?
Thanks for your time, if there's anything confusing just ask and I'll try to clear it up, I'll also work on a circuit diagram and post it if that'll help.