Go Down

Topic: changing the amplitude of a DDS' sinewave (Read 3059 times) previous topic - next topic


Is it possible when using a sine looup table with the arduino to set a second analog input to control the amplitude or volume of a generated sinewave ?

I have analog input A0 set to control frequency from dc to a yet unknown frequency as im waiting for ny arduino to arrive, as i started off with the http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/ and modified the code to put out three phases spaced 120 deg apart instead of just one.

For the project im working on i realized that i want a second analog input A1 set to change the amplitude/volume of the sinewave(after the inverter and output filters) from zero signal to full output.

This is for a variable frequency drive project to run either brushless dc or induction motors using sinewave commutation and i wish to use furrent feedback from the inverter to control the amplitude of the sinewave as part of a control loop for constant/overcurrent stuff and speed control.

However im not sure if changing the volume (like the volume control on a class d switching pwm audio amplifier) is possible when using a sine lookup table in software without reducing it down from the 256 possible values used.

If i have to use external means of adjusting the level and then comparator ic's to get the PWM back, then there wouldent be much point using a mcu at all, even though generating a three phase sinewave with adjustment capability from dc up to several kHz is almost impossible without a mcu of some kind.


maybe this link is helpful - http://arduino.cc/forum/index.php/topic,72917.0.html -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


I would prefer not having to use external VCA's like the LM3900, but using some fixed point multiplication or whatever and do the VCA'ing in software so i dont need to repwm the three phase singals after running them through the VCA's.

The thing would be built like this: arduino --> six igbt gate drivers --> three phase igbt bridge --> output filters --> three phase motor.
                                                  |_______curent feedback circuitry______|

So i'd prefer not having it be like this: arduino --> lowpass filter -->Voltage controlled amplifier --> PWM comparator --> gate drive --> igbt bridge --> filters --> motor.
                                                                                                             |______________current feedback circuitry_____________|


If you create R2R DAC, it would be easy to scale/adjust volume  sin wave before it goes out.
All you would need 24 outputs for 3 phase. What board you a waiting?


You are better off either amplifying or attenuating the sine-wave as required, after it's been converted to a analog voltage. Limiting the amplitude in the digital domain will just limit the resolution and quality of the sine wave.



I'm waiting for a Arduino Duemi.. blah i cant spell it with the MEGA328.

I really wanna avoid having to use external analog circuits for the amplitude part since i'd then have to repwm it with takes yet another oscillator for the PWM carrier before i can send it to the inverter.

But it seems like thats the only way to do it without going DSP/FPGA.


Use shift register to convert serial-parallel and get more digital pins.
Scaling down 8-bit to lets say 6-bit ( 50 % ) or 5 - bit ( 25 % ) shouldn't be a problem for electrical motors. I'd expect around 5% THD for 25% output. But if it is a problem, why not build 16-bit R2R, resistors and shift registers are pretty cheap anyway?
So, in general do a math with integer/long , scale down to 16 bit , push out to registors and here you are, less than 1 % THD in worst test case scenario ( very low output)


Since it doesent appear to be possible to do what i want with satisfactory results in software i've decided to use three of these: http://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf

I plan to have a analog input converted to the required SPI data to control three of these digital pots, 256 steps should be good enough.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131