- 전원공급기에서 브러쉬를 통해 전류가 N극과 S극이 있는 로터 코일로 흐르게 되면, 플레밍의 왼손법칙에 의한 방향으로 로터코일이 힘을 받아 회전
- 로터코일: 로터 축 위에 원통형으로 감겨져 있고 양쪽 끝은 축 위에 절연되어 설치된 2개의 슬립 링에 각각 접속
- 로터: 회전자
- 슬립링: 회전하는 장비에 전원 또는 신호라인을 공금할 때 전선의 꼬임없이 전달 가능한 일종의 회전형 커넥터
- 브러쉬: 돌아가는 발전기나 전동기의 정류자에 닿아서 밖으로 전류를 끌어내거나 밖으로부터 전류를 끌어 들이는 장치
- 플레밍의 왼손법칙: 엄지 검지 중지를 서로 직각이 되도록 펼치고, 검지를 자계의 B방향으로 중지를 전류 i 방향으로 하면 엄지의 방향이 전자력 F의 방향을 표시하게 된다.
1. 실습
int potentioMeterPin = 0;
int ENAPin = 9;
int in1Pin = 8;
int in2pin = 7;
int motorPWM;
int motorVelocity;
void setup(){
Serial.begin(9600);
pinMode(ENAPin, OUTPUT);
pinMode(in1Pin, OUTPUT);
pinMode(in2pin, OUTPUT);
}
int loop(){
int potentioMeter = analogRead(potetionMeterPin);
if((potentioMeter >= 0) && (potentionMeter <= 500)){
motorPWM = map(potentionMeter, 500, 0, 0, 255);
analogWrite(ENAPin, motorPWM)
digitalWrite(in1Pin, HIGH);
digitalWrite(in2Pin, LOW);
motorVelocity = map(potentioMeter,500,0,0,100);
Serial.print("CW ");
Serial.print(motorVelocity);
Serial.println(" %");
} else if((potentioMeter >= 524) && (potentioMeter <=1023)){
motorPWM = map(potentioMeter,254,1023,0,255);
analogWrite(ENAPin,motorPWM);
digitalWrite(in1Pin, LOW);
digitalWrite(in2Pin, HIGH);
motorVelocity = map(potentioMeter,254,1023,0,100);
Serial.print("CCW ");
Serial.print(motorVelocity);
Serial.println(" %");
} else{
analogWrite(ENAPin,0);
digitalWrite(in1Pin, LOW);
digitalWrite(in2Pin, LOW);
Serial.println("STOP");
}
delay(100);
}