목차
1. 스테핑 모터의 구조
2. 코딩
3. 결과설명
2. 코딩
3. 결과설명
본문내용
ig_state <= state5;
motor_output <= "0011";
when state5 =>
sig_state <= state6;
motor_output <= "0001";
when state6 =>
sig_state <= state7;
motor_output <= "1001";
when state7 =>
sig_state <= state0;
motor_output <= "1100";
end case;
// 1-2상 스테핑 모터 제어로 모터에 주어지는 펄스의 대응하여 회전량을 정확하게
// 얻을 수 있는 모터 이다
// 1-2상 방식은 첫 번째는 1개의 coil에 전류를 흐르게 하고 두 번째는 2개의
// coil에 전류를 흐르게 하여 모터를 구동하는 방법
// dir 이 ‘1‘일 경우 순차적으로 구동
else// dir='1'이 아닐 경우 수행
case sig_state is
when state0 =>
sig_state <= state7;
motor_output <= "1001";
when state1 =>
sig_state <= state0;
motor_output <= "1000";
when state2 =>
sig_state <= state1;
motor_output <= "1100";
when state3 =>
sig_state <= state2;
motor_output <= "0100";
when state4 =>
sig_state <= state3;
motor_output <= "0110";
when state5 =>
sig_state <= state4;
motor_output <= "0010";
when state6 =>
sig_state <= state5;
motor_output <= "0011";
when state7 =>
sig_state <= state6;
motor_output <= "0001";
end case;
// dir 이 ‘1’일 아닐 경우 역순으로 구동
end if;
end if;
end if;
end process;
end implementation;
3. 결과설명
[그림 3.1] Waveform Editor
소스 코딩후 검증을 하기위해서 [그림 3.1]과 같이 Waveform Editor창에서 입력 및 출력 신호를 정의한다.
우선 시물레이션을 하기위해 다음과 같이 클럭을 설정을 한다.
Grid Size(200ns)와 End Time(2.0us)를 설정
Clock : 50 ns
Data_Clock[0] : 100 ns
Reset : Count Value end time 100ns, Count every 50ns
Start_Stop : Count Value Start time 975ns, End time 1175ns, Count every 200ns
Dir : Count Value end time 825ns, Count every 825ns
[그림 3.2] Simulation
스테핑 모터제어 1-2상 방식은 첫 번째는 1개의 coil에 전율을 흐르게 하고 두 번째는 2개의 coil에 전류를 흐르게 하여 모터를 구동하는 방법으로 시물레이션 실행결과는 [그림 3.2]와 같이 dir='1'일때 s0, s1, s2, s3, s4, s5, s6, s7 순으로 정방향으로 1회전후 dir='0'일때 역방향으로 1회전하는 것을 볼 수 있다.
state0 에서
1. reset=1 이면 state0로 천이되고 motor_output는 “1000”으로 출력된다.
2. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1100“을 출력하고 state1로 천이
state1 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0100“을 출력하고 state2로 천이
state2 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0110“을 출력하고 state3로 천이
state3 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0010“을 출력하고 state4로 천이
state4 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0011“을 출력하고 state5로 천이
state5 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0001“을 출력하고 state6로 천이
state6 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1001“을 출력하고 state7로 천이
state7 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1100“을 출력하고 state0로 천이
state7에서
1. start_stop=1 이면 "1001"으로 출력된다
2. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1001“을 출력하고 state1로 천이
state6 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1000“을 출력하고 state2로 천이
state5 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1100“을 출력하고 state3로 천이
state4 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0100“을 출력하고 state4로 천이
state3 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0110“을 출력하고 state5로 천이
state2 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0010“을 출력하고 state6로 천이
state1 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0011“을 출력하고 state7로 천이
state0 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0001“을 출력하고 state0로 천이
[그림 3.3] Graphic Design
[그림 3.4] 생성한 1-2상 스테핑 모터의 Symblo
motor_output <= "0011";
when state5 =>
sig_state <= state6;
motor_output <= "0001";
when state6 =>
sig_state <= state7;
motor_output <= "1001";
when state7 =>
sig_state <= state0;
motor_output <= "1100";
end case;
// 1-2상 스테핑 모터 제어로 모터에 주어지는 펄스의 대응하여 회전량을 정확하게
// 얻을 수 있는 모터 이다
// 1-2상 방식은 첫 번째는 1개의 coil에 전류를 흐르게 하고 두 번째는 2개의
// coil에 전류를 흐르게 하여 모터를 구동하는 방법
// dir 이 ‘1‘일 경우 순차적으로 구동
else// dir='1'이 아닐 경우 수행
case sig_state is
when state0 =>
sig_state <= state7;
motor_output <= "1001";
when state1 =>
sig_state <= state0;
motor_output <= "1000";
when state2 =>
sig_state <= state1;
motor_output <= "1100";
when state3 =>
sig_state <= state2;
motor_output <= "0100";
when state4 =>
sig_state <= state3;
motor_output <= "0110";
when state5 =>
sig_state <= state4;
motor_output <= "0010";
when state6 =>
sig_state <= state5;
motor_output <= "0011";
when state7 =>
sig_state <= state6;
motor_output <= "0001";
end case;
// dir 이 ‘1’일 아닐 경우 역순으로 구동
end if;
end if;
end if;
end process;
end implementation;
3. 결과설명
[그림 3.1] Waveform Editor
소스 코딩후 검증을 하기위해서 [그림 3.1]과 같이 Waveform Editor창에서 입력 및 출력 신호를 정의한다.
우선 시물레이션을 하기위해 다음과 같이 클럭을 설정을 한다.
Grid Size(200ns)와 End Time(2.0us)를 설정
Clock : 50 ns
Data_Clock[0] : 100 ns
Reset : Count Value end time 100ns, Count every 50ns
Start_Stop : Count Value Start time 975ns, End time 1175ns, Count every 200ns
Dir : Count Value end time 825ns, Count every 825ns
[그림 3.2] Simulation
스테핑 모터제어 1-2상 방식은 첫 번째는 1개의 coil에 전율을 흐르게 하고 두 번째는 2개의 coil에 전류를 흐르게 하여 모터를 구동하는 방법으로 시물레이션 실행결과는 [그림 3.2]와 같이 dir='1'일때 s0, s1, s2, s3, s4, s5, s6, s7 순으로 정방향으로 1회전후 dir='0'일때 역방향으로 1회전하는 것을 볼 수 있다.
state0 에서
1. reset=1 이면 state0로 천이되고 motor_output는 “1000”으로 출력된다.
2. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1100“을 출력하고 state1로 천이
state1 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0100“을 출력하고 state2로 천이
state2 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0110“을 출력하고 state3로 천이
state3 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0010“을 출력하고 state4로 천이
state4 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0011“을 출력하고 state5로 천이
state5 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “0001“을 출력하고 state6로 천이
state6 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1001“을 출력하고 state7로 천이
state7 에서
1. reset=0 이고 motor_clock=1 이고 dir=1 일 경우 “1100“을 출력하고 state0로 천이
state7에서
1. start_stop=1 이면 "1001"으로 출력된다
2. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1001“을 출력하고 state1로 천이
state6 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1000“을 출력하고 state2로 천이
state5 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “1100“을 출력하고 state3로 천이
state4 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0100“을 출력하고 state4로 천이
state3 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0110“을 출력하고 state5로 천이
state2 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0010“을 출력하고 state6로 천이
state1 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0011“을 출력하고 state7로 천이
state0 에서
1. reset=0 이고 motor_clock=1 이고 dir=0 일 경우 “0001“을 출력하고 state0로 천이
[그림 3.3] Graphic Design
[그림 3.4] 생성한 1-2상 스테핑 모터의 Symblo