Changing pwm in the interrupter code

A place for cool projects

Changing pwm in the interrupter code

Postby Teslacoilresearch00 » Sat Mar 24, 2018 4:25 pm

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
Teslacoilresearch00
Tipsy Toggle Switch
 
Posts: 2
Joined: Sat Mar 24, 2018 4:12 pm

Re: Changing pwm in the interrupter code

Postby Bayley » Sat Mar 24, 2018 6:29 pm

you want these lines in constants.h

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

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

//on-times in microseconds, don't forget to multiply by LOOKUP_TABLE_SCALE!
#define ON_TIME_ARRAY_LENGTH 26
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}
User avatar
Bayley
Lord Protector
 
Posts: 1162
Joined: Sat Jan 12, 2013 6:34 pm

Re: Changing pwm in the interrupter code

Postby Teslacoilresearch00 » Sun Mar 25, 2018 2:42 pm

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
Teslacoilresearch00
Tipsy Toggle Switch
 
Posts: 2
Joined: Sat Mar 24, 2018 4:12 pm


Return to Other Projects

Who is online

Users browsing this forum: No registered users and 1 guest


cron