Asked — Edited
Resolved Resolved by CochranRobotics!

Moving Discrete Distances

Now that I have part of Wiggins (my robot arm's name) built with multiple motors and multiple sabertooth/kangaroos all of which are being driven by digital ports on EZ-B and speech recognition via bluetooth headset configured on the computer... I am not using a movement control, only things like Horizontal servo which configured will move a kangaroo controlled motor from 0 to 180. The kangaroo is Teach Tuned to drive left and right from 0 to 360 degrees and the feedback is a 10 turn potentiometer on the pinion of the gear motor.

What I want is to tell Wiggins to turn left a certain number of degrees, for example. So the swivel for Wiggins' arm is a single gear motor driven pivot that rotates 360 degrees and is controlled by a Horizontal servo control so that it moves the full 360 degrees using the 0-180 on the control. Is there a control that turns left and right 180 degrees?

What I want is to be able to tell Wiggins to move a discrete variable distance. For example," Wiggins - rotate left 32 degrees". Or "Wiggins - rotate to 090".

One of these is movement from the current position and then left 32 degrees. The other is to rotate to a constant location.

How do I do this?

User-inserted image


ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

#9  

Where I work robotic arms are kept in a caged area so people don't unintentionally walk into to one while it is moving... Only authorized people are allowed in the cage... So the cage I am referring to is an actual cage like a bird cage but only way bigger...

#10  

Wonderful! The cage idea is probably a good one but I want Wiggins to be an assistant arm with the ability to reach anywhere inside my barn workshop so the barn would be the cage. Typically I am the only person in the barn.

I look forward to the sample script - I'm still struggling with how to get a spoken command to interface with a Horizontal servo control in my ARC project - so something beginner would be appropriate -sorry for the need for all the handholding...

Castle

#11  

there is a sample of what I am talking about doing. I dont know the commands that you need to have put in your code for the Kangaroo to function in the way you have it functioning, but this should get you started.

The project is called For castlephelps

#12  

if you grabbed it already, I had forgotten one thing. There is a new version out there now.

#13  

Servo (servoPort, position) is what you would probably use in your script.

You may want to store the previous position, do some math based on the request, and determine the location the arm needs to be in, then store this value in the previous position variable.

You could also read the pot through analog but I think it is tied to the Kangaroo in your solution, so probably just storing as a variable and using it to calculate what position to tell the motor to go to from the previous value + or - the distance you want to move from the command (determined by left or right) would work fine for you.

In the init script, I would add something like this


Servo (servoPort, 90)
$PreviousLocation = 90

to move the arm to the center as an initialization process.

In the movemotor script you would add something like this under either the left or right condition depending on how the motor works.

under left if statement


Servo(servoPort,$PreviousLocation + $TurnDistance)
$PreviousLocation = $PreviousLocation + $TurnDistance

under right if statement


Servo(servoPort,$PreviousLocation - $TurnDistance)
$PreviousLocation = $PreviousLocation - $TurnDistance

#14  

I wrote a script to go to coordinates and found GetServo(servo port) works well for data feedback.

Ron R

#15  

Cool, you could then make it pretty easy to then get the servo location and do the calculation based off of that.

#16  

I will post my test script in my other thread.

Ron R