Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: sambhav on May 11, 2007, 11:37:56 AM

Title: motor causing unknown pulses...HELP!!!
Post by: sambhav on May 11, 2007, 11:37:56 AM

Hiiii frnds...
i hv designed a ckt for obstacle detection using ultrasonic sensors...
This is a part of my final yr project...
The ckt when tested gives high pulses at the o/p wen an obstacle is placed in front of the sensors while the o/p is low wen there is no obstacle...
This o/p is given to PIC 16f877 which controls the on/off of dc motor.

Driving of motor:
The o/p pin of the PIC which controls the motor is connected to ULN 2803 relay driver which drives a 5v relay which turns the motor supply on/off..

what is expected to happen..:
the ckt is fitted on a small toycar... with the sensors fixed infront..
when the mode is selected,the PIC turns on the motor by activating the corresponding o/p pin.the motor( and hence the vehicle) moves until a pulse is obtained at the sensor o/p. when this happens the PIC pulls the o/p pin low to turn off the motor.. The chip is programmed and the program is simulated using MPLAB and gives works as expected...

What actually happens:
When the mode is selected..and there is no obstacle ahead of it,it was found that the moment motor starts to run, some pulses are obtained at the sensor o/p as long as the motor is running, which are misinterpreted by the PIC as the obstacle pulses and hence it stops the motor..from wher do these pulses come..???

So wat i did ws..i removed the motor and connected a non inductive load instead (a resistor and an LED in series) jus to chk if those pulses are obtained.. bt this time no pulses wer obtained...ONly when an obstacle was placed infront it detected pulses..
So it is almost confirmed that it is the motor that is creating the problem..maybe it sends some back current or the only common thing i can see between the motor and the sensor ckt is the PIC and the VCC and GND...otherwise there is total isolation..
so Can anyone help me solve this prob..??? i tried putting cap, diode etc across th the same thing happens...
So any help will be appreciated...
Thank you...
Title: Re: motor causing unknown pulses...HELP!!!
Post by: pelibot on May 13, 2007, 11:46:43 AM

Well, that sure sounds like a power supply problem.
What is your VCC quality ?
How is it implemented ?

Did you notice voltage drop when motor start ?
A voltage drop may cause your proximity sensor to give false readings.
It is best to drive the motor directly from battery (threw relay or H-Bridge) and the sensor and other electronics threw a voltage regulator with lots of capacitance before and after regulation...
Title: Re: motor causing unknown pulses...HELP!!!
Post by: pelibot on May 13, 2007, 11:52:11 AM

Another thing may be not related with the motor but with movement of your robot....

If you are on the edge of the proximity threshold, you may get high frequency burst of pulses because the sensor can not decide if it is too close or too far...

Try low passing the sensor or schmit triggering it.
That depends on your implementation.

Title: Re: motor causing unknown pulses...HELP!!!
Post by: Admin on May 13, 2007, 04:49:42 PM
Ok Im suspecting the motor (especially the relay) is causing voltage spikes to go through your system. You will need to dampen these out:

1) Put a large capacitor between power and ground of your power supply. It depends on your power draw, but perhaps ~10mF will do it.

2) Put a tiny capacitor across both leads of your relay and motor. Perhaps 10uF or less.

3) Make sure both of those capacitors are rated at twice the voltage of your power supply.

4) If possible, replace the relay with a MOSFET (or even better, a motor driver). Relays are horrible for robot motor control. With a MOSFET/driver you can also do PWM.