I’m having a problem with programming. I am trying to make a PWM controlled drive for AC motors. In fact I want my arduino to sent out the pulses to a driver and IGBT’s (that I’m going to try to reuse from an old AC drive). So I made a triangular carrier function that I compared with a sine function. I wrote this data to an SD card in csv format for logging in Excel. I will add the file below. The PWM I became already looks quite good but now I’m having the next problem. In my program I never really use a real ‘time’ because I don’t really know how. Until now I just used the variable ‘i’ for both the triangular function and the sine function. So now the ‘real life’ frequency is just dependent on the time that is needed for each loop. I would like to try to replace ‘i’ by the time (let’s call it ‘t’) because in fact the sine function should have frequencies between 0 and let’s say 70Hz. I don’t know if anyone has any suggestions or tips for doing this because I’m a little bit stuck…
Thanks in advance,
An electrical engineer exploring the Arduino world!
test_PWM.ino (1.66 KB)
test.doc (128 KB)