PDA

View Full Version : Using Servo Kits



bianca
02-12-2007, 03:44 PM
I wanted to double check on the best way to use the servo kits with Flash. I teach a physical computing class and my students are doing some project work with the servos using Flash 8/ActionScript 2. We were having some problem with the servos working continuously. In many situations when using the sample code that was part of the Flash library it seems that the servo socket keeps disconnecting and so it is not turning continuously. Has anyone else had this issue?

Also, what is indicated by the "Double" in the variable type declaration? The range we are using is -23 to 231 as indicated in the Phidget Flash API documentation.

Any advice?

Alex
02-12-2007, 04:00 PM
Hi Bianca,

When using continuous turn servos, you have a clockwise and counter-clockwise range of values. If you take a look at the product page on the continuous turn servo in our catalogue, you can see what the values are for this particular servo:

http://www.trossenrobotics.com/store/p/3296-HSR-1422CR-Continuous-Rotation-Standard-Servo.aspx



Deadband:
122-123

Clockwise Rotation Range:
124 = Slowest Speed
131 = Fastest Speed

Counter-Clockwise Rotation Range:
121= Slowest Speed
114 = Fastest Speed

The deadband being of course the range at which the continuous turn servo stops moving.

The value range that you are referring to (-23 to 231) are for when you are dealing with servo positioning, which, in the case of continuous turn servos, you don't have.

Or have I totally misunderstood what you meant by the word "continuous"?

bianca
02-20-2007, 10:23 PM
Sorry for the delayed response!

The kits the students are working with are these:
http://www.trossenrobotics.com/store/p/3190-4-Motor-Servo-Kit.aspx

so they are really dealing with servo positioning. We want to set a value in the code and have the motor shaft move to a desired position. I am having some issues where the "closeSocket" function seems to get called even though it is not invoked. The servos do not seem to go to the desired position unless the connection is reset. The students have found a workaround with a loop that reopens the connection on every frame, but I wanted to know if anyone else had this issue.

Alex
02-21-2007, 10:05 AM
Could you paste your code here?

bianca
02-21-2007, 01:34 PM
Actually, we are using the sample file that came with the Flash API from the Phidgets20 Downloads. It is a little odd, as it worked flawlessly on my personal Mac Powerbook G4 runnning OS 10.4.2, but then did not work on my work machine (which is a MacBook Pro) running the same OS. On the older machine, the sample file for the servos (the Flash file with the 4 sliders) worked great (move the slider and the servo immediately changes position). On the newer machine and the PCs in the student lab (runnning Windows XP) it is hung up, and the servo does not move except for the moment immediately following pressing the "connect" button. Does that make sense?