Page 2 - Important Notice; Copyright
Important Notice This guide is delivered subject to the following conditions and restrictions: This guide contains proprietary information belonging to Elmo Motion Control Ltd. Such information is supplied solely for the purpose of assisting users of the HARmonica servo amplifier. The text and graph...
Page 3 - Elmo HARmonica Software Manual
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 1 Table of Contents: 1 ABOUT THIS MANUAL ................................................................................................................................. 10 1.1 Scope ............................................
Page 10 - Harmonica
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 8 List of Tables: Table 2-1: Analog sampled signals .........................................................................................................................15 Table 3-1 – RS232 Rx Item Description ..............
Page 12 - About This Manual; documentation
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 10 1 About This Manual 1.1 Scope This specification presents relevant data for understanding and using the Harmonica software. The Software Specification complements the Command Reference Manual. The Command Reference Manual ...
Page 13 - The Harmonica; Organization
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 11 2 The Harmonica 2.1 Introduction The Harmonica a sophisticated and capable network-oriented single-axis amplifier, with: - State of the art control algorithms, including high order filters and gain scheduling - State of th...
Page 14 - Software; simultaneously, triggered by a selection of events.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 12 The personality data is loaded to the serial flash memory. The personality data includes a file allocation table and several files. The personality files include data about the Harmonica. A partial list is: List of support...
Page 15 - mechanical revolution.; Internal Units and Conversions; the electrical cycle to 1024.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 13 mechanical revolution. CA[23] For linear motors, CA[23] stores the number of counts per user unit (Meter, or any other unit the user may select). CA[23] is stored only for convenience – the Harmonica software does not use ...
Page 16 - Speeds are represented internally by the units of counts/(2; Hz; This section summarizes the set of Harmonica peripherals.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 14 The internal representation of phase currents is by A/D bits. Torque commands, and the active and the reactive parts of the current have another representation, since the coordinate transformations from phase current to to...
Page 17 - converter; The three phase currents, sampled simultaneously; Table; inputs
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 15 a decoder is 20mHz, without input filter. If input filter is applied, the maximum pulse rate is reduced, as explained at the EF[N] command in the Command Reference Manual. The encoder input is not protected. There is no ha...
Page 18 - Communication With the Host; Communications
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 16 3 Communication With the Host 3.1 General 3.2 RS232 Communications The Harmonica can communicate by RS232 with baud rates up to 115200baud/sec. The maximum baud rate depends in the sampling time. The baud rate of 115200bau...
Page 19 - Parameter value (Optional, if the command asks to report parameter); Echo
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 17 Sets the value of 1 to the MO variable. CA[2]=1; Sets the value of the CA[2] variable. CA[N] denotes a vector of parameters that can be accessed by their index. The free evaluation (5+sin(PX))*sqrt(abs(VX)) Returns a numer...
Page 20 - The Interpreter Language; • Command the Amplifier what to do
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 18 4 The Interpreter Language The amplifier has a language that enables the user to communicate with the Amplifier. Using this language, the user can • Setup the Amplifier • Command the Amplifier what to do • Inquire the Ampl...
Page 21 - The command line; Operator Description
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 19 4.1 The command line The Interpreter evaluates input strings, called “expressions”. An expression is a sequence of characters, terminated by a semicolon ‘;’, a line feed, or a carriage return. A command line may include th...
Page 22 - General rules for operators
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 20 + Add two operands. 9 - Subtract the right operand from the left one. 9 * Multiply two operands. 10 / Divide the left operand by the right one. 10 % Remainder after division two integers 10 ^ XOR 1 ~ Bitwise NOT of an oper...
Page 23 - Promotion to float and truncation to integer
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 21 4.2.4.1 Addition Notation + Description Arithmetic addition Number of arguments 2 Output type According to the section Promotion to float and truncation to integer Example 4+5=9 3.45+2.78=6.23 4.2.4.2 Subtraction Notation ...
Page 24 - NOT
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 22 Output type 32 bit long integer. Example if x=1 as x^3=2 4.2.4.7 Bitwise NOT Notation ~ Description Bitwise NOT Number of arguments 1 Output type 32 bit long integer. Example ~3 is 0xfffffffc, which is actually –4 ~3.2 is ...
Page 25 - Logical Less than
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 23 Notation > Description Logical greater than Number of arguments 2 Output type 0 or 1 (0 equals to false, 1 equals to true) Example if x=3 and y=3 as x>y yields 0 if x=3 and y=2 as x>y yields 1 if x=1 and y=2 as x&...
Page 26 - Logical NOT
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 24 Notation || Description Logical OR. The result is 1 if any of the arguments is nonzero, 0 if both are zero. The arguments are not truncated to integers before evaluations Number of arguments 2 Output type 0 or 1 Example 1 ...
Page 27 - Expressions
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 25 sin Sine Floating point cos Cosine Floating point abs Absolute value Same type as input argument sqrt Square root, or zero if argument is negative Floating point fix Truncate to integer. fix(3.8) is 3 fix(-3.8) is -3 Integ...
Page 28 - variables; User variables of User Programming Language; Built-in Function Calls; Mathematical Functions; functions
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 26 sp=sp*2/5+ac op=ip|5 If the variable or the command is a vector, the assignment is allowable only for its single member. The syntax of the vector member assignment is: <Parameter or command name>[index]=<simple ex...
Page 29 - User Function Calls; The XQ command enables a user function call. See
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 27 4.2.6.6 User Function Calls The XQ command enables a user function call. See Running of a User Program A user function cannot be called from the command line without the XQ command. 4.3 Comments Comments are texts that are...
Page 30 - The Harmonica User Programming Language; The Virtual; User Program Organization; A user program is organized as follows:; • An exit directive may be used to terminate the program.; • Commands concerning the execution of the user program.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 28 5 The Harmonica User Programming Language This chapter describes the Harmonica user language in detail. This chapter is somewhat out of place, since the user program language is not really a feature of the Harmonica. The H...
Page 31 - Line and Expression Termination
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 29 X=0; Initialize for k=0:10 Iterate X = x + 1 ; Do something end End of iteration exit End of program directive ##Moo ... More code The program defines two variables named x and k. ##Foo is an entry point. After compilation...
Page 32 - • Maximal length of user program text; Expressions And Operators; The number syntax is the similar to the Interpreter Language (see; Mathematical and Logical Operators; Operators of the Interpreter; General rules of the Interpreter
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 30 A user program may contain too long line and its representation at the screen may be not convenient, because not all symbols are shown at the screen. In order to improve readability of the program, a user may continue this...
Page 33 - details
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 31 5.3.4 Operator details The description and syntax is the same as in the Interpreter Language. See Operator details of the Interpreter Language 5.3.5 Mathematical functions The description and syntax is the same as in the I...
Page 34 - Automatic Variables; Commands
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 32 The names of variables may include ASCII letters, digits (not leading) and underscores (not leading) only. It’s case sensitive. The maximal variable name length is 12 characters. A variable name cannot be a keyword. The li...
Page 35 - BG; Built-in function call of the
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 33 Consider some examples using system commands. Example Explanation a = AC This expression assigns value of the system command AC to the variable ‘a’. This expression is valid if the AC command is allowed to ‘get value’, i.e...
Page 36 - Program Flow Commands
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 34 Comments are texts that are written into the code to enhance its readability. There are three methods to write comments. A double asterisk marks comments. The comment starts in a double asterisk comment marker, and termina...
Page 37 - The program start; iteration
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 35 wait : Iterate (suspend the execution of the program) until a specified time is elapsed. for - end : Iterate counted times break : Break an iteration or a switch expression (for, while, switch) if – else – elseif – end: Co...
Page 39 - Digital output 1 is OFF; int IsFirstFinished
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 37 Syntax: while( expression ) … statement … end The while keyword executes statement repeatedly until expression becomes 0. The expression can be logical or/and numerical. Note: expression may be within round parentheses or ...
Page 40 - ... Do some work ...; Wait 20 milliseconds; condition
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 38 … Do some work … IsFirstFinished = 1 ; **Signal that some work is completed The code of the second thread will include … Prior to suspension code until (IsFirstFinished) ; **The second thread suspended until **signal … Con...
Page 41 - selection
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 39 Example: if (IB[4]) PR=1000; PR=1000 only if digital input 4 is ON elseif(IB[3]) PR=5000; PR=5000 only if digital input 3 is ON elseif(IB[2]) PR=3000; PR=3000 only if digital input 2 is ON else PR=500; PR=500 only if digit...
Page 42 - definition; function
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 40 switch (k) For example, k=2 case 1 PA=1000; case 2 PA=2000; This statement will be performed otherwise PA=500; If k doesn’t equal to 1 or 2 , pa=500 end 5.5.8 Break Syntax: break The break statement terminates the executio...
Page 43 - function y1 = func5
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 41 For example, 2 function func2 (struct float x1) This function is named func2, it gets the only input argument of float type and doesn’t return any output. 3 [int y1] = func3 (int x1) This function declaration is illegal, b...
Page 44 - Dummy variables
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 42 y1 = x1; ** Function body y2 = x2; if x2 > 0 ** If block return ** return inside block is not the end of the function end ** End of if block y2 = y1 + y2 ; ** Some executable code return ** Function end Before function ...
Page 45 - Declare the global variables; Automatic variables
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 43 If some function does not return any output by its definition, then zero value as output will be inserted to the stack actually. Assume that the function foo is declared with no output arguments. So the following expressio...
Page 47 - Functions and The Call Stack
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 45 The goto command may be specified only for destinations within the present function scope. It is not possible to jump to labels that are inside another function. The jump to the global label from within some function is il...
Page 48 - →BG; return
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 46 Example: function factorial() ; **Function prototype … IA[1]=3 IA[2]=1 factorial() **Function call BG … function factorial() **Function for factorial global int IA[] ; **Definition of array as global inside function IA[2]=...
Page 49 - Killing The Call Stack; routine; subroutines
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 47 5.6.8 Killing The Call Stack In some rare situations, it is desirable to exit a function without returning to its return address. The reset instruction solves this problem by emptying the call stack before making a jump. S...
Page 50 - Function definition
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 48 according to system events. These routines will be executed only when their invocation condition is satisfied. These automatic routines doesn’t have output and input arguments. Syntax: There are two options to define an au...
Page 51 - Automatic Routines Arbitration; LOOP
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 49 AUTO_ I6 12 Called when a digital input #6 configured to the “GPI (General purpose Input)” function is activated. Refer the IL command. 4096 Table 5-1 – Automatic subroutines and their priority All the automatic routines, ...
Page 53 - Program Development and Execution; • Program editing – Writing\editing the program.; Editing a Program; User Partition of the; Compilation Error List
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 51 6 Program Development and Execution The process of program development includes the following steps: • Program editing – Writing\editing the program. • Compilation – Let the Compiler process the program and find errors • P...
Page 61 - Downloading and Uploading a Program
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 59 4. Attempt to jump to local label at ‘reset’ statement For example, function foo () ** Function definition … ** Function body return ** Function end … goto ##foo The last expression is illegal: foo is not label. 75 Illegal...
Page 62 - Binary data; The characters that are problematic to send on the RS232 lines are:; The Assisting Commands For Down/Upload
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 60 6.3.1 Binary data The Flash is interfaced with binary data. Sending binary data on the RS232 lines is a problem, since they complex the differentiation between data and delimiters. The characters that are problematic to se...
Page 63 - The CP command; • Set the program ready flag.; Downloading a Program
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 61 6.3.2.2 The CP command The CP command clears the entire user area in the serial flash. It may take a significant time. In special, CP sets the Program Valid flag to –1. Possible Execution Failures: 1) Motor is on. 2) Progr...
Page 64 - Verify that your image block will fit inside the allocated space.; Uploading a Program
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 62 In order to download a program image to the Dama, follow the steps below. - Read the location (loc) and the length (len) of the user code partition from the main TOC. For this, use the LP[3] and the LP[4] commands. - Verif...
Page 65 - Initiating a Program; the Functions and the Call Stack; Halting and resuming a program; task
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 63 6.4.1 Initiating a Program A program is initiated by the XQ command. The XQ command states at which label the execution shall start. The XQ command resets all the program variables. In particular, it clears the call stack ...
Page 66 - Automatic program running with power up
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 64 HP; XQ##TASK2; 6.4.3 Automatic program running with power up If the user program includes the autoexec function, the next program line after function declaration will be performed with powering up. 6.4.4 Save to Flash Sinc...
Page 67 - • set and remove break points; status
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 65 • set and remove break points • get information about existing VAC machines • get running status of the program • ask for or change a value of local variables • get call stack of the program The DB command is designed for ...
Page 68 - Setting and clearing break points
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 66 When any error occurs inside a specified VAC machine, it returns with error to the main loop that manages the running of the entire set of VAC machines. This manager stops all other VAC machines with the error ABORTED_BY_O...
Page 69 - Over; the start of the loop.; Step In
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 67 The treatment of Run to Cursor is very easy: the IDE sets at the relevant line fake break point with the number of repetitions as one. When a break point is reached, it has to be removed from the break point list. There is...
Page 70 - • End of the loop; Getting stack entries
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 68 • If the current base pointer is less than the saved base pointer, the step is out - jump to the end the loop, otherwise go to the start of the loop. • End of the loop When the nearest end of line is reached and the curren...
Page 71 - Return address; View of global variables; • Check the current status: if it is not halted, return error.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 69 BP-4 Return address Program counter of the next program line after the function call BP-3 Index of the current function in the Function Symbol Table See 3.5.5 BP-2 Number of input arguments BP-1 Number of actual output arg...
Page 73 - The Virtual Machines; Alla please complete where necessary
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 71 7 The Virtual Machines 7.1.1 Introduction Alla please complete where necessary The Harmonica can run a user program, as explained in the Chapter "The Harmonica User Programming Language". Although the user program ...
Page 74 - types
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 72 [x,y] = f (a,b,c,d) ; Assume that BP before function call is 12 and SP is 15 (just number not better and not worse than every other). Before the opcode USRSUBJ is executed the stack contains: 2. n entries for actual output...
Page 75 - INTEGER: 32 BIT SIGNED INTEGER; Op code structure and addressing modes; MEANING; reference
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 73 The virtual machine supports the following data types: - INTEGER: 32 BIT SIGNED INTEGER - Float: 32 bit IEEE floating point number (24 bit mantissa, 8 bit sign) Logical operators yield Boolean results – True or False. True...
Page 77 - → int; AND – Bitwise AND Operator
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 75 function table is given as an argument GET_COMM Call to function service of a ‘get’ command whose index in the function table is given as an argument SYSSUBJ Call to system function whose index in function table is given a...
Page 78 - → Int; CMP – Compare
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 76 Attributes Attribute Value Comment Op code May change in future versions Number of arguments None Argument types N.A. Both arguments types must be integer (set according to stack members flags) Addressing modes Absent Prom...
Page 79 - EOL – End Of Line; FORITR – FOR Loop Iteration; → step
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 77 flags Addressing modes Absent Promotion Int / Float Executes as (float) Int / Float Output type Int / Int → Int Int / Float → Float Float / Float → Float Imposes end of line No 7.7.5 EOL – End Of Line Purpose: Indicate thi...
Page 80 - F_OR – Bitwise OR Operator; GETINDEX
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 78 loop Addressing mode2 Mem_Direct , BP_Relative Iterator variable address, depend on the addressing mode. Promotion N.A. Output type N.A. Imposes end of line Only if jump address is out of the present executing line. 7.7.7 ...
Page 81 - GET_COMM – Get Command
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 79 DataSeg + Op1 → Arr (array address) (SP) → Ind (array index) Arr[Ind] → (SP) (return value) Attributes Attribute Value Comment Op code May change in future versions Number of arguments 1 Argument type Signed short integer ...
Page 82 - JMP_LABEL – Jump to the label; → Immediate value
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 80 PC → Immediate value Attributes Attribute Value Comment Op code May change in future versions Number of arguments 1 Argument type Signed short integer Jump Address Addressing modes Immediate2 Promotion N.A. Output type N.A...
Page 83 - JNZ – Jump Not Zero; JNZ_EOL – Jump Not Zero; PC
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 81 Promotion N.A. Output type N.A. Imposes end of line Only if jump address is out of the present executing line. 7.7.14 JNZ – Jump Not Zero Purpose: Jump to if value is not zero (change PC to different location in program). ...
Page 84 - JZ – Jump If Zero; JZ_EOL – Jump If Zero; LINK
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 82 the present executing line. 7.7.16 JZ – Jump If Zero Purpose: Jump to if value is zero (change PC to different location in program). Algorithm: PC → IMMEDIATE VALUE Attributes Attribute Value Comment Op code May change in ...
Page 85 - SP; MLT – Multiply
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 83 Purpose: Increase stack pointer with the value given as an argument and zeroes the new entries to stack. Algorithm: SP → SP + OP1 Attributes Attribute Value Comment Op code May change in future versions Number of arguments...
Page 86 - NOT – Bitwise NOT Operator; REM – Reminder
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 84 Attributes Attribute Value Comment Op code May change in future versions Number of arguments 2 Argument type1 Int or Float If argument is from stack, type is set according to stack member flag Argument type2 Int or Float A...
Page 88 - → SP – 1
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 86 7.7.25 RSLTAND – Logical AND Operator (&&) Purpose: If both numbers are non-zero condition is true. Otherwise it is false (numbers are at top two entries of the stack). Algorithm: (SP-1) && (SP) → (SP-1) SP...
Page 90 - SET_COMM – Set Command; → ArrayIndex; VAL
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 88 Addressing modes Absent Promotion N.A. Output type Int Compare result is always integer Imposes end of line No 7.7.30 RSLTOR – Logical OR Operator ( || ) Purpose: If one of the numbers or both are non-zero condition is tru...
Page 91 - SETINDEX; SHL – Shift Left
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 89 Imposes end of line No 7.7.32 SETINDEX Purpose: Set value to array variable defined in data segment. Algorithm: DataSeg + Op1 →Arr (array address) (SP) → Ind (array index) (SP –1) → Val (assign value) Arr[Ind] = val ; (ent...
Page 92 - SPADD
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 90 Shift left the number below top of stack by the number at the top of stack. Algorithm: (SP-1) << (SP) → (SP-1) SP → SP – 1 Attributes Attribute Value Comment Op code May change in future versions Number of arguments ...
Page 93 - SYSSUBJ – Jump To System Subroutine
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 91 Addressing modes Absent Promotion Int - Float Executes as (float) Int - Float Output type Int - int → int Int - Float → Float Float - Float → Float Imposes end of line No 7.7.37 SYSSUBJ – Jump To System Subroutine Purpose:...
Page 94 - USRSUBJ – jump To User Subroutine; → BP; USRSUBRT – Return from user subroutine
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 92 7.7.39 USRSUBJ – jump To User Subroutine Purpose: Call to user subroutine (push relevant function data to stack). SEE 8.2 Algorithm: BP → (SP) (save base pointer) SP → SP + 1 OP2 → (SP) (save return address) SP → SP + 1 Fu...
Page 95 - XOR – Bitwise XOR Operator
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 93 Attributes Attribute Value Comment Op code May change in future versions Number of arguments None Argument types N.A. Addressing modes N.A. Promotion N.A. Output type N.A. Imposes end of line Yes Jump address is out of the...
Page 96 - Recorder
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 94 8 The Recorder The recorder mechanism enables the user to record various signals that exist in the Harmonica, up to 8 signals simultaneously. The recorded signals can be uploaded to the host by communication, for the purpo...
Page 97 - mapping; Description
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 95 8.2 Signal mapping The recorder can record many different signals. The first 16 signals that may be recorded are compatible with older amplifiers. They are listed is in the table below. Signal ID Signal Name (Command) Leng...
Page 98 - Defining the set of recorded signals; TS
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 96 Integer revolution, with origin at the electrical angle of zero. 21 Filtered torque command Short The command to the Q current controller, at the output of the command filter. 45 Motor DC supply voltage Short Sample Motor ...
Page 99 - , the recorder will fail to record the; Trigger events and timing; Level 1
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 97 RG=1 means that a new sample shall be taken once per time quantum. If TS=60, and RP[0]=0, the recorder will sample once per 240usec. RG=2 means that a new sample shall be taken once per two time quanta. If TS=60, and RP[0]...
Page 100 - Figure 1 - Slope and window trigger types; RR
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 98 Figure 1 - Slope and window trigger types - Triggered by a digital signal: The Harmonica will support this only in the future, TBD. Trigger delay The trigger defines when the recorder is to start. The recorder can be told ...
Page 101 - Figure 2 – Pre trigger delay; reserved for future digital input trigger option.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 99 0 2 4 6 8 1 0 0 5 0 0 1 0 0 0 1 5 0 0 2 0 0 0 2 5 0 0 3 0 0 0 3 5 0 0 4 0 0 0 4 5 0 0 5 0 0 0 S p e e d C o m m a nd Ti m e Tri g g e re d o n B G w i th 0 % p re -tri g g e r d e la y Tri g g e re d o n B G wi th 2 0 % p ...
Page 102 - Launching the recorder; RR Value; RR Report; Uploading recorded data; Parameter Description
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 100 numbers. 8.6 Launching the recorder The recorder is launched (or killed) using the RR command. RR also reports the recorder status. The RR command has the following options: RR Value Meaning -1 Kill the recorder if active...
Page 104 - Byte Number; Byte
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 102 Byte Number Value Type 0-1: Variable type for user. This field does not have any practical significance. 0 for integer 1 for real Byte 2-3: Data width – number of hex character of a single transmitted data item. 4 for sho...
Page 105 - Commutation; Angle between the magnet and the field of the winding; Brush DC motors; Set to 1 for a DC motor; Stepper
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 103 9 Commutation 9.1 General The harmonica drives fixed magnet motors. The principle of all the fixed magnet motors is the same: A winding creates a magnetic field. If the magnet is directed along the field lines of the wind...
Page 106 - drawback is that normally; The BLDC commutation policy; away from the rotor; Mechanical and electrical motion; Figure 3: Two phased linear motor
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 104 In the stepper commutation policy, the windings field is set to point at the desired rotor position. The commutating device doesn't have to know where the rotor is – it just assumes that the rotor will come to rest at the...
Page 107 - sensors; Direct field sensors that sense the magnetic field of the motor.; Rotor Magnetic field sensors; Hall B
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 105 WS[20] Stator field angle, in 1024 counts/rev units. Stator field angle (deg) = WS[20] × (360/1024) WS[21] Commutation counter. WS[21] counts the main high-resolution position sensor, modulo CA[18]. 9.3 Commutation sensor...
Page 108 - d e g; Figure 6: Digital Hall sensors readout; Shaft Angle Sensors
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 106 H a ll A H a ll B H a llC 2 7 0d e g 3 3 0d e g 3 0 d e g 9 0 d e g 1 5 0d e g 2 1 0d e g 2 7 0d e g Figure 6: Digital Hall sensors readout The crude division to six draws rough torque from the motor, and requires hard sw...
Page 109 - Detecting commutation errors (loss of feedback); arrangements (known as
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 107 At that very instance the Hall sensors read the electrical angle accurately. After the first Hall sensor switch, the commutation is kept accurate by updating the commutation counter incrementally using the shaft position ...
Page 110 - parameterization
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 108 hardly noticeable in low speed, significantly looses motor torque at high speed. If Hall sensors are not present, and if the commutation is performed using an incremental encoder, then upon motor start the Harmonica must ...
Page 111 - search
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 109 full electrical cycles possible for that motor. Enter the "encoder counts in revolution" CA[18] parameter as the number of encoder counts for CA[19] electrical cycles. The encoder parameters are listed in the foll...
Page 112 - The frequency is; frequency; that frequency the phase angle; Method limitation; not accelerate significantly if no current is applied.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 110 microseconds, which is about 160Hz. The frequency is frequency basic 2 ] 15 [ CA ⋅ for CA[15] in the range [-4..4]. For example, with CA[15]=2 the frequency is about 40 Hz, whereas with CA[15]=-2 the frequency is about 64...
Page 114 - Figure 7: Loss of torque due to commutation miss; Two principal methods are used to keep
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 112 -1 00 -5 0 0 5 0 1 0 0 0 2 0 4 0 6 0 8 0 1 0 0 C o m m u t at io n m is s an g le, d e g ree s L o s t t orq u e , % Figure 7: Loss of torque due to commutation miss Two principal methods are used to keep θ ε near zero. T...
Page 115 - near zero continuously,; shapes; Torque; Figure 8: Winding shape function for a Trapeze motor
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 113 With continuous commutation all the three motor coils are powered simultaneously to yield a magnetic field exactly at the direction of the rotor. This brings θ ε near zero continuously, with minimal torque losses and ripp...
Page 116 - Figure 9: Winding shape function for sinusoidal motor; Loading the commutation table
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 114 Figure 9: Winding shape function for sinusoidal motor In order to optimize the Harmonica to as many motors as possible, the Harmonica can be programmed to any winding shape function. The Harmonica comes from the factory p...
Page 117 - 0 The current controller; Figure 10: Current controller structure
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 115 10 The current controller This section describes the current controller and its parameterization. In addition, it describes the current limiting process and the amplifier protections. The commands relevant to the current ...
Page 118 - IQ; VA
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 116 ) 240 ( h I ) 120 ( h I ) ( h I IQ c b a o o + θ + + θ + θ = and ) 330 ( h I ) 210 ( h I ) 90 ( h I ID c b a o o o + θ + + θ + + θ = Above, θ is the commutation angle and ) ( h θ is the input winding function. The output ...
Page 119 - is not enough to drive MC amperes into the motor. Do not specify; Figure 11: Peak/Continuous current limit selection
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 117 adapt to the specific amplifier model you bought. Units". Program PL[1] smaller then MC if you don't want to utilize the full power of the amplifier – because the amplifier is oversized with respect to the application...
Page 120 - MC; after the current demand has been zero for a long time, is -; log; The torque command filter
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 118 − − = MC CL PL ] 1 [ 1 log ] 2 [ τ With this selection, when PL[2] is set to MC, and after the current demand has been zero for a long time, the amplifier will permit a maximum of PL[2] seconds of peak current, ...
Page 121 - Torque command filter bandwidth =; XP; Hz where TS is the sampling time
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 119 Torque command filter bandwidth = 32768 ] 6 [ XP log TS 2 10 6 ⋅ π − Hz where TS is the sampling time in usec. The output of the filter cannot change in steps greater than XP[5]. The units of XP[5] are internal torque com...
Page 122 - Figure 13: Rate limiting for the torque input filter; The PI current controller; Figure 14: Current PI controller
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 120 0 2 4 6 8 1 0 1 2 1 4 1 6 0 50 0 1 0 00 1 5 00 2 0 00 2 5 00 3 0 00 3 5 00 4 0 00 4 5 00 5 0 00 C u rre n t C on t rolle r S a m p lin g Tim e s Am p To rq u e C m d V s . To rqu e C o nt rolle r In p ut XP [ 5 ] = 4 00 X...
Page 123 - Current amplifier protections; • Mapping the Motor Fault event to an event-driven CAN PDO.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 121 Feedback IQ ID Output VQ VD The saturation is given by 0.5TS/ 3 10 25 − ⋅ , where TS is the current controller sampling time in usec and 3 10 25 − ⋅ is the period of the 40mHz PWM generator clock in usec. The division of ...
Page 124 - model – please refer product user manual.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 122 model – please refer product user manual. Under Voltage 0x3000 The power supply is shut down, or it has too high output impedance. The under voltage threshold differs with the power stage model – please refer product user...
Page 125 - Modes; Torque control mode.; Torque control: Unit mode 1; • If hard-stop is active, the torque command is set to zero
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 123 11 Unit Modes The feedback structure of the amplifier can be arranged in several options. Those options are called "unit modes" and programmed by the parameter UM. Switching the unit mode is possible only with the...
Page 126 - Speed mode: Unit mode 2
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 124 11.2 Speed mode: Unit mode 2 In this mode the amplifier controls the motor speed by feedback. The speed controller demands torque from the current controller. The reference to the speed controller is summed from a softwar...
Page 127 - ST; T arg et speed; Figure 17 – Speed Profiling using JV, AC and DC
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 125 Command Description SF Smooth Factor: The time in milliseconds required to develop the full acceleration of AC and deceleration of DC. ST Stop command, activate profiler stop mode with Deceleration=SD VH[2] Maximum speed ...
Page 128 - Figure 18 – Speed command for different smooth Factor
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 126 Example: This example demonstrates the smoothing filter and the smoothing factor SF. Let us MO=1; JV=4000; AC=100000; DC=100000; SD=10 6 ; PM=1; RM=0; BG; with three different values of SF. 1. The SF=0 graph displays shar...
Page 129 - Figure 19: Auxiliary speed command generation; The stop manager does the following functions:; Figure 20: Speed mode Stop Manager
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 127 A u xilia ry in p u t A n a lo g in pu t 1 (-10 to 1 0 V o lts ) A G [2 ] C o u n t/s ec / V o lt Σ A u xilia ry s p e e d c o m m a nd Σ A S [1 ] ` - S p e e d e s tim a tor F R [2 ] Figure 19: Auxiliary speed command ge...
Page 130 - limiting the rate of reference change to SD counts/sec
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 128 limiting the rate of reference change to SD counts/sec 2 . When the Stop Manager stops the motor due to a switch action, the reference generator is replaced by a zero command at the input to the Stop Manager. The Stop Man...
Page 131 - The stepper angle command is generated by:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 129 The stepper unit mode enables the rotation of a motor without feedback control. The motor field is rotated to the desired direction, and the rotor magnet is believed to follow. The user must not rotate the field too abrup...
Page 132 - The block diagram of the dual feedback mode UM=4 is depicted below:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 130 • The commutation accuracy will be limited by backlash and gear compliance • The motor speed can be measured with better resolution and less delay because the motor rotates much faster than the load. In addition, the spee...
Page 133 - The position and the speed commands are generated by:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 131 The details of the speed and the position controllers are given in the chapter "Error! Reference source not found.". 11.5 The single feedback mode: UM=5 The single feedback mode is used when the same sensor is use...
Page 134 - 2 The position reference generator; • Software command generator; The software reference generator
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 132 12 The position reference generator The position reference signal is generated by the following components: • Software command generator • Auxiliary command generator • Stop manager. This section describes the components ...
Page 135 - Comparison of the PT and the PVT interpolated modes
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 133 is on. Care must be taken if the smooth factor (SF) is nonzero. Upon switching from interpolated motion to PTP or jogging, the PTP or the Jogging will start un-smoothed. Smoothing will gradually build up. After SF millise...
Page 136 - MS
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 134 MS Value Description 0 The position reference generator is idle. Moreover, the Motor position stabilized within the target radius for long enough time. 1 The position reference generator is idle, or the motor is off (MO=0...
Page 137 - sec; • Go to PA
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 135 The largest PTP motion available is XM/2 (or 30 2 if XM=0). This is since with modulo calculations, the PTP motion will always go the short way. For example, if XM=1000, the present position reference is 490, and the comm...
Page 139 - Figure 24 – PTP Decisions Flow Chart
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 137 S t a r t W i l l s t e a d y d e c e l e r a t i o n a t D C s to p m o ti o n b e f o r e ta rg e t ? S p e e d > S P ? S p e e d = S P ? Y e s N o Y e s A p p l y A C M a i n t a i n S P A p p l y D C A p p l y D C ...
Page 140 - Figure 25 – Jog Decisions Flow Chart
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 138 0 0 .0 5 0 .1 0 .1 5 0 .2 0 .2 5 0 .3 0 .3 5 -1 0 0 0 0 -5 0 0 0 0 5 0 0 0 0 0 .0 5 0 .1 0 .1 5 0 .2 0 .2 5 0 .3 0 .3 5 -4 0 0 -2 0 0 0 2 0 0 C o unts /s e c C o unts Ti m e (S e c ) Ti m e (s e c ) P o s i ti o n re fe r...
Page 141 - P o s i ti o n re fe re nc e
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 139 Jog motions can continue forever. The position reference jumps when it arrives the modulo boundary (+/-2 30 for XM=0 or +/- XM/2) but the speed is kept constant The parameters of Jog motion are summarized in the table bel...
Page 142 - PVT implements a 3
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 140 0 0 .1 0 .2 0 .3 0 .4 -2 0 0 0 0 2 0 0 0 4 0 0 0 0 0 .0 5 0 .1 0 .1 5 0 .2 0 .2 5 -2 0 0 -1 0 0 0 1 0 0 Ti m e (s e c ) Ti m e (s e c ) P o s i ti o n re fe re nc e P o s i ti o n Ta rg e t C o unts /s e c C o unts 12.1.6...
Page 143 - • The starting position and speed, denoted by P0 and V0, respectively; order interpolating polynomial:; VT; Example
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 141 The user provides, for each motion interval, the boundary positions and speeds. Mathematically, the user provides the following data: • The starting position and speed, denoted by P0 and V0, respectively • The end positio...
Page 144 - N o m i na l e lli p s e; m s e c
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 142 -4 -2 0 2 4 x 1 0 4 -4 -3 -2 -1 0 1 2 3 4 x 1 0 4 N o m i na l e lli p s e E lli p s e P V T p o i nts M o ti o n s ta rts a nd te m i na te s he re The next figure takes a closer look at the error between the true ellips...
Page 147 - Management; Parameter
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 145 The speeds in the table are limited to +/- 23 2 counts/second. The times in the table are in the range [1,255] msec. If the position feedback sensor counts modulo, the PVT data must be so that the range of the interpolate...
Page 148 - Figure 26 – PVT Decisions Flow Chart
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 146 Motion segment completed ? N >= MP[2]-1 Increment read pointer Read the N+1 row of the PVT table and calculate the parameters of the next motion segment Initial conditions: PVT read pointer equals N Interpolate positio...
Page 149 - Termination; The PVT motion terminates upon one of the following cases:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 147 A PVT motion is initiated by stating PV=N with 64 N 1 ≤ ≤ , and BG. The command PV=N sets the read pointer of the table to N and specifies that the next BG will start a PVT motion. BG starts the motion. The PVT table may ...
Page 151 - Figure 27 – PVT Auto Increment Mode Flow Chart
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 149 Motion segment completed ? N >= MP[2]-1 Increment read pointer Read the read pointer row of the PVT table and calculate the parameters of the next motion segment Initial conditions: PVT read pointer equals N Interpolat...
Page 152 - Parameters; What
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 150 12.1.6.5.2 Programming Sequence for The Auto Increment PVT Mode PVT motion must start with initial programming of the PVT arrays. Set MP[1] = First valid line in the PVT table MP[2] = Last valid array in the PVT table MP[...
Page 153 - Set a PVT motion command
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 151 Stop Deceleration (SD) The rate of deceleration in the case where motion is killed by queue underflow or by an exception. The rate off acceleration to catch up if PVT is started with bad initial conditions. Position/Veloc...
Page 154 - Reason Data
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 152 The following CAN emergencies are supported, all as manufacturer specific: Error code (Hex) Error code (Dec) Reason Data field 0x56 86 The queue is low: The number of yet unexecuted PVT table rows dropped below the value ...
Page 155 - Motion; T is the sampling time of the PT trajectory
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 153 12.1.7 PT Motion 12.1.7.1 What Is PT PT stands for Position-Time. In a PT motion, the user specifies a sequence of absolute positions to be visited by the Amplifier with equal time spaces. The time space must be an intege...
Page 157 - Cyclical behavior definition.; The command PT=N sets the read pointer of the QP vector to N.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 155 0: Motion is to stop if the read pointer reaches MP[2] MP[3] 1: Motion is to continue when the read pointer reaches MP[2]. The next row of the table is MP[1]. Cyclical behavior definition. MP[4] The number of controller s...
Page 158 - • The motor is shut down, either by programming MO=0 or by an exception.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 156 BG starts the motion. The QP vector may be written on-line while a PT motion is on, as long as you don't program presently executing PT elements. 12.1.7.5 Mode Termination The PT motion terminates upon one of the followin...
Page 159 - Figure 29 – PT Auto Increment Mode Flow Chart; Programming Sequence for The Auto Increment PT Mode
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 157 Motion segment completed ? N >= MP[2]-1 Increment read pointer Read the read pointer to the QP vector and calculate the parameters of the next motion segment Initial conditions: PT read pointer equals N Interpolate pos...
Page 161 - Reason; The External Position Reference Generator
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 159 MP[4] = Ratio between the command sampling time and the position controller sampling time MP[5] = Time for queue low alarm MP[6] = Initial value for write pointer WS[29] Sampling time, in microseconds, of the position con...
Page 162 - Figure 30: External position reference generator; Parameter Action
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 160 PTP or PVT. The position of the conveyer is not known in advance, and it must be measured on line, for example by using the auxiliary encoder input. The reading of the auxiliary input is scaled by the follower ratio (FR[3...
Page 163 - M o v in g c o n v e ye r; x m o to r m o ti o n c o m m a nd
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 161 Example: This example illustrates working on a moving object. Consider the application depicted below: X a xis Y a x is M o v in g c o n v e ye r C ak e C irc le to d ra w 1 0 0 0 0 In this application, an x-y stage draws...
Page 164 - As a result to IET the response may be:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 162 12.2.1 ECAM ECAM is an acronym for “Electronic Cam”. It means that the position reference to the Amplifier is not directly proportional to the summed external inputs, but is a function of them. The ECAM related commands a...
Page 165 - abl; Set 1000 counts at the input of the ECAM function for 1v of input
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 163 E C A M t abl e o u tput E C A M ta b le in p u t E M [3 ] E M [4 ] E T [3 ] E M [4 ] E T [1 ] E T [2 ] E T [4 ] E M [4 ] E M [3 ]+ 3 E M [4 ] Example: Suppose that we want the following functional relationship between th...
Page 166 - is equivalent to 1000 counts
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 164 is equivalent to 1000 counts EM[5]=1 First index of the table ET[1]=1000 ET[2]=2000 ET[3]=1000 ET[4]=2000 ECAM table values EM[1]=1 Activate ECAM. - For every input voltage less than 1v, the external position command will...
Page 167 - Dividing ECAM table into several logical portions
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 165 The initial programming of the Amplifier includes: EM[1]=1 Enable ECAM EM[2]=200 Length of the ECAM vector EM[3]=0 Starting position EM[4]=100 Conveyer encoder counts between two consecutive ECAM table entries ET[1]=…;ET[...
Page 168 - D ra w in g x -y m a n ip u la to r; C a m e ra s ta tio n; On the fly ECAM programming using CAN
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 166 C a k e D ra w in g x -y m a n ip u la to r s ta tio n N e xt c a k e C a m e ra s ta tio n C A N C a m e ra Assume that the amplifiers at the x-y manipulator station runs the ECAM table entries ET[1]...ET[100]. In the me...
Page 169 - Initializing the external reference parameters.; Analog gain
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 167 The elements to be programmed are specified by a “write pointer”. The value of the write pointer may be set by the parameter MP[6]. 12.2.4 Initializing the external reference parameters. This section details what happens ...
Page 170 - Figure 31: Print On A Moving Box Application; The Stop management; A switch stops the motion abruptly.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 168 The software command to the roller is set as point to point, to correct the roller position for the next arriving box. That way the printing is synchronized to the box. Figure 31: Print On A Moving Box Application At the ...
Page 171 - The maximum rate that the motor can accelerate/decelerate.; Figure 32: Stop Manager Block Manager
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 169 The commands relevant to the stop manager are: Command Description SD The maximum rate that the motor can accelerate/decelerate. IL[N] Input logic – define the functions associated to digital inputs. VH[N],VL[N] The maxim...
Page 172 - but with too great speed.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 170 This block stops the desired position reference to its present position if a hard-stop switch is sensed. Right Limit Switch (Marked as 3 in the Figure) This block stops the desired position reference to its present positi...
Page 173 - Figure 33: Position output of the stop manager; Figure 34: Speed output of the Stop Manager
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 171 0 0 . 5 1 1 . 5 2 2. 5 3 -8 -6 -4 -2 0 2 4 6 8 x 1 0 4 S e c C o unt s Figure 33: Position output of the stop manager 0 0 . 5 1 1. 5 2 2 . 5 3 -2 -1 . 5 -1 -0 . 5 0 0 . 5 1 1 . 5 2 x 1 0 7 S e c Coun ts /s ec Figure 34: S...
Page 174 - Modulo counting; YM
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 172 13 Sensors, I/O, and Events The Harmonica has two encoder inputs for feedback, commutation, and auxiliary reference generation. In addition, it has an analog input, Hall sensor inputs, and digital I/O. The digital inputs ...
Page 175 - The largest possible modulo is; Digital Outputs
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 173 RLS and FLS can be read by the user program and activate their corresponding automatic routines, but they do not affect the motion immediately. • The position referencing limits VH[3] and VL[3] become ineffective. ! If th...
Page 176 - The Harmonica identifies the following events
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 174 (AOK) indication, or brakes output. The association of output pins to functions is described in detail in the Command Reference Manual, the OL[] command. 13.4 Events, and response methods The Harmonica identifies the foll...
Page 177 - Deterministic delay:; Homing and Capture; Homing of the main position counter (PX) typically serves for:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 175 Host logics only. 13.4.3 Automatic routines Many events can be tied to automatic handler routines in the user program. To learn more about automatic user program routines, refer the section "Automatic subroutines"...
Page 178 - • Relative work in the dual-feedback position-control mode.; count; Homing the auxiliary encoder
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 176 • Absolute position control in the single-feedback position-control mode. • Relative work in the single-feedback position-control mode. For example, an axis in a machine may be homed by a sensor of the edge of the product...
Page 179 - On the fly position counter updates; so that the motion is unaffected by the position counter update.; A homing with home switch and index example
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 177 of PY, not PX. 13.5.4 On the fly position counter updates The updating of a position sensor during homing process has no effect in UM=1,2,3 since these modes do not use position feedback. The implications of position sens...
Page 180 - Figure 35 – Switches location; The following user program does the algorithm:
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 178 Figure 35 – Switches location The following user program does the algorithm: Note that the function above uses MI to prevent RLS from activating the AUTO_RLS routine. Another possible approach would be to use IL[] to chan...
Page 182 - Program Example 1 - Double Sided Homing.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 180 Program Example 1 - Double Sided Homing. 13.5.6 Capturing Capturing is a special case of homing, in which we program that the event will only register the counters value, but not affect motion and not update the position ...
Page 183 - • Bad or inconsistent setup data prevents motor starting.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 181 14 Limits, Protections, Faults, and Diagnosis This chapter discusses the limits and the protections implemented by the Harmonica. Limits are software restrictions that prevent the Harmonica from running into dangerous sit...
Page 184 - Command low limits for position and speed; limiting; The time constant of the low-pass filter is; , where MC is the maximum
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 182 VL[N] Command low limits for position and speed Table 14-1: Commands relevant to limits, protection, and diagnosis CAN users have an added protection level. The Harmonica issues Emergency objects in the case of errors or ...
Page 185 - Speed Protection; Over error protection.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 183 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 A p p li c a ti o n c urre nt d e m a nd m o to r c urre ntc o m m a nd F i lte r s ta te L C c urre nt li m i tInd i c a ti o n 14.2 Speed Protection The reference to the speed controlle...
Page 186 - Figure 36: Speed command and feedback limits; Position Protection
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 184 0 W it h in s p e e d c o m m a n d a n d f e e d b a c k lim i t s V L [ 2 ] V H [ 2 ] L L [ 2 ] H L [ 2 ] W it h in s p e e d f e e d b a c k lim it s , o u t o f c o m m a n d lim it s . A b o r t A r e a A b o r t A r...
Page 187 - Figure 37: Position command and feedback limits; Specify the largest ER[3] you can tolerate; switch; • If the motor is off, MO=1 will not start the motor
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 185 The position command and feedback limits are illustrated in the figure below. The amplifier normally operates in the area marked "Within command and feedback limits". It may, however, visit instantaneously the are...
Page 188 - switches; Connecting an electrical brake to a motor helps safety where:; Figure 38: Brake output connection; • The brake must be engaged when there is no current in the brake coil.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 186 attempts are made 10msec after the last motor shutdown, or 10msec after the last failure of MO=1. For safety reasons, we recommend to program the Inhibit function as "active low". That prevents incidental motor st...
Page 189 - Figure 39: Normal Brake Activation Timing; When the motor fails to start; The main reasons for failure to start the motor are:; Motion faults
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 187 M O B ra k e 1 R e le a s e d B P [2] B P [1 ] T im e (m s e c ) M o to r c on tro lle d to s to p M o to r c o ntro lle d to s to p M o tio n C om m a n ds N .A . A c c o rd in g to m o tion p ro g ram m in g N .A . Figu...
Page 191 - You can monitor motion faults by:; AOK
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 189 14.9 Diagnosis 14.9.1 Monitoring motion faults You can monitor motion faults by: • Continuously polling the amplifier status • Observing an "AOK" digital outputs. • Trapping CAN Emergency objects. The CAN Emergenc...
Page 192 - Sensor faults; • The motor average torque is high
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 190 • RM=1 with a modulo-counting position feedback. 14.9.3 Device failures, and the CPU dump Humans have programmed the Amplifier. The programmers, however hard they try, cannot completely avoid bugs in their code. Programmi...
Page 193 - Commutation is lost; Ke; Reasons and effect of incorrect commutation; does not change as a function of the motor position):
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 191 taken since almost every motion system applies high torques for short acceleration periods while the speed is slow. CL[2] defines the tested torque level as a percentage of the continuous current limit CL[1]. CL[3] states...
Page 194 - • Excessive noise on the encoder lines; . At this point, the current in the motor will not produce any torque.; Detection of Commutation Feedback Fault
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 192 In this situation, the direction of the stator field is constant, and if torque is commanded, the rotor seeks equilibrium, aligned to the magnetic field. If the motor is driven by an external speed or position controller,...
Page 195 - Controller; Notch filters for notching resonance.
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 193 15 The Controller 15.1 General This Section details the speed and position control algorithms. For many applications, the details of this document are of no concern. People do not have to understand the internals of a mot...
Page 196 - zx; Control
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 194 N=3: Outer loop gain (UM=4 and UM=5) KI[N] N=2: Inner speed loop Integral gain, I. KV[N] Coefficients for the high-order filter. The parameter KV[0] asserts if these filters are used at all – if KV[0] is zero, then the ad...
Page 197 - Figure 40 – A Block Diagram of the Speed Controller; The Parameters of the Speed Controller; BITS
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 195 D V [2 ] Σ S p e e d c om m a n d - T o rq u e c o m m a n d (D V [1 ], A m p ) S p e ed c o n tro lle r: K P ,K I H ig h o rd er filte r Σ F F [1 ] d /d t A u to m a tic C o n trolle r S e le c to r 0 F ixe d if G S [2 ]...
Page 198 - The Position Controller
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 196 The scheduled case is explained in the section on “Gain Scheduling”. The parameter GS[0] helps stabilizing the motion in very slow speeds. It cuts the proportional gain of the speed controller after enough controller samp...
Page 199 - Figure 41 – Block Diagram of The Dual Loop Controller; The Parameters of the Position Controller; PosFeedbac; CommandPI; sign; GS
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 197 D V [3 ] Σ P o s ition c o m m an d - S pe e d c o m m a n d (D V [2 ], A m p ) P o s itio n C o n tro lle r K P [3 ],G S [9 ] Σ F F [2 ] d /d t A u to m atic C o n tro lle r S e le c tor 0 F ixe d if G S [2 ]= 0 M a in P...
Page 200 - The High Order Filter; Block structure
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 198 For UM=5 the position feedback is taken from the main encoder. … All the parameters of the speed controller 15.4 The High Order Filter 15.4.1 Block Types Several blocks chained in series make the high order filter. The bl...
Page 201 - As
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 199 where α − α − β = 1 p , β − = 1 q , i.e. q − = 1 β , p 1 q 1 − − = α . Order Parameter Description Comment 1 p Float, represented by 2 long values 2 q Float, represented by 2 long values 15.4.1.3 Second order block (Block...
Page 202 - Interface
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 200 For more details about gain scheduling, refer the section " The Gain-Scheduling Algorithm". 15.4.2 User Interface The parameters defined by an array of long integer values set by the KV command. If KV[0]=0, high o...
Page 203 - The Gain-Scheduling Algorithm; DoubleLeadBeta
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 201 KV [0] 100 KV[1] 19 Last index used KV[2] 15 1 st block, 2-order KV[3] 1734476372 Parameter 1 (k1), man KV[4] -32 Parameter 1 (k1), exp KV[5] 1480626866 Parameter 2 (k2), man KV[6] -32 Parameter 2 (k2), exp KV[7] -1592218...
Page 204 - Automatic Controller Gain-Scheduling; Saturate speed command; where
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 202 Table 15-3: Programming sets of controller parameters for gain schedulilng Only a subset of the controller parameters can be schedualed. The KG[] parameters can program sets of KP,KI gains, as well as one scheduled double...
Page 205 - Get the gains; Range
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 203 commands are accepted slowly to guarantee stability. Limit the schedulink below Y = max (Y , MinSpeed) Get the index to the gains table by interpolating the indexing function ] 15 [ GS / ]) 15 [ GS mod 16 / Y ( q ] 4096 /...
Page 206 - 6 Appendix A: The Harmonica Flash Memory Organization; partitions; The flash has four main partitions at the following order.; The firmware partition; unsigned short; Name
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 204 16 Appendix A: The Harmonica Flash Memory Organization This Appendix describes the internal partitioning of the internal serial Flash memory of the Harmonica. For normal use of the Harmonica, you don’t need to read this a...
Page 207 - Contents of Text1; Contents of Text3; Unused memory space for possible later use
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 205 Start of Text1 unsigned short 0 Length of Text1 unsigned short 2 Start of Text2 unsigned short 4 Length of Text2 unsigned short 6 Start of Text3 unsigned short 8 Length of Text3 unsigned short 10 Start of Text4 unsigned s...
Page 208 - Contents of Text4-Text7
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 206 16.2.5 Contents of Text4-Text7 This text specifies which op-codes a specific the Harmonica supports, and also the limitations: Size of available flash space (may vary with Harmonica grades), size of data segment in RAM, m...
Page 209 - Contents of Text8
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 207 0x20 Not used 0x40 FLAG_Assign System parameter can be assigned a value 0x80 Not used 0x100 FLAG_Operator Virtual Assemby Code or operator 0x200 FLAG_SysFunc System function 0x400 FLAG_Mnemonic System command - Mnemonic 0...
Page 211 - To be read by the reset procedure to UserPars
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 209 If the priority is –1 if the Harmonica can’t service this function. 16.2.8 Contents of Text10 This file lists all the possible run-time errors of a specific Harmonica, including their codes. Text10 has the following forma...
Page 212 - • A virtual machine code segment; TOC
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 210 The user code partition can be read by the LS command. The data in this partition is: • A TOC (Table of Contents) • A "Compilation done" flag • A virtual machine code segment • A text backup segment. The text back...
Page 213 - error; The Virtual Machine Code Segment; Any general comment.; The Function Symbol Table; Number of functions in the table (signed short)
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 211 If the compilation flag is zero, program is ready. Other values indicate not ready program. The command CP sets the compilation flag to –1. The Compilation Flag is checked when: • DL command – If the flag is zero, DL will...
Page 214 - The Variable Symbol Table; Number of variables in the table (signed short); The Automatic Routines Table
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 212 16.5.6 The Variable Symbol Table The variable symbol table states what variables are accessible through the user program. Its first 34 bytes of the variables symbol table is devoted to statistics: - Number of variables in...
Page 215 - 7 Appendix B: Harmonica Internals; Software Structure
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 213 17 Appendix B: Harmonica Internals This chapter summarises some of the Harmonica internals. The chapter to give some deeper insights. It is not required for the standard Harmonica user. 17.1 Software Structure The firmwar...
Page 217 - Figure 42: Idle loop
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 215 R e a d a n y a d d itio n al c h a rs fro m R S 23 2 b u ffe r M e s s a g e c o m p le te d ? R o u te m es s a g e to in te rp re te rr L o n g R ec o rd in tra n s m is s io n ? P re s e n t b u ffe r d o ne ? L a s t...
Page 218 - 8 Appendix C: Converting Clarinet/Saxophone programs to; The Converter; The converter program does the following:; The Conversion Process; Saxophone/Clarinet Harmonica
Elmo HARmonica Software Manual P R E L I M I N A R Y D R A F T HARSFEN0602 216 18 Appendix C: Converting Clarinet/Saxophone programs to the Harmonica language 18.1 The Converter The user program syntax for the Saxophone or Clarinet is different from the Harmonica’s syntax. The converter program prov...