Requested — Edited

WISH LIST - Auto Connect Check Box And Servo Buttons Score 1431

Hi guys,

I can't find a wish list area, so I'm posting this here. If there is a wish list area, please move this post there.

I would like to see an Auto Connect checkbox in the connections setup. and a Min and Max buttons and slide bar added to servo Controls, is this possible?

User-inserted image

Thanks for listening Steve

Want to see this feature happen? Like it to increase the score.

Related Hardware LattePanda
Related Control Horizontal Servo

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.

#1   — Edited

Hi Steve,

I'm not sure what your skill level is with ARC or ARC. I'll assume a beginner to simplify my explanation to follow. If you already know this please forgive.

As far as the Auto Connect, what is your need to have that button on the connection control? Is it to auto connect when your projects starts up? Usually if builders want the project to auto connect they place ControlCommands in a INT Script and start the project from a shortcut from windows desktop.  There is a tool on the Builder and ARC top menu to make a shortcut that will start the INT Script when the program opens. It's under the Options tab and called Shortcut Creator.

Inside the INT script you can start up the connection process and start ans set all kinds of other devices. I connect all 4 of my EZB's, set Varables, set servo speeds and positions and initiate my serial ports along with a ton of other things. After the INT Script finishes my robot is connected and ready to run.

If you are looking to just connect one EZB after the project loads you can just click the connection button that is already on the Connection Control. If you want to connect several at the same time you can write a script and place the commands in it for one click connection. Like this:

Quote:

 ControlCommand( "Connection", Connect0) #Connect Torso EZB Board-0
Sleep(250)
ControlCommand( "Connection", Connect1) #Connect Leg Section EZB Board-1
Sleep(250)
ControlCommand( "Connection", Connect2) #Connect Arm Section EZB Board-2
Sleep(250)
ControlCommand( "Connection", Connect3) #Connect Brain Section LoTiny EZB Board-3
Sleep(500)

Here is what parts of my INT Script look like:


# #Connect all 4 EZBs
Sleep(250)
ControlCommand( "Connection", Connect0) #Connect Torso EZB Board-0
Sleep(250)
ControlCommand( "Connection", Connect1) #Connect Leg Section EZB Board-1
Sleep(250)
ControlCommand( "Connection", Connect2) #Connect Arm Section EZB Board-2
Sleep(250)
ControlCommand( "Connection", Connect3) #Connect Brain Section LoTiny EZB Board-3
Sleep(500)

# -------------------------------------------------------\
# #Specify the ranges for the servos
# #this prevents the servos from ever going past these limits

# Rt side_to_side Wrist
SetServoMin(2.D0, 120)
SetServoMax(2.D0, 165)

# Rt Up_Dn Wrist Servo
SetServoMin(2.D1, 20)
SetServoMax(2.D1, 170)

# Right Claw
SetServoMin(2.D3, 77)
SetServoMax(2.D3, 99)

# Left Up_Dn Wrist Servo
SetServoMin(2.D4, 14)
SetServoMax(2.D4, 180)

# Left side_to_side Wrist
SetServoMin(2.D5, 82)
SetServoMax(2.D5, 138)

# -----------------------------------------------------

# #Start and Home devices and anamate startup. Also
# #Initialize the Peripheral UARTs on all the EZ-B v4 with
# #the specified baud rate.

UARTInit(0, 0, 9600 ) #Turn on EZB 0 Uart #0 port - Radar
UARTInit(1, 0, 9600 ) #Turn on EZB 1 Uart #0 port - Waist
UARTInit(1, 1, 9600 ) #Turn on EZB 1 Uart #1 port - Hip
UARTInit(2, 0, 9600) #Turn on EZB 2 Uart #0 port - Elbow's
UARTInit(2, 2, 9600 ) #Turn on EZB 2 Uart #2 port - ARS's
Sleep(1000)
uartWrite(2, 2, "1, start", 0x0d) #Start channel 1 on EZB 2 - Right ARS
Sleep(500)
uartWrite(2, 2, "2, start", 0x0d) #Start channel 2 on EZB 2 - Left ARS
Sleep(100)
uartWrite(2, 0, "1, start", 0x0d) #Start channel 1 on EZB 2 - Rt Elbow
Sleep(0500)
# ----------------

# ######################
# Halt() #Unmark here to stop script here for basic startup.
# ######################

# Following will Home waist motor and then leave it in the center postion.
ControlCommand("Script Manager", ScriptStart, "Home Waist")
Sleep(1000)
ControlCommand("Script Manager", ScriptStart, "Home Hips")
Sleep(500)
ControlCommand("Script Manager", ScriptStart, "Home Radar")
Sleep(50)
ControlCommand("Script Manager", ScriptStart, "Claws non-loop")
Sleep(750)
# ---------------------------------------------------
Sleep(9000)

# Start Bubble Up and Down Script
ControlCommand("Head Section", ScriptStart, "Happy, Sad Bubble")
Sleep(50)
ControlCommand("Head Section", ScriptStart, "Radar 1/4 Sweep")
Sleep(6500)

# -----------------------------------------------------------

# #Start turning off anamation and put B9 into standby and ready
PWM(D0,0)#Turn off Ear Motors (Torso EZB Board-0)
Sleep(500)
Release( 2.D3 ) #Release Rt Claws
Release( 2.D6 ) #Release Lft Claws

Now, the servo Control does have a slide on it. It's the green double direction arrow in the top left corner. You put your cursor on it, hold down left button on your mouse and drag it back and forth. Click the right button and you will get a list of numeric positions you can pick. However I do like the idea of a visible slide bar. I've always found the present virtual slider kinda hard to work. I'll stop here. I hope this helps somehow. Happy building.

#2   — Edited

I like your Ideas, but the best is the servo Idea, with a Min and Max slider, I never liked the way it was originally when you have a Inmoov that has close to 40 servos, the way it is now is  a royal pain, I always wondered why there wasn't a slide bar.  That is a great Idea. lets hope they add this feature.

PRO
USA
#3   — Edited

..or something with a visual representation of position/angle and min and max positions. Position could be controlled by slider OR rotating the virtual servo horn.

User-inserted image

In general I'd like to see a make over and update to controls specific to servos and animation, like Flowbotics.

#4   — Edited

@Dave Schulpius Hi mate, Thanks for your reply. I'm as newb as it gets, and you should never apologize for dummying down an answer or question, there is always someone who will learn from basics, but fewer that will learn from to techy answers.

I'm using is a : LattePanda with Leonardo on comm5 - (EZ-Genuino_Leonardo-636967356658216814.zip) Arduino mega on com7 - (EZ-Mega-v1-636848729355769322.zip) ARC - (2020-03-19 - so I could create a shortcut)

The reason for an Auto Connect box next to each board connection is because it can't get any simpler than checking a box to automatically connect on startup, and it would be in your face, so it would stop anyone else wondering how to autoconnect once a project opens.

I have created a script I called "STARTUP" on the ARC desktop to connect each board and set servos

ControlCommand( "Connection", Connect0) #To connect LattePanda Leonardo Sleep(200) ControlCommand( "Connection", Connect1) #To connect Arduino Mega Sleep(500)

Servo(1,D4, 0) Servo(1.D5, 0) ServoSpeed(1.D4, 0) ServoSpeed(1.D5, 10) Servo(1,D4, 90) Servo(1.D5, 90)

Clicking start in the control connects each board and moves the servos to 90 degrees, but speed doesn't seem to do anything, not sure why, all my searches indicate I have used the correct command "ServoSpeed", as you have also instructed, or does it only work on IoTiny and EZ-Bv4 ?

The servo buttons (I have created script collections, which work great) but to make it easier to move a servo from the servo control, I find the mouse click drag hard to use, maybe partly because I'm using a keyboard with touch pad. and the drop down percentage box (because I have min =1 and max 180) it involves scrolling each time I want to set the min or max position. buttons and slider would make it so much easier and quicker. ( I want to look into how to create controls eventually, but atm I have to many basics to learn, Controlling Camera, mic, Motors, Neopixels etc)

I have created a shortcut, (Which autostarts my "AZ.EZB" (Yer I know its a really creative name lol) it Starts ARC, Opens Project, Connects the 2 connections and moves servos, but speed still doesn't seen to work.

Any other basic tips would be great ;-)))

Cheers mate Steve

#5   — Edited

ServoSpeed (servoPort, speed) Set the speed of servo or PWM. This is the speed to move between positions. The servo speed is a number between 0 (fastest) and 10 (slowest) *Note: To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot. *Note: Once the ServoSpeed() has been initialized the first time, specify the ServoSpeed() before specifying the Servo() position. Example: ServoSpeed(D14, 25)

I assume you have more then one controller because you have a 1 at the start of each command?  Also in this command "Servo(1,D4, 90)" you have a comma behind the 1 instead of a period. It should like this: Servo(1.D4, 90)

Try this in your first start up script. You may or may not need the Sleep commands. If you do need the sleep commands you may have to make them longer so the next command has time to process:

Servo(1.D4, 90)
Sleep(100)
ServoSpeed(1.D4, 0)
Sleep(100)
Servo(1.D5, 90)
Sleep(100)
ServoSpeed(1.D5, 10)

#6  

Hi Dave

I do actually have commas, I guess I fat fingered when typing in comment.

I updated start script with Sleep(500) and still not working.

I think Ive found the problem thou, I tried ServoSpeed on my EZ-Bv4 and it works fine, but on the LattePanda (built in Leonardo and the Mega on the 2nd com port) ServoSpeed doesnt seem to work, does this sound possible?

Software/Drivers used: LattePanda with Leonardo - (EZ-Genuino_Leonardo-636967356658216814.zip) Arduino mega on 2nd com port - (EZ-Mega-v1-636848729355769322.zip) ARC - (2020-03-19)

Thanks Steve

PRO
Synthiam
#7  

I believe the only controller that supports a servospeed on Pwm servos is the ezrobot ezb b4 and ezrobot iotiny. Dynamixel servos do support that feature independent of the controller, however.

#8   — Edited

Hi DJ

Bummer:( Is there a way of slowing down a servo in Java on a Leonardo and mega?

Will moving 1 degree at a time going to cause a problem?

PRO
Synthiam
#9   — Edited

You can use the Servo.increment() in JavaScript in a loop with a short sleep() after each command:)

im on my phone so I’ll try to type and example for you ...


function moveSlow(var servo, var position) {

var start = Servo.getPosition(servo);

if (position < start) {

for (var x = position; x > start; x) {
  
  Servo.decrement(servo, 1);
  sleep(250);
}

} else {

for (var x = position; x > start; x++) {
  
  Servo.increment(servo, 1);
  sleep(250);
}

}

}


moveSlow(d0, 130);
moveSlow(d0, 30);