Controll HDD Voice coil Position

Hi Gents,

I am trying to figure out how to control a hdd voice coil with the arduino uno.
i am just not finding a answer that can work for me, either i am not asking the right
questions or i do not understand the voice coil correctly.

So what i have so far is that the voice coil require a input of -5V to +5V to place it in different positions,
i have played with putting power directly onto it a 1.3V moves it a little bit to one side on + and the other side on -..

Now my understanding of the analog write function is that it is a PWM signal witch provides a 0 and 5v at varying frequencies..

So in my basic understanding there is one of two ways to do this, have the arduino control a voltage regulator circuit that send to required power.. How that work not sure yet as i am not sure if i can control a voltage regulator with PWM..

The Second option i have come with is using Audio/Sound frequencies generated from the arduino, but with that i am not understanding how i will be able to control -5V to +5V....

Like i say, it is completely possible that i just do not understand some basics, or that i am over complicating this..

Is there someone who can shed some light on this ?
what am i missing or not thinking about...

Or someone who have done a similar thing before...

Thank you for your time in advance...

PWM might send different frequencies, but that is not the point of it.
The point is the ratio between 5 volts and 0 volts, of those pulses sent.
So if you have a ratio of 50 %, you have as much 5 volt level as 0 volt level.
The actually used name is "duty cycle", and that gives you the ratio of the 5 volt pulse.
So a duty cycle of 25 % tells you you have 25 % 5 volts, and 75 % 0 volts.
Measuring that with your mulitmeter (which will average the voltage), will show you you have 1.25 volts.

But you can't use that for your application.
To use it you need to send your PWM to a capacitor and a resistor.
This will do the same job your multimeter simulates, and offer you an average and "real analog out value".
That can be used for your application.

Ok that makes more sense.. so a filter(if that is the right name) would then provide me the + voltages i need, how would you suggest that i get the full range from -5 to +5....

Thank you for the quick response, i am by any stretch of the imagination knowledgeable about electronics, i am still studying at the university of Google and Arduino.cc :slight_smile:

Thanks Again..

You can't create negative voltages using your Arduino, you'll have to use some trick.
If your device only has 2 wires/pins to connect, you can also use a voltage between 0 and 10 volts (or 10 and 20 and so on).
The trick is in the difference between the voltages.
If your device has more pins, you probably can't do it that way but that depends on how it is constructed and possible on the way the "payload" of your device is connected.

Be sure to have a duty cycle of 50 % in rest to have it at its reference point.
Go below for one direction and over 50 % for the other direction, you'll get the drift.
Now you also can't directly control 10 volts with your Ardiuno but you can send your PWM to a transistor that can handle 10 volts.
The filter will then be placed after the transistor.

It is also possible to make real -5 Volts to 5 Volts, but that requires more advanced electronics like using an optocoupler and isolated circuits.
Still no rocket science but maybe a bit too much for you at this stage.

Thanks, I will try your suggestion, thank you for the quick help and information...

:slight_smile:

Another trick if you have only 2 wires for your device, is to use a relay (DPDT).
You can switch the relay to reverse the wires to your device.
But that's more some of a dirty trick.

I only have 2 wires, so yes i will need to do some trick..

What would one call the circuit that would move a 10V to -5 and +5 range..

I have been trying to google possible circuits but my crude search without knowing what i am looking for is not
giving me results

Thanks again for all the help..

There's 2 things here that matter.
The first thing is the voltage range.
That is the same for any way of controlling your device; 10 volts.
The other thing is the "reference level".
That is 0 volts with your Arduino (with a range of 5 volts), but can be any value you want for other devices.
You only need to point it out as the reference level.
You need to connect those reference levels together, but doing so might pose a problem for your Arduino.
You would destroy it by feeding it -0.5 volts or greater on any pin.
So if your device has a connection that is called common or GND, you could shift that to 5 volts of your Arduino.
The Arduino then has its own GND, 5 volts and its transistor has 10 volts.
But to the device that would be -5, GND and + 5 volts.
Be sure to have a regulated 10 volts for this, and also the device shouldn't draw too much current.

If you need to hold to the - 5 and + 5 volts, you need to separate the voltages and find a way to send your PWM signal without an electrical connection.
That is where an optocoupler would come in.
The keyword(s) would be "galvanic isolated power supply" which tells you that the input is not connected to the output.