Servo modification for sensor

hello every one,

I have an odd situation on my hands,

well Im curently working on a new robot, and i stombled on a probleme that i thought it was easy to go arround.

here s the thing, in order to build the robot, one of my plan is to use a servomotor as a position (angular) tracker. As u already know, with the ssc-32 the string "QP#\r " is used to get the position of the servo at any time. the plan is to use this command to track the position of the servo but with out commanding it to move. For example : something else will move the servo and all i have to do is demande its position in order to track a certain angular movement. after testing this theory i realised that when i demande the position , the servo does not return the actuall position of the servo but it returns the last command that we’ve sent to it.

I tried to connect only the pulse wire, but it still returned the last command that i ve sent to it.

I would like to know if theire is a way to get arround this probleme. and if theire is another device like a servo tracker that i could connect on a servo Input (not an analogue because i neet 8 angular trackers).

i hope that this is clear anougth.

thank you for ur time.
johnny

How much resolution do you need? You might consider attaching a “Wheel Watcher”

nubotics.com/products/ww11/index.html

To the servo, and count the encoder pulses (or read the counts via serial) to keep track of your servo(s).

Alan KM6VV

You can put a pot at the joint of interest and measure its voltage output. You also could tap the voltage on the internal pot of the servo to get a voltage that varys depending on the servo position. Links below that have to do with this type if thing.

viewtopic.php?f=31&t=3182

viewtopic.php?f=2&t=2748

Another link along the same line.

viewtopic.php?f=6&t=4362

Yeah, just reading the pots would be cheaper, and possibly simpler.

I would comment that the reading could be improved by powering the pot with a regulated 5V reference. I found out that’s what’s been done in some (maybe all) Hitec digital servos.

Alan KM6VV

If the ssc-32 will be reading the pot, just supply the pot from the ssc-32 5v pin as the chip voltage reference is the same 5v.

If you need multiple inputs, get a multiplex chip like below so you only have to use one analog input on the ssc-32.

sparkfun.com/products/9056

You could just use the regulated 5V from the SSC-32, or even better, a uP with a reference output.

I like the MUX. But it takes 5 lines to get 16. Might still want to use it.

Alan KM6VV

I think the “1 pin must be an analog to digital conversion pin” would be the analog input pin on the ssc-32. The multiplex chip only needs four digital pins for control.

sparkfun.com/datasheets/IC/cd74hc4067.pdf

Yes, 1 A/D pin, and what, 4 I/O lines to select (1:16) channel. My ASB-13 'bot is currently using all of the I/O and A/D lines!

As I have 5 LEDs, I was thinking of multiplexing them. Pulseout into a '595 would probably do it. 2 digital lines.

Alan KM6VV

thanks for the quick answers.

well as i read, i can get a voltage by reading directly from the middle pot inside the servo

but I dnt get why i should bend the AREF pin (21) of the ssc-32 controler. Do i have to do this, if only i want to read a movement out or the modified servo.

Another question, sorry if its abvious, but the wire comming from the middle pot, should it be connected on an analogue input or can i replace it by a servo pulse input. // as i understood , its a analogue output that should go in the ABCD slots right ??

check out
viewtopic.php?f=6&t=4362&start=30
is it an effecient way to proceed.

The voltage supplied to the pot in the servo is 2v, so the voltage reference pin on the ssc-32 chip needs to be supplied with 2v instead of its normal 5v in order to get full 8 bit resolution of the 2v range…

okay i get it thanks.

tell me if it makes sense plz :slight_smile::
you said that the multiplxe doesnt need 5 analog inputs but needs four. So i only need to connect the ABCD analog inputs on the the multiplex in order to read the analog voltage of each pot that i connect on the 16 analog/digital inputs.

  • in order to demande the value of the pot ; how do i proceed with the ABCD it is: “VA”, “VB”…

For your purposes, the multiplex chip has 16 analog inputs which are switched to its single analog output. You connect the single multiplex chip analog output pin to a single ssc-32 analog input pin, sich as “A”. You then use 4 of the 32 digital output pins of the ssc-32 to control the switching of the multiple chip.