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

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

#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