analogRead current from servo

Hello to all guys. I’m trying to solve the problem of boring servo continuous rotation, the eternal settings to get the right position of the potentiometer (or fair value of fixed resistors in place of the potentiometer) to hold the wheels stopped without shaking or wobbling.

To resolve this problem, I thought that being able to have feedback voltage power inside the motor’s circuit (so the two wires feeding the motor) with two analog ports, it would be quite easy to drive the actuator so that it absorbs 0, using the analogWrite (), varying the voltage in the circuit of the potentiometer connected to two digital gates (the three cables that should be connected to the potentiometer) arduino could drive a voltage that mimic the role of the potentiometer, that is, take the place of the potentiometer with arduino and analogWrite() function. This would make the dynamic management of the actuator settings free from the concussion and would also allow a discrete feedback on the movement of the actuator, the fact, that you might use this value to determine robot movement.

The problems are:

  • Just pull a cable from power cables to an analog voltage to get the inside?
  • The engine is likely to absorb all the power? In this case we get something in the analog?
  • How to build the circuit so it will not go short when the motor reverses its rotation

Here’s a drawing I made that describes the circuit which analyzes the voltage across the motor:

As long as the yellow cable is red (+) everything works, but if the direction of rotation of the motor changes, there would be a short circuit to the diode connected to the black. It would take a discrete element in a position to switch the ground after contact between the diode and the two poles following the direction of the current. Can you give me some advice?

Original discussion:
http://www.gioblu.com/community/forum/topic?id=143&p=1883#p1883

Sorry this makes no sense at all. Are you trying to make a motor that replaces a servo motor or are you trying to make a servo motor better? Either way measuring the current through a motor is not going to give you any control over its position. The post you link is in a language I don't speak and I suspect you are having translation problems in trying to explain what you want to do.

Hi. Sorry the translations error are not my fault, Google Translate is not errorless. heheh Ok I am not using it now, I try to explain with simple words..

In the picture the motor rapresents the motor that is in the servo!

To understand my argumentation you need a little of knowledge on servo motors and servo motor controllers. A servo motor controller works easly. It senses the position of servo gears with a potentiomer and with this feedback drives the motor to asked position.

A continuous rotaion servo has no feedback on his position because the potentiometer is not in his original position and is not mechanically connected to the servo gears. For this reason a continuous rotaion servo user must do the potentiometer regulation calling the command servo.Write(90); and rotate the pot until the wheel stops. This regulation is not durable, when the battery is a little discharged the servo start rotating or fuzzing jittering. I think that this is not the way to work for this reason I would like to create a dynamical system that regulates the resistence (instead of the potentiometer) according to the voltage in the circuit of motor power. For this reason with a simple couple of for() you can stop the servo in every situation dynamically simply sensing the voltage and consequently drive the resistance until the servo controller stop to give current.

Do you understand me :P?

Do you understand me

Yep got that thanks.
I think the correct word for “fuzzing jittering” would be “hunting”
and if I understand it right you want to adjust the resistance in the feedback circuit to compensate for this hunting. I am not convinced that the motor voltage will give you enough information to be able to close the feedback loop like this.
On the practical side you could use the differential mode of the A/D converter and bias the lines with a potential divider to take care of the bi directional nature of it.
I will think about this and get back if something occurs to me.

The pots that are in standard servos are inexpensive and drift with things like vibration and maybe temperature. You might try a 15 turn trim pot instead to see if it is more stable.

I just saw 2-3 days ago, a conversion illustrated where they replaced the pot with a pair of fixed resistors to bypass that problem.

It boils down to if there is any drift, would it be easier to adjust the code or adjust a pot.

Hi guys thank you for answers!!!

I think a lot to this issue...I agree that I have to experiment this to get some empiric data. I am engineering this sick thing only to remove from the robot builder experimentation the useless time loss regulating via code or pot the correct stop position of servos. And after 10 minutes of work the robot will start drifting / fuzzing / jittering / hunting, for this reason you have to regulate again. This system would be dynamical and indipendent from power current and variations. Try to look @ this like a exposimeter that feels light and adjusts a value, this feels current and adjusts the potentiometer value dinamycally to get the lowest current value possible. I realized a very simple algorithm for proximity sensors with ir LEDs that works similary take a look: http://www.gioblu.com/tutorials/sensori/59-sensore-prossimita-led

here the wiring: The motor down left is the motor inside the servo (i can't draw it better)

With this "thing" could I have a useful feedback on movement analyzing power current? Could i know motor prm? If yes i could calculate wheels rpm and knowing wheel diameter possibly get m/s. It would be like an encoder, but using current and not a light emission / magnetic field

What do you think about it?

The motor down left is the motor inside the servo (i can't draw it better)

It would be better if you could draw a proper schematic, just pencil and paper then post a photo. Physical layout drawings like this are of little use in seeing if a circuit idea will work.

We don't need stability in the resistor or potentiometer but in the current that powers the servo!! If it changes, changes also the pwm value that stops the servo, for this reason if you use a pair of resistors you never have a good and precise result!!!!!!!!!!

This system would solve the problem dynamizing the potentiometer value according to the current flow in the motor power circuit equals to: if the motor move or jitter / hunt the algorithm start to decrease the voltage in the potentiometer circuit to decrease motor current until it stops