Please HELP...

Thread Starter

Minaco

Joined Jun 14, 2009
3
Hi, I'm working on a robot controller by PIC16F877A, I've a DC motor driven by L298, and a rotary encoder mounted on the motor's shaft, the resolution of the encoder is 400 PPR, I take the signal from the encoder through a low pass filter and a Schmitt trigger, then an external counter divide the frequency by 16,
Now when I power up the circuit and move manually the motor, the PIC counts right, after a certain number of pulses a led give me a signal.
But when i connect the motor to the driver the PIC doesn't count correctly, it counts more pulses than the correct number, for example if the motor has to stop after 2 rotations, it stops only after a half rotation, that mean that the PIC counts false pulses.
I think these false pulses come over from noise on the PIC that have to count the pulses, but i use 2 low pass filters, and a schmitt trigger,,,

Someone can help me overcome this problem ???

THANK YOU
 

Thread Starter

Minaco

Joined Jun 14, 2009
3
Thank u all
my motor require a lot of current, so i tried to isolate the L298 supply from the PIC supply and i used optocoupler, it worked well, but i have 2 question.

In the isolation i used 2 different grounds, it's not good for me, i need to use only one ground.
But if i use only on ground problems occur, so isolation is not valid, right ??
And i need to feed back the current through the motor by a Shunt to the PIC, but this is not possible now because i have 2 grounds, so how may i isolate an analog signal ??

THNX again
 

beenthere

Joined Apr 20, 2004
15,819
They may need to be common at one point so he can use one to control/measure the other. We can only hope for a schematic to clarify things.
 

Thread Starter

Minaco

Joined Jun 14, 2009
3
Here there's a schematic,
now the problem is that the Vsense is referred to GND2 and the PIC ground is GND1, now how can I interface this analog signal (Vsense) with the analog input of the PIC?

THANK U SO MUCH FOR THE HELP:)
 

Attachments

Top