قسم الميكروكنترولر والروبوت ودوائر الاتصال بالحاسب الالي قسم المتحكمات الـ microcontroller و المعالجات microprocessor و التحكم الرقمي بالكمبيوتر CNC والانظمة الآلية والروبوت Robots

أدوات الموضوع

hamzabest
:: مهندس ::
تاريخ التسجيل: Apr 2014
المشاركات: 2
نشاط [ hamzabest ]
قوة السمعة:0
قديم 07-04-2014, 09:40 PM المشاركة 1   
افتراضي Control moteur asynchrone with arduino Twitter FaceBook Google+



j'ai un projet de réalisation un variateur de vitesse d'un moteur asynchrone

moteur asynchrone 220/380V
0.75KW
COS &= 0.8
vitesse = 1350 tr/min
f = 50hz

(6 IGBT) j'utilise l'arduino mega 2560 pour le commande de module IGBT



كود:
int PhaseA1 =  5;     // the number of the pin controlling the High side of Phase 1
int PhaseA2 =  6;     // the number of the pin controlling the Low side of Phase 1
int PhaseB1 =  7;     // the number of the pin controlling the High side of Phase 2
int PhaseB2 =  8;     // the number of the pin controlling the Low side of Phase 2
int PhaseC1 =  9;     // the number of the pin controlling the High side of Phase 3
int PhaseC2 =  10;    // the number of the pin controlling the Low side of Phase 3

int ledStateA1 = LOW;              // ledState used to set whether that MOSFET is on or off
int ledStateA2 = LOW;             // LOW side MOSFETS are on with a HIGH
int ledStateB1 = HIGH;             // HIGH side MOSFETS are on with a LOW
int ledStateB2 = HIGH;             // At any given time 2 MOSFETS should be ON, 4 OFF
int ledStateC1 = LOW; 
int ledStateC2 = LOW; 
long previousMillis = 0;        // will store last time a cycle finished was updated
int sensorPin = A0;            // Pin which reads output from the switch controlling phase rotation
int sensorValue = 0;            // Initial sensor value

long wavelength = 100;         // wavelength of the output


void setup() {
  // set the digital pin as output:

  pinMode(PhaseA1, OUTPUT);
  pinMode(PhaseA2, OUTPUT);
  pinMode(PhaseB1, OUTPUT);
  pinMode(PhaseB2, OUTPUT);
  pinMode(PhaseC1, OUTPUT);
  pinMode(PhaseC2, OUTPUT);
}

void loop()
{
unsigned long currentMillis = millis();
sensorValue = analogRead(sensorPin);  

if(sensorValue>500){
  PhaseA1 =  5;      // the number of the LED pin
  PhaseA2 =  6; 
  PhaseB1 =  7; 
  PhaseB2 =  8; 
}
else{
  PhaseA1 =  7;      // the number of the LED pin
  PhaseA2 =  8; 
  PhaseB1 =  5; 
  PhaseB2 =  6; 
}

  int sensorValueMap =map(sensorValue, 150, 850, 1, 11);  // maps sensorValues into 11 different cases. 
                                                          // If the potentiometer did not have resistors 
                                                          // than the second two numbers would be 0 and 1024
 
 
  
switch(sensorValueMap){              // switches wavelength depending on value sent by potentiometer. 
  case 1:
    wavelength = 15;                // if the sensorValue is in case 1, than the wavelength is 15ms. 
    break;
  case 2:
    wavelength = 30;                // if the sensorValue is in case 2, than the wavelength is 30ms...
    break;
  case 3:
    wavelength = 100;
    break;
  case 4:
    wavelength = 500;
    break;
  case 5:
    wavelength = 1000;
    break;
  case 6:
    wavelength = 5000;
    break;
  case 7:
    wavelength = 1000;
    break;
  case 8:
    wavelength = 500;
    break;
  case 9:
    wavelength = 100;
    break;
  case 10:
    wavelength = 30;
    break;
   case 11:
    wavelength = 15;
    break;

}


  

unsigned long elapsed = currentMillis - previousMillis;  // elapsed is the time since the end of the last cycle
  int pulses =map(elapsed, 0, 2*wavelength, 0, 12);      // maps the elapsed time into 13 possible cases
switch (pulses){
  case 0:
  ledStateA1=HIGH;      // Sets the state for the A MOSFETs so the output from the inverter follows the correct waveform
  ledStateA2=LOW;       // Case 0 is time = 0
  ledStateB1=HIGH;      // From time=0 to time=wavelength/12 phase A is 0, phase B is Negative, phase C is Positive 
  ledStateB2=HIGH;
  ledStateC1=LOW;  
  ledStateC2=LOW;
  digitalWrite(PhaseA1, ledStateA1);
  digitalWrite(PhaseA2, ledStateA2);
  digitalWrite(PhaseB1, ledStateB1);
  digitalWrite(PhaseB2, ledStateB2);
  digitalWrite(PhaseC1, ledStateC1);
  digitalWrite(PhaseC2, ledStateC2);
  break;
  case 1:                  // Case 1 is time = wavelength/12
  ledStateA1=LOW;          // Phase A is switching to Pos
  ledStateA2=LOW;         
  digitalWrite(PhaseA1, ledStateA1);
  digitalWrite(PhaseA2, ledStateA2); 
  ledStateC1=HIGH;        // Phase C is switching to 0
  ledStateC2=LOW;
  digitalWrite(PhaseC1, ledStateC1);
  digitalWrite(PhaseC2, ledStateC2);
  break;
  case 3:                  // Case 3 is time = 3*wavelength/12
  ledStateB1=HIGH;          // phase B is switching to 0
  ledStateB2=LOW;
  digitalWrite(PhaseB1, ledStateB1);
  digitalWrite(PhaseB2, ledStateB2);
  ledStateC1=HIGH;          //Phase C is switching to negative
  ledStateC2=HIGH;  
  digitalWrite(PhaseC1, ledStateC1);
  digitalWrite(PhaseC2, ledStateC2);
  break; 
  case 5:                       // Case 5 is time = 5*wavelength/12
  ledStateB1=LOW;                // Phase B is switching to positive
  ledStateB2=LOW;
  digitalWrite(PhaseB1, ledStateB1);
  digitalWrite(PhaseB2, ledStateB2);
  ledStateA1=HIGH;              // Phase A is switching to 0
  ledStateA2=LOW;
  digitalWrite(PhaseA1, ledStateA1);
  digitalWrite(PhaseA2, ledStateA2);            
  break;
  case 7:               // Case 7 is time = 7*wavelength/12
  ledStateA1=HIGH;       // Phase A is switching to negative
  ledStateA2=HIGH;
  digitalWrite(PhaseA1, ledStateA1);
  digitalWrite(PhaseA2, ledStateA2); 
  ledStateC1=HIGH;      // Phase C is switching to 0
  ledStateC2=LOW;
  digitalWrite(PhaseC1, ledStateC1);
  digitalWrite(PhaseC2, ledStateC2);
  break; 
  case 9:               // Case 9 is time = 9*wavelength/12
  ledStateC1=LOW;        // phase C is switching to positive
  ledStateC2=LOW;
  digitalWrite(PhaseC1, ledStateC1);
  digitalWrite(PhaseC2, ledStateC2);
  ledStateB1=HIGH;      // phase B is switching to negative
  ledStateB2=HIGH;
  digitalWrite(PhaseB1, ledStateB1);
  digitalWrite(PhaseB2, ledStateB2);
  break; 
  case 11:               // Case 11 is time = 11*wavelength/12
  ledStateA1=HIGH;       //Phase A is switching to 0
  ledStateA2=LOW;
  digitalWrite(PhaseA1, ledStateA1);
  digitalWrite(PhaseA2, ledStateA2); 
  ledStateB1=HIGH;      // Phase B is switching to negative
  ledStateB2=HIGH;
  digitalWrite(PhaseB1, ledStateB1);
  digitalWrite(PhaseB2, ledStateB2);
  break; 
  case 12:                 // Case 12 is time = 12*wavelength/12 or the end of the program
  previousMillis = currentMillis;
  break; 
}
if(pulses>12){
    previousMillis = currentMillis;          // prevents program from crashing if it misses case 12
}
}
svp aide pour commander le moteur de sens

اعلانات

hamzabest
:: مهندس ::
تاريخ التسجيل: Apr 2014
المشاركات: 2
نشاط [ hamzabest ]
قوة السمعة:0
قديم 13-04-2014, 08:05 PM المشاركة 2   
افتراضي


أرجو مساعدة

اعلانات اضافية ( قم بتسجيل الدخول لاخفائها )
  

moos0souf
:: مهندس متواجد ::
تاريخ التسجيل: Jul 2009
الدولة: الجزائر
المشاركات: 53
نشاط [ moos0souf ]
قوة السمعة:0
قديم 24-04-2014, 09:24 PM المشاركة 3   
افتراضي


salam alikom
tu peux pas commander la machine asynchrone par IGBT ; tu peux faire csa a l'aide de TRIAC (gradateur)


moos0souf
:: مهندس متواجد ::
تاريخ التسجيل: Jul 2009
الدولة: الجزائر
المشاركات: 53
نشاط [ moos0souf ]
قوة السمعة:0
قديم 24-04-2014, 09:26 PM المشاركة 4   
افتراضي


هل تستطيع شرح الكود أردوينو و لماذا استعملت 6 PWM ؟؟

إضافة رد

العلامات المرجعية

«     الموضوع السابق       الموضوع التالي    »
أدوات الموضوع

الانتقال السريع إلى


الساعة معتمدة بتوقيت جرينتش +3 الساعة الآن: 12:27 AM
موقع القرية الالكترونية غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي موقع القرية الالكترونية ولايتحمل الموقع أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)

Powered by vBulletin® Version 3.8.6, Copyright ©2000 - 2025