Inconsistent Red Blinking Robot Light

Our class is using Robotmesh’s python platform on a set of modified clawbots, and no matter the complexity of our code, and no matter which of the 6 cortex/controllers we use (via USB or wireless), we occasionally get failure causing the robot to freeze with whatever current motor.run values were last given. When this failure occurs, the Robot light on the cortex blinks red slowly, but the vexNET light remains green, which I understand to be a user programming error. I can never recreate an error and they tend to happen once every 5 to 10 minutes of operation. These errors are most likely to happen during moments of change, like during a turn, or when an arm is going up or coming down, but sometimes occurs when the robot is not moving at all.

The default programming does not cause this error, but every time I have written code involving an “if” statement or a calculation (like arcade drive), this error is liable to pop up. No encoders or sensors of any type are being used in our robots.

I have searched over other threads dating as far back as 2011 for information relevant, and none seem to address my issue, so I am left with what I believe to be two current options: Find the source of the error, or learn how to write code that can handle exceptions (if that can be done in PROS or Robotmesh).

If you would like to make your project public and send us the name or project number, we would be happy to look at your code and make recommendations. To make a project public, open it, click on the “Options” gear, and change privacy to “Public Project (including code)”. Even if your project is public, others cannot edit your code. You can send us an email at support@robotmesh.com when your project is ready…

You are crashing the cortex. Are you using IMEs ?
edit: reread your question, I see you are not. As Rick said, post the code somewhere.

make sure if you are using a controller make sure that the channels are set right

It ain’t elegant but here you go. Before I added the array average-velocity bit, it still exhibited the errors.


# VEX EDR Python-Project
import sys
import vex
import math
import list

#region config
left     = vex.Motor(1)
open     = vex.Motor(2)
lift     = vex.Motor(3)
tilt     = vex.Motor(4)
rotate   = vex.Motor(5)
right    = vex.Motor(9)
joystick = vex.Joystick()
#endregion config

joystick.set_deadband(20)
mult = 0
checkval = 0
larray = [0,0,0,0]
rarray = [0,0,0,0]


rvalin=0
lvalin=0
lsum=0
lout=0
rsum=0
rout=0

ctl=True
while True:
    checkval = math.sqrt(joystick.axis3()**2+joystick.axis4()**2)
    if checkval<90:
        mult=.4
    else: 
        mult=1
    lvalin=mult*(joystick.axis4()+joystick.axis3())
    rvalin=mult*(joystick.axis4()-joystick.axis3())
        lsum=lsum-larray[3]+lvalin
    larray.insert(0,lvalin)
    del larray[4]
        rsum=rsum-rarray[3]+rvalin
    rarray.insert(0,rvalin)
    del rarray[4]

    lout=lsum/4  
    rout=rsum/4

    left.run(lout)
    right.run(rout)

    if abs(joystick.axis2())<90:
        lift.run(.5*joystick.axis2())
    else:
        lift.run(joystick.axis2())

    if abs(joystick.axis1())<90:
        rotate.run(.5*joystick.axis1())
    else:
        rotate.run(joystick.axis1())
    
    if joystick.b6up():
        open.run(30)
    elif joystick.b6down():
        open.run(-30)
    elif joystick.b8up():
        open.run(100)
    elif joystick.b8down():
        open.run(-100)
    else: 
        open.off()

    if joystick.b5up():
        tilt.run(60)
    elif joystick.b5down():
        tilt.run(-60)
    else: 
        tilt.off()
    sys.sleep(.02)


Could the error be in the int=.4int operations? I just converted the int operations to int=4int/10