Vnh5019 time out after 5 mins

Hi team, does the Pololu Dual VHN5019 motor driver shield have an idle time function, because after about 5 mins without an input my motor controller stops working?

On initial power everything works well, only after 5 mins of no input do I have some problems.

I am controlling the motor driver via a RASPI from my laptop running a python program.

I have included the script, do you have any ideas what could be causing my problem.

#import subprocess
#subprocess.check_call([“python”, ‘-m’, ‘pip’, ‘install’, ‘numpy’])
import pygame
import numpy as np
import socket
import sys

import paramiko
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=‘169.254.222.19’,username=‘pi’,password=‘raspberry’)
stdin,stdout,stderr=ssh_client.exec_command(“sudo python3 server.py”)
ssh_client.close()

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((‘169.254.222.19’,5555))

pygame.init()

display_width = 800
display_height = 600
black = (0,0,0)
white = (255,255,255)
red = (255,0,0)
green = (0,255,0)
blue = (0,0,255)

logoImg = pygame.image.load(r’logo.png’)
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption(‘Control Module’)
clock = pygame.time.Clock()

gameDisplay.fill(white)
gameDisplay.blit(logoImg,(0,0))
pygame.draw.rect(gameDisplay, red, [100, 500, 100, 100])
pygame.draw.rect(gameDisplay, red, [300, 500, 100, 100])

myfont = pygame.font.SysFont(“monospace”, 15)
leftEngineLabel = myfont.render(“Left Engine”, 1, blue)
rightEngineLabel = myfont.render(“Right Engine”, 1, blue)

joysticks = []
for i in range(0, pygame.joystick.get_count()):
joysticks.append(pygame.joystick.Joystick(i))
joysticks[-1].init()
print(joysticks[-1].get_name())

crashed = False
#left engine bar based at (100,500)
#right enggine bar based at (300,500)
valaxis0 = 0
valaxis1 = 0
right_engine = valaxis1
left_engine = valaxis1
while not crashed:
gameDisplay.fill(white)
gameDisplay.blit(logoImg,(0,0))
AR = 0
AL = 0
if valaxis1>0:
if valaxis0>0:
AL = 1-valaxis0
AR = 1
else:
AL = 1
AR = 1+valaxis0
else:
if valaxis0>0:
AL = 1
AR = 1-valaxis0
else:
AL = 1+valaxis0
AR = 1
AR = ARvalaxis1
AL = AL
valaxis1
PV = valaxis0
PVS = 1-abs(valaxis1)*1
AL = (1-PVS)AL - PVSPV
AR = (1-PVS)AR + PVSPV

gameDisplay.blit(leftEngineLabel, (100, 80))
gameDisplay.blit(rightEngineLabel, (300, 80))
pygame.draw.rect(gameDisplay, red, [100, 350, 50, int(200*AL)])
pygame.draw.rect(gameDisplay, red, [300, 350, 50, int(200*AR)])
#displaying engines PWM duty cycle
leftEnginePWM = myfont.render("PWM:"+str("{0:.2f}".format(100*abs(AL)))+"%", 1, blue)
rightEnginePWM = myfont.render("PWM:"+str("{0:.2f}".format(100*abs(AR)))+"%", 1, blue)
gameDisplay.blit(leftEnginePWM, (100, 100))
gameDisplay.blit(rightEnginePWM, (300, 100))
#displaying engines direction
leftEnginePWM = myfont.render("Direction:"+str(-np.sign(AL)), 1, blue)
rightEnginePWM = myfont.render("Direction:"+str(-np.sign(AR)), 1, blue)
gameDisplay.blit(leftEnginePWM, (100, 120))
gameDisplay.blit(rightEnginePWM, (300, 120))

clockR = int((-np.sign(AR))>0)
clockL = int((-np.sign(AL))>0)
counterclockR = int((-np.sign(AR))<0)
counterclockL = int((-np.sign(AL))<0)
pwmR = int(100*abs(AR))
pwmL = int(100*abs(AL))

for event in pygame.event.get():
    #print(event)
    if event.type == pygame.QUIT:
        crashed = True
    elif event.type == pygame.JOYAXISMOTION:
        if event.axis == 0:
            valaxis0 = event.value
        if event.axis == 1:
            valaxis1 = event.value
    elif event.type == pygame.JOYBUTTONDOWN:
        if event.button == 7:
            counterclockR = 2
            counterclockL = 2
            pwmR = 2
            pwmL = 2
            clockR = 2
            clockL = 2
            crashed = True
            #kill the engine
            #print(event)
#sending data to the server on the raspberry
send_bytes = str(clockR)+','+str(counterclockR)+','+str(pwmR)+','+str(clockL)+','+str(counterclockL)+','+str(pwmL)
send_bytes = send_bytes.encode()
send_bytes += b'\x00'*(256-len(send_bytes))
client.sendall(send_bytes)
pygame.display.update()
clock.tick(30)

pygame.quit()
quit()

Hi Michael,

Can you confirm that your connection to the network isn’t timing out? Maybe add a command to turn an LED on whenever the motors are commanded on, wait 5 minutes and see if the light is still responding when the motors are not. It could be possible that the board is overheating, although I feel like this is unlikely given its idle.

Hi Stephen, This is the second board. It is behaving in the same way. Can you seggest a way to check my network isn’t timing out?

Michael,

Do you lose the ability to control only the motors or everything on your robot? Add something to your sketch that makes an LED turn on whenever your motors are turned on. After a 5 minute wait check to see if the light still turns on when the Motors don’t move. If the light is on and the motors don’t move its something to do with your motor controllers, if the light doesn’t turn on then its elsewhere in your code and could be because your losing your network connection.