
njsokalski
I recently got my EZ-B and have started working on some of my planned projects. One thing that I noticed is that when rotating a servo (a standard servo) from EZ_B.Servo.SERVO_MIN to EZ_B.Servo.SERVO_MAX, it is not exactly 180 degrees that it rotates (I noticed this with ARC also). I have several questions about using the servos:
1. How many degrees is an increment of 1 when using the SetServoPosition method?
2. When I attach the servo attachment (before connecting the EZ-B to the servo and computer), how do I know what position it is in? I need to know this so that I know what position to attact the attachment in.
I am asking these questions because my software needs to know the start and current positions of each servo are, as well as what angles to attach the servo attachments at. Thanks.
2)You can set the beginning position as a defined home state if you wish so when you start the program it moves to that state. I am not sure if the method still exists but I do believe there was one in the SDK for the servo position read.
Servos are not 180 degrees - they are the number of degrees supported by each servo. every servo and every servo model are different. Rarely are they 180 degrees.. in fact, I don't think I've ever seen one do exactly 180 degrees
you don't need to measure for each servo, only between servo models.
I need to this because many of the projects I have planned involve calculating certain things. For example, one of my projects is stacking blocks. Depending on how many blocks have already been stacked, it needs to calculate how high to move the gripper before letting go. I would think that you would need to know this information for almost every servo (at least the standard servos) in almost every project, otherwise, how do you know what value to specify when using methods like SetServoPosition? For projects that are more of a "follow the ball around" type thing that use modified servos (the wheels) or a "turn until you see this" type thing (the head or looking around) that does something until they are told to stop (the camera sees something) by an input device or other source, I agree, you don't really need to know how many degrees the servo turns, but for other things, I would think you would normally need to know.
I'm sorry to ask so many questions, I just never really had any education in hardware, only in software, so I'm still learning a lot of the stuff I need to know for my robot projects. Thanks.
Stacking blocks will be a fun project
If you know the height of each block, you can use the Auto Position Control. Create an action for the final position of each row and column of the blocks. That way, it doesn't matter what position the block is picked up in, it will be able to Auto Position the servos into the specific Column and Row
So, for instance, if the EZ-Robot Standard servo rotated 185' (I haven't measured, that probably isn't right, if it is it's a coincidence) from 0 to 100 it is as simple as dividing 185' by 100 steps so each step would be 1.85' and to work out how many steps to move 90' it's just 90' divided by 1.85' = 48.6 so 49 steps.
I.E.
Min = 1
Max = 100
Rotation = 180
Steps = 100
Degrees per step = 1.8
NewMin = 11
NewMax = 90
NewRotation = 180 - (20x1.8) = 144
NewSteps = 80
Degrees per step = 1.8
The degrees per step will always remain the same.
At least that's how I've always thought it is... please, correct me if I am wrong though.
angle=(36/17)*(value-1)
value=((17/36)*angle)+1
As for attaching the servo attachment at the right angle, I guess you just need to do something like rotate your servo to a known value (such as the minimum) and then attach the attachment at the angle you want it to be at for that value. Using these equations and techniques I have been able to rotate my servos to the desired angle with no trouble. Problem solved! Thank you all for your help!
I also always calibrate the servos and centre them when I get any new ones by running the attached script in ARC.
ServoFullRangeWarmup-634899825363427735.ezb