Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by Rich!

Servo Speed

I have two questions

#1 - what are the values that make the continuous rotations servos go slow? For example 90 is to fast but I can seem to figure out what the range from real slow to real fast is.

#2 - could someone provide me an example script that would drive the robot forward at the speed determined by a value in a script.

Thanks.

United Kingdom
#1  
Servo Speed doesn't affect modified servos.

In the modified servo control the values need to be closer to 90 for slower speed. Default forward value is 180 and default reverse is 1, change these to 100 and 81 and see it is slower.

An example to use scripting to move modified servos at speeds would be something like this (however may prove useless since it's generic and your application will be specific).

Code:


# Move modified servo at different speeds
# Assumed modified servo on port D0

$ModifiedServoSpeed = 0

# Loop speed from 1 to 180
RepeatUntil($ModifiedServoSpeed > 180)

# Increase the speed
$ModifiedServoSpeed++

# Move the servo at speed
Servo(D0, $ModifiedServoSpeed)

# Reduce processing load
Sleep(100)

# Loop back around
EndRepeatUntil

# Release the servo
Release(D0)


This will start at the fastest speed in one direction and slowly slow down, stop then gain speed in the other direction.
PRO
USA
#2  
Another question. When add the port for D1. I have one wheel going one direction and the other wheel going the other direction...How do I fix that?
United Kingdom
#3  
Change the numbers around. If a value of 1-89 is moving it the wrong way change it to 91-180, if 91-180 moves it the wrong way change it to 1-89. This is presuming that 90 stops it.

Basically, the command will work like this;

Code:


Fastest Forward <----- Stop -----> Fastest Reverse
1 <-------------------->90<------------------> 180


The closer to 90 the slower the speed. Once past 90 it will move the other direction.

Run the example code I provided above and it will show you this.
PRO
USA
#4  
how do I turn off all power to the wheel servos?
United Kingdom
#5  

Quote:

Release (servoPort)
Release a servo from holding its position
Example: Release(D14)


I presume it would also release a modified servo from it's current "position" or speed.
PRO
USA
#6  
How do I name and call a subroutine?
United Kingdom
#7  
Check the learn section

It depends what you mean by sub routines.

There are a few ways to run sections of the same code multiple times. One way is goto and return, another is controlcommand.

In addition to the learn section take a look at the tutorial on EZ-Script.

Some examples of both ways of running "sub routines" can be found in my PingRoam scripts. Version 1.2.0 uses ControlCommand() a lot to run the same code multiple times. While previous versions use Goto and Return. Both are in my Cloud FIles

Also, try not to get too far away from the original topic description, it makes it harder for other users to find when they search for similar questions.
PRO
USA
#8  
Thanks for the assistance and direction.