Using DUE to control an AC synch motor


I am pretty new to using arduino and I am wondering if you oculd help me with making a code for controlling a single phase AC synchronous motor. I want it to run at 50 Hz or 230 V using PWM. The main thing is a code running an H-bridge so two MOSFETS run at a time depending on which way the motor is running. Are there any examples I could look at or general tips? I have tried to look around, but I haven't been able to find a code that fit my needs and some of them looks too complicated, thus, I'm not entirely sure where to start the code either. Any help will be greatly appreciated.

You are asking for a design for a one-phase V/f inverter drive. You need a high voltage H-bridge (IGBTs probably best, not MOSFETs), opto-coupled driver signals to it. Sinusoidally modulated antiphase drive to the two half-H-bridges will give you a basic bridged inverter - just ensure the amplitude and frequency of the sine wave drive track each other (the load is mainly inductive).

You also need a high voltage DC bus for the bridge.

You have no control on direction for a one-phase synchronous motor.

Why do you need to drive it at standard mains frequency - what do you want to actually control??

I have already made the circuit to do so I just need the code to drive it.

My bad my synchronous motor is rated at standard mains, I was thinking that is relevant information to write the code needed.

I am trying to control a small wind turbine for a project I have for use at homes, which is why it is at mains frequency. It is more to make it functon at certain wind speeds with cut-in and cut-off points with a wind sensor I have, so the motor isn't damaged in anyway. It is possible it won't anyway, but it is to simulate real life wind turbines as best as possible and so I can try to get an optimal output.

Are you saying you are using it as a generator, not a motor? Or is it for steering the turbine?

Yes, I am using it as a generator.

Why? They are normally not efficient at all. Or perhaps this motor is efficient? Which motor are we talking about?

When you say controlling what do you mean exactly?

Doesn’t really matter if it is efficient or not, I’m trying to identify what will increase the efficiency, in any case it’s not really going to be used to get good power output. The project is more of a scientific nature.

The machine in question is a Kollmorgen synchronous motor ss242.

What I am trying to control is to ensure that two transistors are on at a time during operation, while ensuring that the system is able to self-start or stop given certain wind speeds. I also want a sinusoidal or triangular output.

This is the code I have managed to write currently, any advice on how to approach it further would be greatly appreciated. Setting the system to give me PWM seems iffy and I know I do lack something, but I am unsure on what.

int set1L =38;
int set1H =39;
int set2L =37;
int set2H =36;
int wind_sensor = ;
void setup()
pinMode(set1L, OUTPUT);
pinMode(set1H, OUTPUT);
pinMode(set2L, OUTPUT);
pinMode(set2H, OUTPUT);
void loop()
if (wind_sensor > 2 or wind sensor < 10;)
digitalWrite(set1L, LOW); // Forward motion
digitalWrite(set1H, HIGH);
digitalWrite(set2L, HIGH);
digitalWrite(set2H, LOW);
analogWrite(set1H, 255);
else if (wind_sensor < 2 or wind sensor > 10;)
 digitalWrite(set1L, HIGH); //Reverse motion
 digitalWrite(set1H, LOW);
 digitalWrite(set2L, LOW);
 digitalWrite(set2H, HIGH);

Ah, seems to be a properly engineered 3-phase motor, not a domestic single phase motor, with the option of a capacitor kit to convert to split-phase operation.

If that's true treat as a 3-phase PMAC motor, remove the capacitor and stick the output through a 3-phase rectifier bridge. If you want to control the load the generator sees that'll will involve a DC-DC power converter (the motors output voltage depends on speed).