Thumbnail

Servo Recorder

by Synthiam

Record and play back servo movements on your robot at specified speed and direction

Requires ARC v15 (Updated 6/17/2020) Source Code

How to add the Servo Recorder robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Servo category tab.
  5. Press the Servo Recorder icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Servo Recorder robot skill.


How to use the Servo Recorder robot skill

This plugin allows recording and replaying servo movements in specified speeds and direction. Trigger the recording playback and speed using ControlCommand() from scripts.

Realistic Motions For realistic motion recordings, we recommend creating the recordings with the servo Pad Control. Find more information about the servo Pad here: http://www.ez-robot.com/Tutorials/Help.aspx?id=150

Recording You can store multiple recordings in this plugin. Each can be given a unique name that allows the recordings to be differentiated - click on the name to rename a recording. Pressing the Add button will append a new recording instance to the list. You may re-record over existing recordings as well. Press the Record button, which will set the instance to begin recording at the first servo movement.

Playback Individual or multiple recordings can be played back manually by pressing the Play button. Programmatically, you can play recordings using ezscript or Blockly. In Blockly, select the recording from the ControlCommand block located under Utility. With ezscript, the Cheat Sheet shows the ControlCommand() for starting and stopping the playback of each recording.

Playback Speeds & Direction The modifier allows playback of speed and direction. A value of 1 means original playback speed in forward direction. A value of -1 means original playback speed in reverse direction. The ControlCommand() also accepts an optional parameter for speed. You can specify a value between -5 and +5 with 0.1 increments. For example -0.5 is half speed in reverse. Half speed forward is 0.5.

There is also a ControlCommand() to set the speed while a recording is being played back. You can programatically reverse the playback direction with the ControlCommand() speed parameter, or change the speed.


// Play Reverse at half speed
ControlCommand("Servo Recorder", "Play", "No Name", -0.5);

// Wait for 2 seconds
sleep(2000);

// Set the speed to play forward at half speed 
ControlCommand("Servo Recorder", "Speed", "No Name", 0.5);

Variable There is a variable that returns the status of the playback of recordings. If a recording is being played back, the variable $IsServoRecorderRunning will be true. You can wait for a playback to complete by using WaitFor(). See this example code below, which will run Test 1, Test 2 and Test 3 recordings one after another. The WaitFor() will wait to see when the recording has completed, and the Sleep(100) is merely to ensure the recording has started before checking the variable. The sleep(100) is most likely not required, and my tests without it worked - but I put it in for safe practice. Test in your application to see if it's required as well, it may not be.

print("Playing test 1")

ControlCommand("Servo Recorder", Play, "test 1")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

print("Playing test 2")

ControlCommand("Servo Recorder", Play, "test 2")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

print("Playing test 3")

ControlCommand("Servo Recorder", Play, "test 3")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

User-inserted image


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#25  

This skill seems like it could be very useful. I haven't used it yet but a simple fix for the jumping is to have it go to a certain safe position before and after you send it into the command control. Didn't know this skill existed, very cool.

PRO
Synthiam
#26  

Automation, man, yeah, that's precisely it. And it's not a "fix" because there is no way to get from position 1 to position 180, for example, then to move. There's no other way to "fill in the missing positions" because there's no data to fill in with. It's a chicken and egg scenario - how can the robot move nicely between two positions when there are no positions? Haha.

If a servo "jump" is the issue, perhaps setting the servo speed to a slower value. That way, the servos will move slowly to the new position - I guess that's one way.

But realistically, as a designer, that's a responsibility you will have to endure: moving to a safe position after each animation.

An export/import option for the positions to be edited in excel could be done. But it would be best if you remembered that there would be thousands and thousands of rows.

#27  

DJ, When I record actions with this skill, I assume there is some file created and saved somewhere on my hard drive. Can I edit that FILE?

#28  

A similar skill that I use all the time is the AutoPosition which has frames and actions Inside of the frames you can move and edit each individual servo. This is very helpful to fine-tune each position exactly the way you want it to be.