Go Down

Topic: SOLVED How to generate SINE PWM SOLVED (Read 50714 times)previous topic - next topic

so3ody

#45
Mar 19, 2014, 03:33 pm
Quote
You can change it also by having more or fewer samples in your code.

fewer sampels= lower resoultion of the sine wave
Well I know but its not an elegant way cause I think it will cause some troubles when I try to use my programm as a variable frequncy driver or inverter to drive a 3 phase motor

So do you have an idea or can give me  a tipp to improve the sine wave frequency variation..

Quote

What sort of current have you got there? You will struggle to get a capacitor that will handle a lot of ripple current.

The current will be about 2A.

Grumpy_Mike

#46
Mar 19, 2014, 04:15 pm
Quote
fewer sampels= lower resoultion of the sine wave

Sure but what does it matter if as you say:-
Quote
cause I will actually uses the signals to drive an H bridge.

So why even bother with a sin wave anyway because the h bridge will turn that back into a square wave so you might just as well have a square wave driving your bridge.

Quote
The current will be about 2A.

Well filtering the direct drive square output is not going to be very cheap, I am not sure if you have thought this through.

promacjoe

#47
Mar 19, 2014, 07:46 pm
I haven't been following this thread much, but if you're trying to drive a three phase motor, you need three equally spaced phases to do it. The Arduino due will only give you two.

Variable frequency drives very the frequency Of three sine wave generators. They do not actually use PWM.

My advice is to change the motor to a single phase or DC motor. Or get a external Sine wave generator that will produce three Phase.
Joe.

Grumpy_Mike

#48
Mar 19, 2014, 09:25 pm

I haven't been following this thread much, but if you're trying to drive a three phase motor, you need three equally spaced phases to do it. The Arduino due will only give you two.

Variable frequency drives very the frequency Of three sine wave generators. They do not actually use PWM.

My advice is to change the motor to a single phase or DC motor. Or get a external Sine wave generator that will produce three Phase.
Joe.

Sorry, you have not been reading the thread. We are using PWM here to create a sin wave, we are not using PWM to directly drive the motor.
While there are only two DACs in the Due you can use the PWM pins to create an analogue output.

so3ody

#49
Mar 19, 2014, 10:33 pm
@Gumpy_Mike

Quote
So why even bother with a sin wave anyway because the h bridge will turn that back into a square wave so you might just as well have a square wave driving your bridge.

Well I need a pwm signal to drive my h bridge. The output of my H bridge will be filterd in order to generate a sine wave. The 3 sine waves will control a 3 phase motor.

So now you know what I mean

So as I asked before is it possible to vary the frequency of the sine waves in a better way than the index items ??

Grumpy_Mike

#50
Mar 19, 2014, 11:45 pm
Quote
Well I need a pwm signal to drive my h bridge.

No you do not drive a h-bridge with a sin wave.
You might drive a class B amplifier but not a H-bridge.
Quote
So now you know what I mean

No, you seem to have driving circuits confused.

Quote
So as I asked before is it possible to vary the frequency of the sine waves in a better way than the index items

Only that and the delays. Over what range do you want it to vary?

promacjoe

#51
Mar 20, 2014, 05:20 am
Not sure exactly what you're trying to do, and from what I have read not many that has responded understand it either.
I do know that PWM Voltage control is directly related to the current draw Versus the current input in the circuit. The voltage is maintained by maintaining the current input.
Not directly regulating the voltage.

There are ICs out there that I believe will do what you need. This one might work for you.
http://www.ebay.com/itm/FCM8282-x2-3-Phase-Sinusoidal-Brushless-DC-motor-controller-FCM8282QY-/181228852417?pt=LH_DefaultDomain_0&hash=item2a3214d4c1.

Note: I have no information on this chip other than what the website gives me. This is just an example of what is out there. And at that price it should be cheap enough to experiment with.

Hope this helps.

Joe.

StanO8

#52
Mar 20, 2014, 05:55 am

Not sure exactly what you're trying to do, and from what I have read not many that has responded understand it either.
Joe.

Hi Joe, op is trying to control a three-phase AC induction motor. All very possible and a fun project. Many who have read it probably did not bother responding because of the beginner nature of the discourse.

As you have observed there are dedicated chips (you referenced a BLDC controller). But what is the fun of that?

IMO, the types of people that were playing with Holley 600 four-barrel carburetors in the 1970's are playing with just this type of circuit today. The GM EV1, Tesla Roadster, and Tesla Model S all have 3-phase AC induction motors with this type of controller.

Additionally, white goods (household washing machines, dryers, etc.) can be made better and cheaper with this same technology (Example, Whirlpool Duet runs on 120VAC, has a three phase 200V AC induction motor, ebay cheap).

Additionally, advanced features include software reverse (just swap two phases). Regen mode (software controlled generator).

promacjoe

#53
Mar 20, 2014, 06:33 am
I understand the fun of hacking something to do something else. Your mention of the Holley carburetor is not really applicable, since the Holley carburetor was designed to do one thing, deliver the proper amount of fuel versus air mixture.. No matter how much you tweak it, it does the exact same thing as it was designed to do. Nothing more.
No microcontroller can be all things to all needs. There's always going to be something that it needs help with. And that's all I'm suggesting.

Even if he does not use a chip of this type, if this type of control is what he needs, At least we will better understand what his needs are.

Joe.

polymorph

#54
Mar 20, 2014, 06:51 am
Grumpy_Mike has this well-in-hand.

Drive the H bridge drives with the PWM signals directly. Don't filter anywhere. Let the inductance of the motor windings and the mechanical inertia of the rotor filter it.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

Grumpy_Mike

#55
Mar 20, 2014, 10:31 am

I do know that PWM Voltage control is directly related to the current draw Versus the current input in the circuit. The voltage is maintained by maintaining the current input.
Not directly regulating the voltage.

No that is not what PWM is at all!

It stands for pulse width modulation and the average voltage is controlled by turning a signal on and off. It has absoloutly nothing to do with current.

If you would like to know what it is then please read this:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

so3ody

#56
Mar 20, 2014, 11:14 am
@ Grupy Mike

Quote
So why even bother with a sin wave anyway because the h bridge will turn that back into a square wave so you might just as well have a square wave driving your bridge.

Well its a standard way to drive an asynchronus machine. It will be a big project to. I will have to drive a 3 phase motor due to the  Field oriented control method... but firestly I have to start.

My H bridg will be driven with  normal PWM signals. But if you drive a motor @ 30 KHz with a square wave like pwm you will have losts esc.. this is why I will filter the output of my H brigde to get a sine wave.

I hope that you understand now what I mean

This is why I look for a better way to vary the frequency of the sine wave than delay or less sine items

Grumpy_Mike

#57
Mar 20, 2014, 11:23 am
Quote
I hope that you understand now what I mean

I do, but I don't think you understand the consequences of trying to filter a signal with such a current drive with a capacitor.

Quote
But if you drive a motor @ 30 KHz with a square wave like pwm you will have losts

Do you mean losses? You always have losses driving anything magnetic, get over it.

Quote
This is why I look for a better way to vary the frequency of the sine wave than delay or less sine items

You still have not said what range of frequency you need. I am assuming that it isn't going fast enough for you.
The only other way with the technique of using a processor to do the generation is to vary the clock frequency, but you don't want to go there for many reasons. Or you could get a faster processor.

It looks like using a Due is a dead end for your project.

so3ody

#58
Mar 20, 2014, 01:13 pm
@Gumpy_Mike

Quote

You still have not said what range of frequency you need. I am assuming that it isn't going fast enough for you.
The only other way with the technique of using a processor to do the generation is to vary the clock frequency, but you don't want to go there for many reasons. Or you could get a faster processor.

It looks like using a Due is a dead end for your project.

The range of my sine wave should be between 30 KHz and 80 Khz

Its is possible with the due but I just dont know the technique I can make it with

polymorph

#59
Mar 20, 2014, 01:36 pm
Look up "magic sinewave" by Don Lancaster. Oh, heck, here is the link:
http://www.tinaja.com/magsn01.shtml

The idea is that it is an already encoded PWM, done in such a way that nearly all the frequency components outside of the fundamental sine wave are far above the fundamental frequency and therefore easier to filter.

I am wondering if eddy current losses will be enough of an issue to go to the trouble of filtering.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8