For the Braccio arm, how to use the 'soft start' fix ?

Hello, just put together the Braccio robotic arm, and have it powered up for the first time. When it powers on, goes to a preset position very quickly. I see there was a 'fix' written in for this, but after two hours of reading, I don't know or understand how to use the fix in the code.

Care to post a) the code you’re currently using and b) a link to whatever you were reading.

I have no real idea what you’re looking at or what it is you’re trying to fix, which makes it difficult to help.

Steve

Hi Steve,

In my case I’m using example code ‘testBraccio90’
The first time I ran it, i found the arm almost jumps off the table on every power-up !
I don’t want the arm to self-destruct, so I looked for a fix.
The Braccio has a library ‘soft start fix’ that I found here :
https://github.com/arduino-org/arduino-library-braccio
I have the V4 Braccio shield.
So, I pulled in the revised library under the ‘src’ folder on that page.
Updated my IDE to look at that library.
Set up a brand new sketch with this library.
I then tried placing a value in Braccio.begin(nnn)
And no values in there seem to make any difference, so that is obviously the wrong idea.

The example code I’m running ‘testBraccio90’ is just as you see it here :

/*
testBraccio90.ino

testBraccio90 is a setup sketch to check the alignment of all the servo motors
This is the first sketch you need to run on Braccio
When you start this sketch Braccio will be positioned perpendicular to the base
If you can’t see the Braccio in this exact position you need to reallign the servo motors position

Created on 18 Nov 2015
by Andrea Martino

This example is in the public domain.
*/

#include <Braccio.h>
#include <Servo.h>

Servo base;
Servo shoulder;
Servo elbow;
Servo wrist_rot;
Servo wrist_ver;
Servo gripper;

void setup() {
//Initialization functions and set up the initial position for Braccio
//All the servo motors will be positioned in the “safety” position:
//Base (M1):90 degrees
//Shoulder (M2): 45 degrees
//Elbow (M3): 180 degrees
//Wrist vertical (M4): 180 degrees
//Wrist rotation (M5): 90 degrees
//gripper (M6): 10 degrees
Braccio.begin();
}

void loop() {
/*
Step Delay: a milliseconds delay between the movement of each servo. Allowed values from 10 to 30 msec.
M1=base degrees. Allowed values from 0 to 180 degrees
M2=shoulder degrees. Allowed values from 15 to 165 degrees
M3=elbow degrees. Allowed values from 0 to 180 degrees
M4=wrist vertical degrees. Allowed values from 0 to 180 degrees
M5=wrist rotation degrees. Allowed values from 0 to 180 degrees
M6=gripper degrees. Allowed values from 10 to 73 degrees. 10: the toungue is open, 73: the gripper is closed.
*/

// the arm is aligned upwards and the gripper is closed
//(step delay, M1, M2, M3, M4, M5, M6);
Braccio.ServoMovement(20, 90, 90, 90, 90, 90, 73);

}

Anybody know where else I can look for Arduino help on this Braccio arm ?

Take a read through the sticky posts at the top of this forum.
How to use this forum - please read.
Read this before posting a programming question ...
These go over things like using code tags. Helps us help you.

As for servos jumping to their starting position, the only fix is to start them in their initial position.
If you use servo.writeMicroseconds(1500); to a servo that is already centered, you will only see a small twitch.
But if you do the same to a servo that is at one extreme end of its range, it will move to a centered position as quickly as it can.

If you 'park' each servo in its starting position before you power down, then when you power up, you can expect each servo to be where you left it.
Unless you manually move the servo when it is powered off. In which case, you might manually move it back to its park position.
I believe that the servo's default starting position is 1500, or centered. You can choose a different starting position be writing to the servo before you attach the servo.

If you do a controlled shutdown, write each axis position to EEPROM before shutdown, then at next startup, recall those positions and servo.write position for each axis before attaching, like

void setup()
{
elbow.writeMicroseconds(savedElbow);
elbow.attach(elbowPin);

You get the current position with:

x = elbow.readMicroseconds();