Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.03 KB

README.md

File metadata and controls

33 lines (23 loc) · 1.03 KB

sawtooth_psim_dll

This sawtooth wave generator was tested in PSIM 2022.3.0.60 64bits and its intended to overrun the issue with the element "Saw-tooth voltage source (grounded)".

The sawtooth-wave voltage generator doesn't work properly when the frequency is about 1/10 of the frequency of the simulation.

As shown in figure 1, the signal vtri_cg (blue) not always get to value of 1. comparativo figure 1

The FFT from both signals shows in figure 2 the correct frequency at 25kHz. 25kHz figure 2

Compiling DLL for PSIM using gcc

Toolchain: gcc 64 bits

PATHS = src/
PATHB = build/
PATHO = build/objs/
MKDIR = mkdir -p

all:
	$(MKDIR) $(PATHO)
	gcc -c -o $(PATHO)main.o $(PATHS)main.c
	gcc -o $(PATHB)sawtooth.dll $(PATHO)main.o -s -shared -Wl,--subsystem,windows

clean:
	rm -rf build/