I’m new to the forum, so “HI’s” to the community
I have the following problem. My motor is connected to the VNH5019 board (single board, not the shield). The VNH5019 board is connected to Arduino MEGA in “direct PWMing configuration” (INA and INB pins are connected to Arduino’s PWM output, while Pololu’s PWM pin is high (e.g. by connecting it directly to VDD). And for the matter of application I’m only moving in one direction.
The thing is that the setup works, most times. But there are times when the motor will not move. For those moments I measured the Pololu’s inputs to check if the INA is getting the input signal - and it is, so the Arduino is sending the signal correctly - but Pololu’s OUT just wont activate.
Connection is not an issue: as I say, the IN is activated, but the OUT is not, when the problem presents itself.
So, my guess is that the issue has to do with some synchronizing problems. As if sometimes the Pololu’s board doesn’t catch the IN at the right moment
Is there a necessary delay between, say, enabling a direction and driving or any other delays advised?
Thank you in advance for your time…
Welcome to the forum! I am sorry you are getting behavior that you do not expect. INA and INB on the VNH5019 are generally not intended to be supplied with a PWM signal. It might work acceptably at very low PWM frequencies, though at higher frequencies the chip’s response delay (which is how fast the output responds after the IN pins change state) can cause some issues. You can learn more about that response delay, tDEL, inside the VNH5019’s datasheet. Figure 7 has a nice diagram that explains the delay.
What frequency are you using for PWM? Also, is there a reason sending logic high and low to those pins while PWMing the PWM pin does not work for you?
Thank you for your reply!
The reason I’m using direct PWMing is because before using pololu driver I was using arduino PWM shield to drive 2 motors, and it was enough. Later, one of the motors had to be changed to a bigger one, the shield was getting hot, so I installed a pololu board between the Mega and Motor. So, in order to perform minimal changes in the connections and the programming, I’m using the 2 pins of the shield’s output for one of the motors to drive the INA and INB of pololu board while pololu’s PWM ping is connected to Vdd.
The frequencies are low, in fact, the operation os pretty basic. At the present stage of the model, this motor only gets to move in one direction during short periods of time (periods of several seconds) at the maximum speed (sending analogWrite(PWM_A, 255) from Arduino sketch).
If the “direct PWMing connection” is causing the problem, then probably I should connecting Arduino’s PWM pin directly to pololu’s PWM pin while operating INA and INB separetly or even wire INA=1 and INB=0 ´’cus I’m only using 1 direction right now.
I don’t think tDEL is the problem because, when the weird behaviour occurs, the pololu’s is getting the signal for much longer that even 1.6 us (tDEL max from datasheet) and OUT doesn’t enable itself.
That delay, tDEL, is actually a maximum of 1600us (1.6ms), not 1.6us (and has an average value of 0.4ms). The frequency of PWM signals using
analogWrite() is usually approximately 490 Hz (about 1ms cycle time) or 980 Hz (about 2ms cycle time). So, a typical delay of about 0.4ms out of every 1ms or 2ms is pretty considerable. I expect that you will not run into the same issues if you send PWM signals to the PWM pin, and command INA and INB with digital signals.