Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a PWM
Author Message
jbalat Offline
Member
***

Posts: 280
Joined: Feb 2009
Reputation: 1
Post: #1
Exclamation How to make a PWM
I know there are plenty of free plans out there but I was hoping to use my existing Stamp microprocessor to make a PWM

The stamp can generate a low current 5V square pulse at any duty cycle and any frequency.

Can I simply hook it up to my HHO 12v 40A relay to pulse the signal..

The idea being that I can attach a temperature sensor so that it can automatically reduce the duty cycle as the cell heats up ?
10-13-2009 12:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
benny Offline
Member
***

Posts: 332
Joined: Sep 2008
Reputation: 5
Post: #2
RE: How to make a PWM
(10-13-2009 12:28 AM)jbalat Wrote:  I know there are plenty of free plans out there but I was hoping to use my existing Stamp microprocessor to make a PWM

The stamp can generate a low current 5V square pulse at any duty cycle and any frequency.

Can I simply hook it up to my HHO 12v 40A relay to pulse the signal..

The idea being that I can attach a temperature sensor so that it can automatically reduce the duty cycle as the cell heats up ?

Basic answer is no.

If you look at any of the circuits available for PWM you should note that the actual switching is normally carried out using high power Mosfet transistors. A relay will never survive repeated on/off switching at anything like the rate required for PWM control.
In any case, relays are limited in the number of switching operations of the relay, after which they may fail mechanically at any time.
Most high power relays are not designed for rapid switching under load conditions. Usually this will cause arcing at the contacts, resulting in rapid deterioration of same, with early demise of the relay.

It is possible to use your stamp to drive mosfets, preferably using a fet driver as an interface between stamp and mosfets. Saves overloading the microcontroller.
I have done something similar using a pic microcontroller, plus a few discrete components, most of which you won't need with your stamp.
10-13-2009 01:19 PM
Find all posts by this user Quote this message in a reply
jbalat Offline
Member
***

Posts: 280
Joined: Feb 2009
Reputation: 1
Post: #3
RE: How to make a PWM
Benny, I am not sure what kind of mosfet I need or what kind of circuit I would need to make to interfact it with my stamp and to the HHO generator.

Would this mosfet do ?
http://www.dse.com.au/cgi-bin/dse.storef...View/Z1853
10-13-2009 02:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
benny Offline
Member
***

Posts: 332
Joined: Sep 2008
Reputation: 5
Post: #4
RE: How to make a PWM
(10-13-2009 02:41 PM)jbalat Wrote:  Benny, I am not sure what kind of mosfet I need or what kind of circuit I would need to make to interfact it with my stamp and to the HHO generator.

Would this mosfet do ?
http://www.dse.com.au/cgi-bin/dse.storef...View/Z1853

Look at post number 2 on this page/

http://www.fuel-saver.org/Thread-PWM-usi...roller-pic

I uploaded a couple of schematics a while back. These are for a working dual PWM. The hex code for use with this won't be suitable for use with the stamp, tho', but it will give some idea of just how easy it is to implement a PWM using microcontrollers. The thread explains it all.
(This post was last modified: 10-13-2009 11:23 PM by benny.)
10-13-2009 11:18 PM
Find all posts by this user Quote this message in a reply
jbalat Offline
Member
***

Posts: 280
Joined: Feb 2009
Reputation: 1
Post: #5
RE: How to make a PWM
Cool.. Thats Ok the programming is a piece of cake with the stamp..

So I'm looking at the pwm.bmp and you are right it does look easy !

From my limited knowledge it looks like I only need to worry about the circuit coming out of Pin 17 from your microprocessor.. I assume this is feeding the 5V pulse into pin 2 of the TC4427..

I also assume the power from my Relay goes somewhere into the TC4427 driver then I connect v12 of the circuit to my HHO generator ?

So I need a TC4427 (mosfet driver) and a couple of HUF75337P3 (mosfets), also R4 = 1 ohm ?

Not sure which Driver to use since there are so many to choose from...
http://au.mouser.com/Search/Refine.aspx?...27&FS=True

Thanks
JB
(This post was last modified: 10-14-2009 03:29 AM by jbalat.)
10-14-2009 03:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
benny Offline
Member
***

Posts: 332
Joined: Sep 2008
Reputation: 5
Post: #6
RE: How to make a PWM
(10-14-2009 03:26 AM)jbalat Wrote:  Cool.. Thats Ok the programming is a piece of cake with the stamp..

So I'm looking at the pwm.bmp and you are right it does look easy !

From my limited knowledge it looks like I only need to worry about the circuit coming out of Pin 17 from your microprocessor.. I assume this is feeding the 5V pulse into pin 2 of the TC4427..

I also assume the power from my Relay goes somewhere into the TC4427 driver then I connect v12 of the circuit to my HHO generator ?

So I need a TC4427 (mosfet driver) and a couple of HUF75337P3 (mosfets), also R4 = 1 ohm ?

Not sure which Driver to use since there are so many to choose from...
http://au.mouser.com/Search/Refine.aspx?...27&FS=True

Thanks
JB

R4 and R5 are shown as 0.001 ohm resistors. Basically a fixed length of copper wire. This is used for determining current flowing through the generator by measuring voltage drop across same. ZFF PWM schematic shows circuitry for curren tlimiting using this low value resistor, but, if memory serves, his design uses the feedback from this to switch an op-amp set up as a comparator to basically switch off the mosfet when max current is exceeded. I would use a different approach, using this feedback signal connected to an adc input allowing the pic/stamp software to determine current draw and adjust the pulse width as required. automatically.

The voltage level across R4/5 needs to be amplified to give a usable reading for the pic/stamp, and the output of the op-amp needs to be calibrated to suit the actual value of R4.
I would be tempted to recommend a hall effect device as an alternative for current determination, but these are more expensive.

If you don't require this function, these two resistors can be omitted.

The value for the mosfet gate resistor, gate to ground, is dependent on the type of mosfet used. This resistor can not be omitted.

In the circuit I posted, the TC4427 is the fet driver. It also acts as a level changer. TTL from the microcontroller to the driver IC, and 12V output from the driver IC. Pin 17 is one of two PWM outputs of the pic I used. Check the data sheet for the driver IC.

The output from your power relay is the main supply to your complete system. i.e. generator and PWM controller. Remember to use a separate fuse for your PWM.

Couple of videos on youtube showing bench PSU using inbuilt PWM. (As per schematic, one output only used)

http://www.youtube.com/watch?v=PbNiP14RXhY
http://www.youtube.com/user/BennyHHO#p/a
(This post was last modified: 10-14-2009 03:25 PM by benny.)
10-14-2009 03:02 PM
Find all posts by this user Quote this message in a reply
jbalat Offline
Member
***

Posts: 280
Joined: Feb 2009
Reputation: 1
Post: #7
RE: How to make a PWM
Sorry Benny to bring this up again after so long...

I have ordered a brushed RC 40A speed controller that I can easily drive with my propeller board

The problem is that I want to maintain about 14 amps despite electrolyte temperature rising

Can you show me where to add the very small resistor to generate a small voltage ?

The ADC conversion on my board works between at 0-3.3V so how would I ensure I get at least 1v so I have enough resolution to feedback into my program so I can control the current/pulsewidth ?


Attached File(s) Thumbnail(s)
   
(This post was last modified: 06-22-2010 01:39 AM by jbalat.)
06-22-2010 01:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply
benny Offline
Member
***

Posts: 332
Joined: Sep 2008
Reputation: 5
Post: #8
RE: How to make a PWM
(06-22-2010 01:38 AM)jbalat Wrote:  Sorry Benny to bring this up again after so long...

I have ordered a brushed RC 40A speed controller that I can easily drive with my propeller board

The problem is that I want to maintain about 14 amps despite electrolyte temperature rising

Can you show me where to add the very small resistor to generate a small voltage ?

The ADC conversion on my board works between at 0-3.3V so how would I ensure I get at least 1v so I have enough resolution to feedback into my program so I can control the current/pulsewidth ?

The resistor required to generate a value for monitoring current goes in the grounded leg of the FET as shown in previous schematics.
Note the low values used to limit power loss/heat generation across same.
You can use a loop of connecting wire of suitable length as the resistor, but this needs to be capable of carrying the max current you intend to use in your circuit + some. This actual resistance value will vary according to cable diameter and length of same.
Because of the low voltage level generated across this loop/"resistance", you need to amplify this signal to be of any use to your microcontroller. A simple op-amp amplifier can be used for this purpose, but you need to calculate gain for the specific resistance value used. A variable gain amplifier is best suited for this purpose, allowing your unit to be calibrated manually.
To take the ripple out of your input to your op-amp amplifier, place a high value resistor in series with the line to the op-amp input, and have a low value polarised capacitor from the op-amp input to ground.

Hope this helps.

Regards

Benny
(This post was last modified: 06-23-2010 03:56 AM by benny.)
06-23-2010 02:28 AM
Find all posts by this user Quote this message in a reply
jbalat Offline
Member
***

Posts: 280
Joined: Feb 2009
Reputation: 1
Post: #9
RE: How to make a PWM
Benny I think you overestimate my electronics abilities. Op-amp ??
I have succesfully boosted the propellor output to around 5v with a BC337 but finding the right resistors was more trial an error than anything else..
06-23-2010 06:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
benny Offline
Member
***

Posts: 332
Joined: Sep 2008
Reputation: 5
Post: #10
RE: How to make a PWM
(06-23-2010 06:03 PM)jbalat Wrote:  Benny I think you overestimate my electronics abilities. Op-amp ??
I have succesfully boosted the propellor output to around 5v with a BC337 but finding the right resistors was more trial an error than anything else..

op-amp = operational amplifier.
Have a look at this document.

http://www.national.com/an/AN/AN-31.pdf

Particularly, have a look at a non-inverting amplifier at the top of the first page.

This circuit is the one you need to amplify your low-level signal to suit your propellor board. It also shows how to calculate resistor values to suit.

Again, you need to know what voltage is generated from your resistor in the FET power circuit, 0.001 ohms ~.
OHMS LAW. V=I*R or Volts = ampt * resistance
Using this value, you can calculate the gain required in the amplifier circuit.
If you replace one of the resistors in the op-amp circuit, you can have a variable gain amplifier which allows you to calibrate the amplifier.
06-24-2010 12:55 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)