I would like to generate 6 separate gate pulses (6 Digital signals from T1 to T6 as shown in below picture) to control 3 phase inverter, these 6 pulses are changing in the same time and hold this status for 5 msec, the complete cycle will be 30 msec (equivalent 0 to 360 Deg ) and it will repeat forever, below i will put complete cycle (6 Diff. pulses status and each status period is 5 msec ).
Status1: T1, T5 and T6 will be High
Status2: T1, T2 and T6 will be High
Status3: T1, T2 and T3 will be High
Status4: T2, T3 and T4 will be High
Status5: T3, T4 and T5 will be High
Status6: T4, T5 and T6 will be High
i have Arduino UNO and MSGA, so appreciate your support to give me program to get this functioning .
void setup() {
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
}
void loop() {
static int state=0;
// inverter states - add other 4 states
byte states[6][6]={ {1,0,0,0,1,1}, {1,1,0,0,0,1}};
digitalWrite(2,states[state][0]);
digitalWrite(3,states[state][1]);
// move to next state - if at end reset
if(++state>=2)state=0;
delay(5);
}
you could connect a potentiometer to A0 and read the analogue value which would range 0 to 1024
you then use this value for the delay, e.g. this should give a delay 0 to 10mSec