Saturday, March 21, 2026

ST-Robotics R12 - gripper end-effector

To build my own end-effector for the robot arm, I built a variant of the gripper uploaded by chipcode to printables.com.

 https://www.printables.com/model/739870-sg90-robot-arm/files

I started with a servo that was labeled "BAD" in three place, along with a servo control board.  Sure enough, after various experiments, I couldn't get the bad servo to work properly.  It would only move about 12.5 degrees.

I then ordered a set of Beffkip SG90 servos to experiment.  These operate at 5v.  I used a standard Arduino servo library sketch and got it to move.

After a first test print, I found that I had to modify the chipcode design to make things work.  The servo I got needed more room for the wiring to go under the motor, a lower output hole for the wiring, and additional space for the horn and its screw.  Of the horns that came with the servo, the most similar one was both wider and longer than the design called for.  Thankfully, the printables page provided the .f3d model, so I could make changes (in a very non-professional way) and get the result I wanted.  Also, the housing for the servo was designed in a way that didn't allow for dynamic arm length changes, so I just kept the original design's length, and chopped the horn to fit.

I also skimped on the screws.  The design calls for very small screws to hold things together.  Instead, I chopped wires off of some very old resistors, and stuck them in and bent them to hold at the pivot points.

After I had a working model for that, I tested the servo operation to get a better understanding of how it would work.

Finally, I built a base for it that would join to the robot's end-effector plate.  That is a circular disc with four M4 screw holes set approximately 27.5mm apart (on the diagonal).  The plate itself is a little under 40mm in diameter, but there's room to go over by a little bit.

I made a few extra braces that would hold things together and allow me to hold things together with tiny screws that I had (scavenged from the servo arms I wasn't using), and then made it so I could attach the braces to the printed disc/holder.

 

After that was together, I made the Arduino code close on one button press, and open on another button press, and gave it a go.  The closure and opening positions were at 45 and 135 degrees.  With some amount of fiddling, I was able to make the arm grab a ball from a hole, move around a bit with it, and then return the ball to the starting point.

Wire positioning 

I'm not quite sure how the wiring should be done.  It turns out I had a few nice, long extension wires for the servo motor, so I had plenty of length.  I just am not sure how to keep things from getting entangled as the arm and hand and wrist move.  

The calibration mechanism for the R12 is a little scary.  I moves the wrist around a bit as it seeks the calibration points, and then rapidly moves to home.  I think if the gripper were positioned the wrong way, I might run the risk of a collision, and it might break off.  But I ended up picking a position where, facing the "front" of the arm, the servo sticks out to the left, and the gripper arms are aligned front-to-back.

Next steps 

Two things to explore:

1. Is there a way to operate the gripper servo using only ROBOFORTH? To make it move to its 45 and 135 degree positions, the page for the servo says to use a 2MS pulse width or a 3MS pulse width, respectively.   I'm guessing I could drive that with a cleverly written timer interrupt in FORTH.  It would have to run all the time.

2. If I leave the Arduino in the mechanism, how do I control it from FORTH?  For this, I think I'd want to power the Arduino from a safe, 5v output from the K11R controller, but I'm not totally sure which of the pins is safest to use for driving an Arduino load, even if that load is pretty light.  I might be better off providing power from the PC USB, and then joining grounds between the Arduino and the K11R QA or QC ports.  Then, I could control one of the QC or QA pins, and have that tied to an Arduino digital input pin to know when to open or close. 

And to that end, I would say one thing that I'd find very useful on a K11R controller would be a standard USB port.  That, and specifications about current limits.

Another approach would be to use the PA "output" pin.  It would allow me to do a circuit like this, I suppose:

                                               PA n to Darlington base
                                                          | 
                                                          v
Arduino +5v -> 1 to 50k? -> Ard input pin ->  PA pin -> Darlington -> K11R GND
Arduino GND --------------------------------------------------------> K11R GND 

That is, the Arduino input pin would be biased high.  The opening of the Darlington by the K11R would connect the Arduino input to Ground.

The Arduino could share ground with the K11R, but source its own power externally (e.g., from the computer's USB port).

To do this, I could use PA GND (DSub15 pin 9 or 10) to join Arduino GND to K11R GND.  Arduino +5V would go to a 1/4w 1kOhm resistor to its own input pin, and from there to something like PA 3 (Dsub15 pin 5).  

In this way, the Arduino isn't really receiving current from the K11R, so I'm not worried about QA or QC output.  And, I don't draw +5v off of the QQ or PA or other ports of the K11R.

I am left to wonder if an Arduino digital pin's internal pull-up resistor is too strong.  Those are typically 20k or 50k.  But maybe that'd work.

Then, I'd keep some kind of gripper state with values 0 init, 1 grip, 2 ungrip, or maybe just use two states, and force an ungrip state on startup.  On value change, I'd send in a servo.write(new value), and assume that it worked.  There's no sensing of grip state.  I suppose a servo.read() could tell me if it got close to the intended angle or not.  If it's really close to the full grip position, it probably means it was a swing and a miss.  Then, I'd want to feed that back to a QB or PB pin.  But I'm not quite sure what I'd do with that information.


 

No comments:

Post a Comment