초보의 아웅다웅 설계하기/Motor

IMS MOTOR - MDRIVE

로망와니 2013. 4. 23. 11:03

 

MCode.pdf

IMS_Term.zip

 

bd=38 ' boud rate 설정 38400
em=1 ' echo 모드 0이면 다 응답, 1이면 crlf만 리턴
dn="2" ' 모터에 ID 부여
2ma 0 ' 모터 절대 포지션값으로 이동

2mr 1000 '모터 상대 포지션값으로 이동
er 0 'error 코드값 초기화
pr er 'error 값 확인
pr mv ' 모터가 동작중인지 확인
pr mp ' 모터가 위치까지 가는 중인지 확인

ee=1 '인코더 인에이블
S1=0,0 'set IO1 to gen. purpose input, active LOW,‘sinking, 소싱(sourcing): Device에서 밖으로 내는 출력전류.( - 로 표기), 싱킹(sinking): 밖에서 Device안으로 흐르는 전류.( + 로 표기)
Ms=256 'set μstep resolution to 256 μsteps/step 1, 2, 4, 8, 16, 32, 64, 128, 256
Vi=200000 'set initial velocity to 200000 steps/sec vm보다 낮은 값을 설정해야함.
Vm=2500000 'set max velocity to 2500000 steps/sec
A=1000000 'set acceleration to 1000000 steps/sec2 가속 설정
D=A 'set deceleration equal to acceleration 감속설정
Hc=2 'set motor holding current to 2% 홀딩전류 설정
Rc=75 'set motor run current to 75% 동작전류 설정
P=0 'set position counter to 0

PR P '현재 위치 확인


O2=1 ‘Set output 2 ACTIVE '아웃풋 설정

 

PR I2 ‘Prints the logic state of input 2 ' 인풋 확인
BR 128,I3=1 ‘Cond branch to address 125, Input 3 ACTIVE
CL K9, I4=0 ‘Call subroutine K9, Input 4 INACTIVE

 

st=0 '스톨플래그 초기화
pr st '스톨이 걸렸는지 확인

 

모터에 라벨링을 해도 ma로 부르면 응답하는 부분 의문?

->모터 아이디를 지정하시면 지정하는 모터만 응답을 합니다. 예로 A모터로 셋업 되어 있을경우 AMA를 쓰셔야 합니다.
sl을 사용하는 경우?

-> SL 명령어는 조그기능이라 보시면 됩니다. 초당 펄스를 입력하는 명령어로 입력이 들어가는 한 일정한 속도로 회전을 합니다. 정지 명령 즉 SL 0외에 멈추는 명령어가 들어오기 전까지 회전합니다.
py설정은 모터가 2개 이상 있을 때만 사용할 수 있는 설정인지? 없을때는 응답이 없음.

-> PY 설정은 1개의 모터만 있을때 도 가능합니다. PY 설정은 다축 연결시를 위한 셋업이지만 한개의 모터만 셋업후 PY모드 후의 프로토콜만 맞춰 주면 PY 설정 전과 동일하게 동작을 합니다.

-> 설정된 축이외에 다른 id를 부르면 멈추는 현상이 발생 CTRL+J를 눌러줘서 초기화가 필요함.

 

BR => GOTO문

CL => CALL문

CP => CLEAR PROGRAM

E => END PROGRAM

EX => 프로그램 실행

H => 모션 실행이 완료될 때까지 일시중단

H 2000 => 2초간 대기

LB START=> START로 위치 라벨링

PG => 프로그램 모드 시작과 끝에 작성 PG 1 .... PG

RT => 서브루틴 리턴

S => 세이브

SF 20 => 스톨팩터 20번 걸리면 멈춤

C1 => 포지션 카운터

C1=20000 ‘Set counter 1 to 20000 motor steps
PR C1 ‘Print the value of C1 to the terminal screen
CL K5,C1>2100000 ‘Call subroutine K5 if C1>2100000

C2 => 포지션 카운터

C2=512 ‘Set counter 2 to 512 counts
PR C2 ‘Print the value of C2 to the terminal screen
CL K5,C2>2100000 ‘Call subroutine K5 if C2>2100000

HM 1 => 홈 위치 찾아 가는 방법 설정 Home to home switch

ES (Escape) => 정지 방법 설정 ESC 또는 CTRL+E

EX => 프로그램 실행

 

VA => 변수 생성

VA Q3 'Create user Variable Q3
VA Q3=20000 'Create user Variable Q3, set to 20000

 

 

R1-R4유저 레지스터

R1=50000 ‘Set Register 1 to 50000
R2=Q2 ‘Set Reg. 2 to the value of User Variable Q2

 

fd '팩토리 리셋 'boud rate 값은 알고 있어야 리셋이 가능
py=1 '파티모드 인에이블
LB SU 'su로 라벨링된 부분은 전원을 켜면 자동으로 실행됨.

 


error 코드표
6 An I/O is already set to this type. Applies to non-General Purpose I/O.
8 Tried to set an I/O to an incorrect I/O type.
9 Tried to write to I/O set as Input or is “TYPED”.
10 Illegal I/O number.
11 Incorrect CLOCK type.
12 Illegal Trip / Capture
20 Tried to set unknown variable or flag. Trying to set an undefined variable of flag. Also
could be a typo.
21 Tried to set an incorrect value. Many variables have a range such as the Run Current
(RC) which is 1 to 100%. As an example, you cannot set the RC to 110%.
22 VI is set greater than or equal to VM. The Initial Velocity is set equal to, or higher than
the Maximum Velocity. VI must be less than VM.
23 VM is set less than or equal to VI. The Maximum Velocity is set equal to, or lower
than the Initial Velocity. VM must be greater than VI.
24 Illegal data entered. Data has been entered that the device does not understand.
25 Variable or flag is read only. Read only flags and variables cannot be set.
26 Variable or flag is not allowed to be incremented or decremented. IC and DC cannot
be used on variables or flags such as Baud and Version.
27 Trip not defined.Trying to enable a trip that has not yet been defined.
28 WARNING! Trying to redefine a program label or variable. This can be caused when
you download a program over a program already saved. Before downloading a new
or edited program, type <FD> and press ENTER to return the device to the Factory
Defaults. You may also type <CP> and press ENTER to Clear the Program.
29 Trying to redefine a built in command, variable or flag.
30 Unknown label or user variable. Trying to Call or Branch to a Label or Variable that
has not yet been defined.
31 Program label or user variable table is full. The table has a maximum capacity of 22
labels and/or user variables.
32 Trying to set a label (LB). You cannot name a label and then try to set it to a value.
Example: Lable P1 (LB P1 ). The P1 cannot be used to set a variable such as
P1=1000.
33 Trying to SET an Instruction.
34 Trying to Execute a Variable or Flag
35 Trying to Print Illegal Variable or Flag
36 Illegal Motor Count to Encoder Count Ratio
37 Command, Variable or Flag Not Available in Drive
38 Missing parameter separator
39 Trip on Position and Trip on Relative Distance not allowed together
40 Program not running. If HOLD (H) is entered in Immediate Mode and a program is not
running.
41 Stack overflow
42 Illegal program address. Tried to Clear, List, Execute, etc. an incorrect Program address.
43 Tried to overflow program stack. Calling a Sub-Routine or Trip Routine with no Return.
44 Program locked. User Programs can be Locked with the <LK> command. Once
Locked, the program cannot be listed or edited in any way.
45 Trying to Overflow Program Space.
46 Not in Program Mode.
47 Tried to Write to Illegal Flash Address
48 Program Execution stopped by I/O set as Stop.60 Not used
61 Trying to set illegal BAUD rate. The only Baud Rates accepted are those listed on the
Properties Page of IMS Terminal. (4,800, 9,600, 19,200, 38,400, 115,200)
62 IV already pending or IF Flag already TRUE.
63 Character over-run. Character was received. Processor did not have time to process
it and it was over-written by the next character.
64 Startup Calibration failed (Hybrid only)
70 FLASH Check Sum Fault
71 Internal Temperature Warning, 10C to Shutdown
72 Internal Over TEMP Fault, Disabling Drive
73 Tried to SAVE while moving
74 Tried to Initialize Parameters (IP) or Clear Program (CP) while Moving
75 Linear Overtemperature Error (For units without Internal Over Temp)
80 HOME switch not defined. Attempting to do a HOME (H) sequence
but the Home Switch has not yet been defined.
81 HOME type not defined. The HOME (HM or HI) Command has been
programmed but with no type or an illegal type. (Types = 1, 2, 3, or 4)
82 Went to both LIMITS and did not find home. The motion encroached
both limits but did not trip the Home switch. Indicates a possible bad
switch or a bad circuit.
83 Reached plus LIMIT switch. The LIMIT switch in the plus direction
was tripped.
84 Reached minus LIMIT switch. The LIMIT switch in the minus direction
was tripped.
85 MA or MR isn’t allowed during a HOME and a HOME isn’t allowed
while the device is in motion.
86 Stall detected. The Stall Flag (ST) has been set to 1.
87 MDrive In Clock Mode, JOG not allowed
88 MDrive Following error
89 MDrive Reserved
90 Motion Variables are too low switching to EE=1
91 Motion stopped by I/O set as Stop.
92 Position Error in Closed loop. motor will attempt tp position the shaft
within the deadband, After failing 3 attempts Error 92 will be generated.
Axis will continue to function normally.
93 MR or MA not allowed while correcting position at end of previous
MR or MA.

'초보의 아웅다웅 설계하기 > Motor' 카테고리의 다른 글

IMS MDRIVE 동작  (0) 2013.04.23
IMS Terminal 사용법  (0) 2013.04.23
아스키 코드표  (0) 2013.04.23
TMCL - Module Address 변경하기  (0) 2012.06.14
TMCL 사용법  (0) 2012.04.18