Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created June 29, 2026 15:32
Show Gist options
  • Select an option

  • Save ericfont/28f0a1b5809daf57277af27f5524b2de to your computer and use it in GitHub Desktop.

Select an option

Save ericfont/28f0a1b5809daf57277af27f5524b2de to your computer and use it in GitHub Desktop.
PWM dsm try again, with higher 500kHz sampler
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont

Copy link
Copy Markdown
Author

sim

image

@ericfont

Copy link
Copy Markdown
Author

Transfer function for feedback, from Leech textbook chapter on "Class D Amplifier":

image

where k = (output PWM peak) / (triangle peak)

In above example, k=1 and fo ~= 160 kHz.

@ericfont

Copy link
Copy Markdown
Author

attempt with fo ~= 20kHz (using Cf = 750pF) somehow results in more noise:

image

@ericfont

Copy link
Copy Markdown
Author

@ericfont

ericfont commented Jun 29, 2026

Copy link
Copy Markdown
Author

if use Cf=10pF, then fo ~= 1.6 MHz

image

Although this is very clean, it isn't really producing a PWM but rather is more just like plain DSM.

@ericfont

ericfont commented Jun 29, 2026

Copy link
Copy Markdown
Author

@ericfont

Copy link
Copy Markdown
Author

@ericfont

Copy link
Copy Markdown
Author

@ericfont

Copy link
Copy Markdown
Author

@ericfont

Copy link
Copy Markdown
Author

peaks are every 25kHz:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment