Continuous Rotation Servo With Absolute Position

 
#1

I'm pretty new to EZ-Robot, so I apologize if this is a basic question... I've got a couple of Turnigy servos and a linear actuator working with EZ-B, but I'd like to add a continuous rotation servo with position feedback. I'm working on an R2-D2 project and this servo would be used to rotate the periscope that comes out of the droid's dome. As it's kind of pie shaped, ensuring it's back in the proper position prior to retraction is important.

I came across this Parallax Feedback 360° High-Speed Servo which seems to fit the bill. In addition to the normal three wires, there's a fourth with position information from the built-in Hall effect sensor. Where would I plug that fourth wire into and what bit of the EZ-B software will let me read it?

Thank you.

#2

It's a little hard to tell. It would be best to ask Parallax on their message board how you control the servo with different controllers (I wouldn't ask how do I control this with an EZB because they will point you back to EZ-Robot) because if you go to their website or look at their product document for that servo, it only includes a C source code for their Prop controller library, making it hard to tell how the feed back works.

Usually Parallax includes source code for all their controllers like the Basic Stamp, Prop and Arduino, so it might be new or just an over sight to not include those examples as well on the site.

But the product does say > "internal Hall effect sensor system that provides digital angular position feedback"

When I read that I take it to mean it should work like any other hall effect sensors which would mean you could connect it to a digital port and make a script to count the digital on/off signals (highs and lows).

I'm thinking you'll need a bit of math in your script as well which I think is what their C library in the Prop code does to match the speed of the servo with the pulses in order to make it easy to control on their Prop controller based products.

That's a good find. That should be fun to experiment with.

#3

I did a little checking and the libraries are currently for the Propeller microcontroller.
Here is a link to the servo datasheet .
https://www.pololu.com/file/0J1395/900-00360-Feedback-360-HS-Servo-v1.2.pdf

cheers

#4

Didn't I say that?

#5

@ Justin Yes you did, I don't always read everything I guess, I will have to work on that.

My take on what I read in the datasheet (again I didn't read it all) was that the pulse width gets wider as the angle gets larger. At 0 degrees or Origin as they call it the pulse is 2.9% of the square wave (Duty cycle) and 97.1% as it approaches 359 degrees this is in a clockwise rotation.

#6

...I take that way as well like it is getting a PWM signal back from the sensor instead of a digital count (on/offs). In a BasicStamp you could do pulseIN and pluseOUT and the Prop carried that command set as well so...

This might not work as just a digital sensor after all, I'm not sure now. I wonder if "GetPWM" in EZ-Builder would do the trick for reading the data.

#7

That is a good question for DJ.
I thought that the digital ports (white signal pin) are output only. To get status one would have to use an analog input and I don't think the GETPWM command works on analog inputs.

If not one could tie d1 white pin to d2 white pin.

Do I smell SMOKE!

Code:



Servo(D1,100)
$A = GetPWM(D2)

#8

No digital pins can work as a digital input.
http://www.ez-robot.com/Tutorials/Help.aspx?id=21

I've connected switches as inputs that way to digital pin.

The example in EZ-Builder manual does say:
GetPWM (digitalPort)
Gets the PWM (Pulse Width Modulation) of specified port
PWM is between 0 and 100
Example: $x = GetPWM(D14)

But you might be on to something, an ADC pin might read the data just as well. https://www.ez-robot.com/Tutorials/Help.aspx?id=30

It should work - not work - or smoke, lol Tongue

#9

I assumed it worked like the GetServo command that does not actually check the port just returns the last value it was set to.
So I assumed the GetPWM would just compute the PWM for the current position.

So

Code:


Servo(D1,90)
$A = GetPWM(D1)


$A would = 50 for 50% duty cycle.

That is saying that 0% duty cycle is 0 degrees, 100% duty cycle is 180 degrees

I hope this makes sense.

#10

Quote:


assumed it worked like the GetServo command that does not actually check the port just returns the last value it was set to.
So I assumed the GetPWM would just compute the PWM for the current position.



GetPWM is analogous to GetServo: does not compute the PWM instead returns the last/current PWM value.