Black-box design to create sawtooth waveform

  • Engineering
  • Thread starter peasngravy
  • Start date
  • #36
berkeman
Mentor
64,451
15,812
Ok so I set up the sources with the following frequencies, and got this:
6283
12566
18849
25132

View attachment 271863
Remember that you have to scale each resistor divide ratio to match the FS coefficients...

Also, when I use a simple Excel spreadsheet to plot the FS function you are given, it's closer to an inverse sawtooth instead of a sawtooth waveform. And of course it doesn't include the offset and scaling yet to give you the 0-5V sawtooth waveform that you are asked to produce with your circuit:

1604080805568.png


When I use the FS from Wikipeda for a forward sawtooth waveform (including the offset and scaling for the Amplitude = 5V), it looks a lot closer once the initial startup phase is done...

1604080998094.png


Is there some way to verify with the instructor or TA whether that is the right FS that they want you to use in the problem statement?
 

Attachments

  • 1604080764096.png
    1604080764096.png
    7.3 KB · Views: 72
  • #37
gneill
Mentor
20,948
2,892
The problem statement doesn't specify any particular value for ##\omega##, so I think you're free to choose anything you like. For example you could make the base frequency equal to 1000 Hertz and not worry about the associated angular frequency. That will make setting up your simulation easier. Frequencies for the voltage sources can then just be: 1000, 2000, 3000, 4000 (Hertz)

Edit: Looking again at the problem statement I see by the waveform diagram that they want a 1 ms period for the sawtooth. A 1000 Hz base frequency will at least get you close, and you can always fine tune the base frequency once you've sorted out the circuit design.

The problem statement didn't say that the given Fourier sequence was for a sawtooth of the exact form desired. It might well be an inverted version of the desired waveform and centered about zero volts. An inverting op-amp configuration might be a real benefit here :wink:

Using Mathcad to perform the summation:

1604082119566.png

Negating the function and adding a suitable offset value to "pull up" the minimum:

1604082459044.png

Still have the function maximum value to deal with since we want the peak to be around 5 V, but that's just fiddling with the stage gain.
 
Last edited:
  • #38
peasngravy
72
6
Yeah I think i will email him about that actually!
 
  • #39
peasngravy
72
6
My brain is pretty fried by now, so thank you for your patience. I am getting there slowly but surely, I think

How do I relate my gain to the frequencies though?

Sorry for all the stupid questions - again, this is all very new to me, I think I'm too old to learn new stuff :biggrin:
 
  • #40
gneill
Mentor
20,948
2,892
How do I relate my gain to the frequencies though?
You don't! For this circuit, without reactive components, the gain will be independent of the signal frequency.

This will hold true for ideal components (which you are simulating here), but in the real world you'd want to remain within a given op-amp's operating bandwidth. Outside of the "flat" region gain will roll off and phase shift with frequency will need to be considered. Such topics are likely outside of the scope of your current course. Maybe next term :smile:
 
  • #41
peasngravy
72
6
Fortunately for me there won't be another term! This course is just something I did for my own benefit. I started it a couple of years ago when i was made redundant and thought I should do something to fill the time. Got another job pretty quickly though so its been much slower progress than I hoped

So regarding the gain - do I just want to divide the 4 inputs so that each one gives 1.25v?
 
  • #42
berkeman
Mentor
64,451
15,812
It might well be an inverted version of the desired waveform and centered about zero volts. An inverting op-amp configuration might be a real benefit here
Hah! That would be pretty smart to use the FS for the inverted Sawtooth, in order to save one opamp stage in the final circuit. I need to remember that trick... :smile:
 
  • #43
gneill
Mentor
20,948
2,892
So regarding the gain - do I just want to divide the 4 inputs so that each one gives 1.25v?
You can adjust the gain overall by simply altering the feedback resistor, no?
 
  • #44
gneill
Mentor
20,948
2,892
Hah! That would be pretty smart to use the FS for the inverted Sawtooth, in order to save one opamp stage in the final circuit. I need to remember that trick... :smile:
More than that, it also avoids dealing with the negative and positive terms separately!
 
  • #45
peasngravy
72
6
Do you think my circuit looks correct then, other than adjusting the feedback resistor?

I have now gone for the 1k, 2k, 3k and 4k frequencies like you said

1604086441265.png

Obviously I still need to add the offset and deal with the inverted output but i can do that once i get the correct waveform (which currently looks like this:)
1604086503702.png
 
  • #46
berkeman
Mentor
64,451
15,812
Do you think my circuit looks correct then, other than adjusting the feedback resistor?
You still need to adjust the series resistors for each of the AC Sources to get the FS coefficients. That is one reason you don't have a near-sawtooth waveform yet...

1604086774037.png
 
  • #47
peasngravy
72
6
I have messed around with those but I am at a loss at what to try now. Should they be something like 10k, 20k, 30k and 40k?
 
  • #48
berkeman
Mentor
64,451
15,812
I have messed around with those but I am at a loss at what to try now. Should they be something like 10k, 20k, 30k and 40k?
Yeah, something like that... :smile:
 
  • #49
peasngravy
72
6
Yeah, something like that... :smile:

I tried this circuit on different software and it's almost exactly what I'm after!

I was using simetrix - when I build the exact same circuit on circuitlab online, I get a completely different waveform
 
  • #50
peasngravy
72
6
Thank you so much for your patience today and for staying with me - I have no idea why that software shows the waveform differently but at least I am there now.
 

Suggested for: Black-box design to create sawtooth waveform

Replies
44
Views
2K
  • Last Post
Replies
3
Views
643
  • Last Post
Replies
3
Views
630
  • Last Post
Replies
4
Views
480
Replies
4
Views
305
  • Last Post
Replies
12
Views
854
  • Last Post
Replies
5
Views
924
  • Last Post
Replies
16
Views
2K
  • Last Post
Replies
16
Views
1K
Top