Germany
Asked — Edited

Check The Arms Like An Excavator

If I control the arms with the Servopad, everything is too rude for me. Has anyone ever driven an excavator?

If you move the joystick slightly in one direction, The arm moves continuously slowly in the direction. If you move the joystick strongly in one direction, The arm moves continuously rapidly in one direction.

For my robot I would like something similar. I would like a Servopad which when in use The arm continuously moves.

I can not find the function anywhere in the EZ software. Thank you.


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.

#1  

I am doing this with scripts and keyboard controls. Need to verify if it would work as well with joystick.

I am at work without access to ARC right now, but I believe there is a public version of my modified ROLI project in the cloud. Project is Myroli-mkii.

There is a script manager with various scripts for moving the arm and claw incrementally and looping as long as the key is pressed. Note, the specific arm is defined by a variable, which I change with another key press so I can use the same keys to control either arm.

Alan

Germany
#2  

Thank you for your help. I have loaded and tested your project. Looks very interesting. I had tried it similarly, And asked me if you could integrate it into a Servopad. But I can build a Joypad with buttons and scripts. Very interesting. thank you Your project helped me a lot.

Germany
#3  

I Use the Script with some changes for Servos.

repeatwhile(GetServo(2) < 170) Servoup(D2, 2) Sleep(150) endrepeatwhile

One Press on the Button und it works and second Press is stopping.

But when i want to make a emergencystop, i have no chance to stop all scripts with one order. I have try halt() stop() and release all.

How i can stop them?

And when a script running to servo up. And i forget stopping and press script for servo down, i think i can kill the servo. Do you have a way to stop only the other script from this servo? Thanks

PRO
Synthiam
#4  

Commands such as Halt() or Stop() are documented in the EZ-Script manual.

Halt() stops the current script Stop() sends a command to the current Movement Panel to STOP the robot from moving

Neither of those provide the logic you request. Keeping track of a variable is the best way. Here is a functional example...

SCRIPT FOR DOWN


# set a variable that we are moving
$movingDown = 1

repeatwhile(GetServo(2) &lt; 170)

  # Move the servo 2 degrees from current position
  ServoUp(D2, 2)

  # Pause for a brief time while servo moves
  Sleep(150)

  # Exit if another script told us to stop moving
  if ($MovingDown = 0)
    halt()
  endif

endrepeatwhile

SCRIPT FOR EMERGENCY STOP


# Tell scripts to stop moving 
$MovingDown = 0

#5  

@DJ,

I am again at work and can't open ARC (not allowed to install on my new computer. I am going to need to set up remote access to a home machine...).

Isn't there a way to do this with control command? ScriptStop if specifying a specific script object, and I think there is a stop all of some kind if the scripts are in a script manager object.

I think I even use this in the project referenced above. I know I have a panic stop script of some kind, but I forget if I named every script or if I had some global commands available.

Alan

Germany
#6  

Thanks for the example. This help me.

Halt() is for stop scripts.

But my scripts run away. They stopped only by reach of the limit from the servo. Halt() has no function in my script example.

I try yours. Thanks

PRO
Synthiam
#7  

Halt() works within the script. It does not stop other scripts. See my example, HALT() is for the current script. HALT() is not for other scripts. HALT() works within the scope of the script it is within.

All commands work only within their script.

Halt() Exit the current running script. <- The script that HALT() is inside Example: Halt()

See my example. See HALT() is used within the script. HALT() exits/cancels/stops the current script. SCRIPT FOR DOWN


# set a variable that we are moving
$movingDown = 1

repeatwhile(GetServo(2) &lt; 170)

  # Move the servo 2 degrees from current position
  ServoUp(D2, 2)

  # Pause for a brief time while servo moves
  Sleep(150)

  # Exit if another script told us to stop moving
  if ($MovingDown = 0)
    halt()
  endif

endrepeatwhile

Germany
#8  

Yeah. i have used your scripts. Its really cool.

Oh man, thats amazing when iam ready with this. Its really funny. Thanks

#10  

If you look at the Emergency Stop script in the MyRoli-MKII project, you will see what I was talking about using a ControlCommand to stop all scripts from the script managers and autopositions (if you have individual script objects instead of script manager, you can use ScriptStop on each script instead of ScriptStopAll on the script manager), then I stop the movement panel, disable all digital ports and finally release all servos.

DJ's method is also effective, and it can be global (ie, use the same variable, maybe call it "$moving" instead of "$movingdown", so it is really a matter of style, but my method keeps the actual movement scripts simpler but the emergency stop script more complex.

Alan

Germany
#11  

I havent see your script some days. Now i have found this.

Wow. Its the overkill Panicbutton. Thats really cool. This stop all.

I see, with this project i can learn a long time. Thank you for your help.

#12  

Thanks. That project is a test bed for a much larger robot I will eventually be making, so there is a lot of experimental stuff in it, and I change it around pretty regularly, but the stuff that works well will always be in the current version.

Alan

Germany
#13  

Hi, i need your help again. Iam using my robot mostly with computer but now i test the App. I have create all scripts and icons for the app and i have tested all with my computer. all works fine.

When i start the app with my handy, my scripts in the menu "Steuerung" does not work. I become the working icon, but my robot does not make the order.

This is the script on my Button.

ControlCommand(&quot;Script Manager Steuerung&quot;, ScriptStart, &quot;* T&quot;)

sleep(100)

ControlCommand(&quot;Script Manager Steuerung&quot;, ScriptStop, &quot;* T&quot;)

And this is the Script "* T". This is started and stoped from the button.

# set a variable that we are moving
$movingDown = 1

repeatwhile(GetServo(13) &lt; 175)

  # Move the servo 2 degrees from current position
  ServoUp(D13, 1)

  # Pause for a brief time while servo moves
  Sleep(15)

  # Exit if another script told us to stop moving
  if ($MovingDown = 0)
    halt()
  endif

endrepeatwhile
Germany
#14  

Hehe, no answer. I have forgotten the half world is sleeping ;-)

I have found my error self.