Pages: [1]   Go Down
Author Topic: Create PWM with amplitude of +9v and -9v  (Read 1074 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have an Arduino Duemilonove and Ardumoto shield. Is somewone know if it is possible to create a +/-9v PWM with frequency of about 50Hz using those resources? I also need to control the Duty Cycle..
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes it is easy you need a split voltage supply of +/- 9 volts and a pair of transistors. What sort of current do you need to drive with this?

However I suspect that you don't actually want to do this so we need to know what you actually want to do and if this is the right way. So many beginners waste a lot of time asking for things that they don't really need, but theynonly think they need.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need to drive actuator, which is about 500-600mA. It is for My final project in university.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That is a lot of current. Anyway a class B push pull amplifier stage should do it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know that Ardumoto shield can provide a negative DC (-9v) voltage while setting: digitalWrite (dir_a, LOW), and positive DC (+9v) while setting: digitalWrite (dir_a, High). Therefore i can get a PWM of +-9v without any additional transistors, but i don't know if i can do it in high frequency.. How can i make delay of HIGH and LOW to be less than 1ms.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How can i make delay of HIGH and LOW to be less than 1ms.
How does that tie-in to your 50Hz (20ms cycle) requirement?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I know that Ardumoto shield can provide a negative DC (-9v) voltage while setting: digitalWrite (dir_a, LOW), and positive DC (+9v) while setting: digitalWrite (dir_a, High).

No it will not produce a negative voltage. That shield is an H-bridge circuit. It will reverse the polarity applied to a load on connected between its two outputs but it will not supply a negative voltage.

You asked about producing a +9V and a -9V signal.

What exactly do you want to produce?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, sorry, i will start over... I am trying to drive a Hard Disk actuator arm. I soldered two wires to the Arm's coil which placed between the magnets. While i'm connecting one of the wires to +5v and the other to 0 in external PowerSupply, it takes the arm to one side due to electro magnetic field which created by the current in the coil, but if i want the arm to go to other side, i need to switch the wires or to decrease the voltage to be negative (current will flow to another side). I need quite precise control of the arm, so i want to use the PWM with a high frequency to control the situation of the arm by changing the Duty Cycle on period of 500Hz.
 
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So you will need to filter the PWM signal and send an analogue signal into the coil. That means your shield is not going to be any use to you as that will only produce a hard on or hard off signal.
So back to what I said at first you need a class B output stage running off a split supply which you feed from a filtered PWM signal. As the PWM only has 8 bits of resolution and you want a positive and negative signal then you will only be able to move your head into one of 127 places. Is that precise enough for you?
For PWM filtering see:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I actually already tried to send a analog signal to the coil, but there is a problem because while the current in the coil is 0, the arm is not stable at all, so that's why i need a real PWM on the coil in a pretty high speed. While i'm giving a +-9v vith Duty Cycle of 50% directly on the coil, the mean voltage is also 0 byt the arm is stable because of the hihg frequency.
Logged

Ontario
Offline Offline
God Member
*****
Karma: 20
Posts: 835
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm missing something.  Head positioning "voice coils" work on the servo principle.  There has to be a positioning feedback loop for the servo logic to decide whether to drive it up or down from where it is, and how hard.  If you don't have positioning feedback, all you can do is drive it weakly or strongly against one stop or the other, or let it float.

Maybe you have a progressive centering spring like a meter movement?  Then position is simple function of force applied.  Is that what you're up to?
« Last Edit: June 23, 2011, 12:21:35 pm by gardner » Logged

Pages: [1]   Go Up
Jump to: