Asked — Edited

Halloween Is Coming Soon

Hello To All,

This time of year my old plc controllers and arduino ends up at my friends Halloween Barn. I program a number of displays for our friends, both fiends and ghouls amusement.

This year my poor robots will become brainless for a while and two of my ezbv4's will become an addition to the party. One may run a talking head with facial tracking.

I was wondering if the object tracking mode works with an IR camera hooked to my computer? I would like to use my second ezb to run servos and a couple relays using object location and tracking (people) in the dark.

Any experiences or ideas?

Ron R


ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

#17  

Hello to All,

I have a final bug which I need help with. I have loaded all the code and I found the push button counter script kind of works. It advances to the next skit when pushed, and sequences properly.

My problem is the audio seems to work ok but the servos do not operate correctly when I use the sequence script. If I advance the script manager using the start button for a script, each script plays correctly. When I use the input button with the sequencer the servos begin to step slowly through their movement, and the time to run the Auto Position frames slows way down.

I think my problem is the signal to the script manager from the sequence script because the command from the sequencer is maintained. Could this causing the problem? or should it be that way? When I shut off the script I wrote for the sequencer during the running of the script, the skit then runs at normal speed.

This is the sequence script and is in a script box by it self.


$counter=0
:loop
WaitForChange(GetDigital(D8))

if(GetDigital(D8)=1) # button press was true
Sleep(5)

$counter++ #add 1 to the button counter

if($counter =1)

Sleep (5)
Set(D11, on)
ControlCommand("Script Manager", ScriptStart, "Script 1") 

Sleep (5) 
Set(D11, off) 

elseif($counter=2) 

sleep(5)
Set(D11,on)
ControlCommand("Script Manager", ScriptStart, "Script 2") 


sleep(5)
Set(D11,off) 
elseif($counter=3)
ControlCommand("Script Manager", ScriptStart, "Script 3") 



sleep(5)

elseif($counter=4)
ControlCommand("Script Manager", ScriptStart, "Script 4") 



sleep(50)

elseif($counter=5)
ControlCommand("Script Manager", ScriptStart, "Script 5") 



sleep(50)

elseif($counter=6)
ControlCommand("Script Manager", ScriptStart, "Script 6") 



sleep(50)

elseif($counter=7)
ControlCommand("Script Manager", ScriptStart, "Script 7") 


sleep(50)

elseif($counter=8)
ControlCommand("Script Manager", ScriptStart, "Script 8") 



sleep(50)

elseif($counter=9)
ControlCommand("Script Manager", ScriptStart, "Script 9") 


sleep(50)

elseif($counter=10)
ControlCommand("Script Manager", ScriptStart, "Script 10") 


sleep(50)

elseif($counter=11)
ControlCommand("Script Manager", ScriptStart, "Script 11") 


sleep(50)

elseif($counter=12)
ControlCommand("Script Manager", ScriptStart, "Script 12") 


sleep(50)

elseif($counter=13)
ControlCommand("Script Manager", ScriptStart, "Script 13") 

sleep(50)

elseif($counter=14)
ControlCommand("Script Manager", ScriptStart, "Script 14") 


sleep(50)

elseif($counter=15)
ControlCommand("Script Manager", ScriptStart, "Script 15") 


sleep(50)

elseif($counter=16)
ControlCommand("Script Manager", ScriptStart, "Script 16") 


sleep(50)

elseif($counter=17)
ControlCommand("Script Manager", ScriptStart, "Script 17") 



sleep(50)

elseif($counter=18)
ControlCommand("Script Manager", ScriptStart, "Script 18") 


sleep(50)

elseif($counter=19)
ControlCommand("Script Manager", ScriptStart, "Script 19") 


sleep(50)

elseif($counter=20)
ControlCommand("Script Manager", ScriptStart, "Script 20") 

$counter=0

Sleep(50) 

elseif($counter=20) 

print("return")

endif
endif
goto(loop)

Anyone see why it doesn't run correctly?

Ron R

PS I hope the UBB code works

#18  

A quick look. Almost done once sequencer works.

User-inserted image

Ron R

#19  

One problem I see is the amount of time you have given the Control Commands to execute may not be long enough. The Sleep time is in milliseconds so ;


Sleep(1000) # sleep for 1 second
Sleep(5) # sleep for 5 milliseconds 

Maybe try increasing the sleep commands to give time for everything to run.

#20  

I have changed the time ranges from 50 to 500 and still had the same problem. The original time was 500. It signals and advances every time, but the problem is the effect on the script. I seems to slow the script it calls way down. I don't know how to make it pulse the "Script start" ?

Ron R

#21  

How long does it take for each of your CC ' s to run? I know in my scripting if it takes 3 seconds for a CC to run, I have a 3 second Sleep after it. That way the script won't move to the next function until that one has run. If I don't give a CC enough time to run weird things happen.

#22  

My scripts are driven by a sequencer. When a push button hooked to D8 is pushed the script starts. The problem is the servos move real steppy and slow. If I shut the script box which holds the button and sequencer script off while the script is running, everything speeds up to normal. If I operate a script using the script manager the scripts work fine.

The problem is in the button / sequencer script, but I don't know why. I messed with timing, but it doesn't change or resolve the problem.

Ron R

#23  

Hi @bhouston

I got weird things happening so I will add a lot of sleep time (5000) and give it a try. I will let you know if it helps

Thanks,

Ron R

#24  

Try using ScriptStartWait instead of ScriptStart. This keeps the program from proceeding until the skit ends. There may be unintended interactions occurring by letting the program flow continue right after starting the script for a given skit. That way the timing should not be so critical either.