|
|
View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
OFF TOPIC: Signal generator |
Posted: Wed Oct 11, 2006 7:06 am |
|
|
Is it possible to make signal generator in range 1 - 10 HERTZ with picmicro. ?
I need suggestions what would you do, which speaker would you use etc..
Regards! |
|
|
sjbaxter
Joined: 26 Jan 2006 Posts: 141 Location: Cheshire, UK
|
|
Posted: Wed Oct 11, 2006 8:54 am |
|
|
Yes it is. As its such a low frequency, the PWM module is not really a option. I have created (for one of our products) a square wave generator that operates in the range of 0.1Hz to 500Hz and with a duty cycle of between 1% and 99%.
In short it uses a single 16 timer (with interrupt handler) and a few calculations to determine the pre-load of the timer and how many times the timer rolls over (interrupts) before toggling the output pin.
I'm sorry I can't post any code (company copyrighted) but it is fairly straight forward if you use the above principle.
As for a speaker, do a search on the forum and you'll find some info on how to connect one up. _________________ Regards,
Simon. |
|
|
Ttelmah Guest
|
|
Posted: Wed Oct 11, 2006 9:15 am |
|
|
You need to give rather more data about what 'sort' of signal you are after. My immediate thought would be, to use a DAC, and a 'wavetable' in the PIC, which would over that sort of frequency range, allow any waveshape to be synthesised. However because it is synthesised, there will be the quantisation noise to deal with. The sort of amplifier needed would depend on what you wanted to drive.
Best Wishes |
|
|
C Turner
Joined: 10 Nov 2003 Posts: 40 Location: Utah
|
|
Posted: Wed Oct 11, 2006 11:46 am |
|
|
Not mentioning exactly what short of waveform you are after, it's hard to tell - but usually, when one says "signal generator" one is probably after a sine wave: You might have meant to say "function generator" if you wanted a variety of other waveforms (square, sawtooth, triangle, etc.)
A possibly useful thread is this one:
http://www.ccsinfo.com/forum/viewtopic.php?t=26636&highlight=
One of the easiest ways to generate a sine wave is with DDS techniques using the PWM: The frequency resolution can be as fine as you code it to be (practical limit is the 32 bit accumulator in the compiler) and it gets slightly tricky to make a sine table bigger than 256 bytes on some processor - although one could fairly easily make a 1k equivalent table using a 256-entry table by just representing one quadrant of the sine in ROM and relying on the fact that the other 3 quadrants of the sine wave are identical, except that they are backwards and/or upside-down:-) With the PIC, it is very practical to, at these low frequencies, to synthesize 16 bits of PWM resolution - but your primary limitation will likely be that of the resolution of the sine table itself.
An essential component of frequency synthesis is filtering to minimize the unwanted energy. For a 10 Hz maximum frequency, one would likely use a lowpass filter with a knee no higher than 15-20 Hz.
One more comment: You ask what speaker to use.
For frequencies below 10 Hz, the answer is: A MASSIVE one: Effective radiating of sound at those frequencies implies many square feet of surface area of the speaker - either one huge speaker, a large array, or moving a large substrate like a large panel, wall or ceiling.
CT
[/url] |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
Re: OFF TOPIC: Signal generator |
Posted: Wed Oct 11, 2006 1:27 pm |
|
|
The choice of speaker depends on what is listening to this signal. Surely this is not intended for a human ear as the ear doesn't respond to these frequncies. If it is for a human audience you are going to need to put a servo motor in a chair, or a solenoid in the floor or something like that. Tell us more about the application. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Guest Guest
|
|
Posted: Thu Oct 12, 2006 7:27 am |
|
|
Quote: | As for a speaker, do a search on the forum and you'll find some info on how to connect one up | . I can not find any to suit my needs :-(
Quote: | signal generator" one is probably after a sine wave |
Yes, it's sine wave.
Quote: | A MASSIVE one: Effective radiating of sound... |
I saw some products of tektronix, wavetek etc, but they are not using some massive speaker ( or am i missing something ? ).
Im using 16F877 and the project is educational project in part of medicine.
Is there any schematics on for to connect speaker with picmicro ( for this project ) ?
Regards ! |
|
|
Guest Guest
|
|
Posted: Mon Oct 16, 2006 6:21 am |
|
|
@sjbaxter
Can you please give me infos on your hardware ( is this transducer, speaker ) and where can i buy it ?
Thank you. |
|
|
Ttelmah Guest
|
|
Posted: Mon Oct 16, 2006 6:55 am |
|
|
First of all, forget about a 'speaker'. The problem is actually 'Zen' in nature. Think about the concept of the 'sound of one hand clapping'. If you wave your hand up and down, you are effectively potentially doing what a speaker would do at these sorts of frequencies, yet no 'sound' is produced, and the pressure changes beyond even a very few inches are indetectable. Why?. The reason is that the pressure changes are tiny, because the pressure can move round the hand easily at such low speeds. To make significant amounts of sound at such frequencies, you either have to move the transducer faster (very long 'throw'), or have a much larger distance, for the route 'round' the 'transducer'. The latter can be done by mounting the transducer into a vastly larger chamber (imagine that instead of waving your hand, you move a hand sized 'shutter' in the wall of a large room). Pressure changes will be detectable right through the room. This is called an 'infinite baffle', and it is possible to produce devices that behave as if they offer such a size, using smaller cases, by 'folding' the path, or using different materials for the route 'back'. Similarly, you can produce low frequencies using a horm system, and just as with the tuba, where a pipe several meters in length, is folded up into a relatively compact space, similar folding can be used on these transducers.
Most applications using such low frequencies will not involve air as the primary transfer medium. If you wobble the end of a bridge up and down at 4Hz, there is no 'sound' as such involved, but the mechanical transmission in the material of the bridge. The only transducers from Tektronics, that I know of for this sort of frequency, are designed for this type of application, and to use in 'air' would require the addition of a baffle or horn to produce an effective output. Similarly, use of a thicker medium allows lower frequencies to be used (think of the 'one hand clapping', but in a bath of thick treacle). Some medical systems use body immersion in various fluids for this reason.
Now the problem is that you are coming at this problem 'from the wrong end'. Making a signal of some sort at these frequencies with a PIC, is infantile in terms of it's simplicity. However, driving it into a transducer, will depend _totally_on the nature of the transducer. For example, the linear drives used for one mechnical application I was involved with, required over 300A at 48V, while another system over 1000V was needed at the transducer...
You need to stop thinking about a 'speaker'. No conventional loudspeaker, will get down to these frequencies with even tiny efficiencies. Most are rolling off significantly in terms of their reproduction below even 50Hz, and even special bass units rarely go much below 20Hz.
You need to start by indentifying how you are going to generate this sound (the transducer), and then how you are going to couple this into the target concerned. Only once you have cracked these problems, and with an idea of what the drive requirements for the driver are, should you start wondering about generating the signal...
Best Wishes |
|
|
Guest Guest
|
|
Posted: Mon Oct 16, 2006 11:27 am |
|
|
Thank you very much for this explanation !.
I will take some time for research and then i get back to you and all others posters, on this thema.
Thank you again ! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|