vhn2sp30 Motor control works only when controller is powered on first - Page 1
Forum section: electronics / projects

author: praveen_khm
author_rank: Contributor
timestamp: June 18, 2017, 04:03:56 pm
content: Hi,Good Scenario :I have designed a motor controller using vhn2sp30 motor driver from ST microelectronics and Atmega328P is the controller. I power on the microcontroller from a different source (USBasp is connected to PC which turns on atmega328P) and program it using Arduino. I have connected a motor to output pins and when I connect battery power to VHN2SP30 chip, the motor starts running. Everything seems to be working as expected.Bad Scenario:The trouble starts the other way around. I connect the battery to VHN2SP30 chip and then power on the Atmega328P chip from another 5v source, but the motor does not rotate. There is also a regulator connected to Battery input which provides regulated 5v supply to AVR chip. Even in this case, the motor does not work. I tried removing the regulator / keeping the regulator. Whatever I do, it does not make the motor rotate. The only way is to power on AVR chip from an external source and then connect the battery.Very Bad Scenario:The third scenario is when the battery is connected and the motor is spinning, when I press the reset button, it resets the chip and then the motor stops. I need to remove battery supply to motor driver and reconnect it.Does anybody know why this might be happening?More information:1. There is a 35v, 470uF electrolytic capacitor attached to motor driver power pins2. A 100uF 10v tantalum capacitor is connected to 5v and Ground pins (to output of regulator)3. Regulator used is LM1084 from Texas instruments4. Battery is fully charged with capacity of 2200uA and 11.1V5. Tried different motors from tiny toy motor to metal gear motors, but the result is the same.6. There are two LED's connected which turns on when motor turns on either direction. In the Good scenario (when motor is spinning) the LED turns on to indicate direction. In the bad scenario, when motor is not connected, the LED still turns on to indicate direction. However in the same bad scenario, when the motor is connected, the LED turns off.Attached the schematic of the motor driver.Can someone help me find a reason or a solution to this issue?Best Regards,Praveen

author: mikerj
author_rank: Super Contributor
timestamp: June 18, 2017, 05:45:50 pm
content: Why are the power grounds being switched through the MOSFET? If you bypass the MOSFET (i.e. short Drain/Source) do you still get the same problem?

author: praveen_khm
author_rank: Contributor
timestamp: June 18, 2017, 06:42:36 pm
content: That is just to avoid reverse voltage in case of wrong battery connection. However, there is no change even if shorted them.Two more observations:When the board is in bad scenario, the voltage on motor output pins will be 9v (same as input voltage) and 8.8v (voltage drop). However, on a good scenario, it is 0v in one and 9v on the other. LEDs are bright when the motor is spinning and when no motor is connected, the LED lights up really light.PWM does not work on the board. If motorGo(0, CW, 1023); is not 1023 even in a good scenario, the motor does not rotate. So, the possibilities of motor running are: a. Provide 5v input -> Program and make sure PWM is 1023 -> Connect battery -> Motor Spins.

author: bktemp
author_rank: Super Contributor
timestamp: June 18, 2017, 06:48:43 pm
content: Quote from: praveen_khm on June 18, 2017, 06:42:36 pmThe way the mosfet is connected, it will not work. It will even make it worse:You need to connect the mosfet between battery and GND, not between GND and IC.If only the IC gets disconnected, all the input signals are still connected to GND via the AVR. This will most likely fry both the motor driver IC and the AVR.

author: praveen_khm
author_rank: Contributor
timestamp: June 18, 2017, 07:42:54 pm
content: Thanks for the response. I referred the schematic from pololu website :https://www.pololu.com/product/708Hence the MOSFET. Is there anything wrong in the schematic?

author: praveen_khm
author_rank: Contributor
timestamp: June 19, 2017, 08:00:06 am
content: Any help please?

author: jwm_
author_rank: Frequent Contributor
timestamp: June 19, 2017, 09:15:53 am
content: Are you sure the mosfet is genuine and not damaged? If it has a higher Rds than expected as motor current increases the driver ground will get further away from logic ground perhaps to the point the gates no longer see high levels properly. I'd jump across the mosfet for now until you have fully debugged the issue. You can measure the voltage across it too.To do it properly your ground (for the full system, not just the motor) should be above the mosfet and the bottom of the fet should be connected to V- (negative battery terminal) rather than ground.So the negative battery terminal will be slightly lower than ground depending on motor current.

author: praveen_khm
author_rank: Contributor
timestamp: June 19, 2017, 10:36:19 am
content: Just to check the issue of Mosfet, I bypassed it by shorting the drain and source. But the issue is still the same.When the checked the voltage on MOSFET, it shows 2.25v when the driver is working and when I click reset and motor stops, even then the voltage across the FET is 2.25v.Should there be any other issue which I am not able to identify?

author: jwm_
author_rank: Frequent Contributor
timestamp: June 19, 2017, 11:10:19 am
content: Hmm.. what about the 5v going to the enable lines, will those be floating when you have the battery plugged in but no MCU power? Maybe that is putting the chip in a weird state.You can brute force it by pulling the gate of q1 low under mcu control. So the mcu wont let the driver get power until it it good and ready. This may have an advantage when it comes to battery life too if there are times the mcu is running but the motors are not.

author: praveen_khm
author_rank: Contributor
timestamp: June 19, 2017, 12:49:01 pm
content: Enable lines are pulled up to 5v through a 4.7k resistor. I tried removing them and control it in the program. But still clueless.QuoteA sample board is already designed and hence struggling with this. I will try pulling the Gate pin out and connect it to a MCU pin and check if that might work as expected.