Page 1 of 1

Changing pwm in the interrupter code

PostPosted: Sat Mar 24, 2018 4:25 pm
by Teslacoilresearch00
Hi all,
Before, something on me, I'm Emanuele, I'm from Italy and I'm 17, I study and I love working on tesla coils!
I'm a new member and I ask you for some help, I'm working on a huge DRSSTC and I've planned to use the onetesla's interrupter for my project, but the standard time on (pwm) of this interrupter is too low for me, I have no experience in code or programming so I ask you how and where should I change values in the code to obtain higher pwm on time, something like from 0 to 80/100us!
Does anyone can help me? ;) ;)
Thanks to all,
regards Emanuele

Re: Changing pwm in the interrupter code

PostPosted: Sat Mar 24, 2018 6:29 pm
by Bayley
you want these lines in constants.h

Code: Select all
//multiply the pulsewidths by this constant, good for quick 'n dirty scaling

//minimum on-time, in microseconds
#define MIN_ON_TIME 10

//on-times in microseconds, don't forget to multiply by LOOKUP_TABLE_SCALE!
static byte on_times[] =
{33, 33, 33, 33, 27, 23, 20, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 8, 8, 8, 8, 8, 8, 8}

Re: Changing pwm in the interrupter code

PostPosted: Sun Mar 25, 2018 2:42 pm
by Teslacoilresearch00
Thanks you very much! And now what should I change to obtain the 100us on time? I don't understand what is the LOOKUP_TABLE_SCALE! Is a factor that moltiplicate ON_TIME_ARRAY_LENGHT? So if I compile 30 on ON_TIME_ARRAY_LENGHT and 3 on LOOKUP_TABLE_SCALE, at the output signal I will have something like 150us max? And what about MIN_ON_TIME, also it depends on the LOOKUP_TABLE_SCALE factor? So if I have 10 on MIN_ON_TIME ad the same 3 on LOOKUP_TABLE_SCALE I will find 30us minimal on time at the output? Or the min on time is independent from this constant? Also, what are the static byte on_times? If I change ton of the code shuold I change also this? If yes, in which method I will work on?
Thanks you very much for your time, I know I'm ignorant on this argument but I'm trying to understand from basics and at the time this code is too much difficult to understand for me!
Regards, Emanuele