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.
Asked
— Edited
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.
Here is a link to the servo datasheet .
https://www.pololu.com/file/0J1395/900-00360-Feedback-360-HS-Servo-v1.2.pdf
cheers
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.
This might not work as just a digital sensor after all, I'm not sure now. I wonder if "GetPWM" in ARC would do the trick for reading the data.
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:
http://www.ez-robot.com/Tutorials/Help.aspx?id=21
I've connected switches as inputs that way to digital pin.
The example in ARC 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
So I assumed the GetPWM would just compute the PWM for the current position.
So
Code:
$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.
GetPWM is analogous to GetServo: does not compute the PWM instead returns the last/current PWM value.
1) measure the duty cycle and translate to servo position
2) track the servo's position in real time (not in ARC) and implement a closed loop code (PID) to control the current position and the desired position, basically is what a servo PCB does.
Last year i started to develop a plugin to use with ARC and to interface EZB with the external controller (Parallax Propeller).
The initial idea was to use with Cube Machine, allowing the Gripper to rotate 360 degrees and multiple times.
I detected some issues with the Parallax library code, so i started my firmware version in C and i found some other issues too. Propeller has 8 cores but no interrupts, timers etc, so everything needs to run with your code, so the next step was to use some spin/assembler code and redo the firmware.
I was running out of time (Cube plugin Project), busy at work too so Bob convinced me to use EZR HD servos (Strong/Silent).
I end up using the Parallax servos in another project (not an ARC) and the plugin is on hold waiting for better days
Plugin create date:
wow! almost a year ago
I can't promise when, but, I'll come back to finish the plugin.
I was sort of close with my assumption, as it does not read the port.