Hi All
I’m using the Dual VNH5019 shield and I’ve written a program to operate a 12V DC car power window motor which is driving a butterfly value (drives a gear through 270 degrees) which turns the butterfly through 90 degrees. Anyway I’m having trouble with one of the safety checks I’ve added. I’m testing to make sure that when the motor is stopped getM1CurrentMilliamps() should be returning 0. I understand after issuing setM1Speed(0) there will be transient currents until the motor has reached stand-still, but after that I should expect to see 0 current shouldn’t I ?
This occurs even without the PC connected, but to try and work out what’s going on here is my simplified test and my observations:
I’m just calling getM1CurrentMilliamps() in loop and printing the result. I’m not issuing any command to adjust the motor at all. I have the jumper set to power the arduino from the motor supply and have the arduino connected to the PC so I can use the serial monitor. I start with the supply to the motor shield turned OFF and the arduino just powered by USB. The logging shows getM1CurrentMilliamps() = 0mA. When I switch the motor supply on I now see getM1CurrentMilliamps() returning a range of values under 250mA (measuring every 100ms). Eventually (after 30s to 1 min) this seems to settle and getM1CurrentMilliamps() returns 0mA again, almost like something warming up or inductance stabilising?? If I power the whole thing down the behaviour is repeatable.
Motor current: 0mA
Motor current: 0mA
Motor current: 102mA
Motor current: 0mA
Motor current: 0mA
Motor current: 0mA
Motor current: 102mA
Motor current: 34mA
Motor current: 0mA
Motor current: 0mA
Motor current: 0mA
Motor current: 102mA
Motor current: 34mA
Motor current: 0mA
Motor current: 0mA
Motor current: 0mA
Motor current: 68mA
Motor current: 102mA
etc
Can anyone shed any light on this? I’ve tried adding a 100uF electrolitic capacitor in the power supply spot on the shield without any effect and I’ve also tried adding a 0.1uF ceramic capacitor across the motor output without any effect either. The wiring to the motor is quite long (it’s at the opposite end of the car) but when I’m testing the car is switched off so there shouldn’t be many other currents etc… ?
Any insights greatly appreciated. Is my safety check a waste of time - ie is it an incorrect assumption that there shouldn’t be any measured motor current when the system is idle?