TRIO Basic
Example Trio program to run EtherCAT Homing on the remote drive (0x6060 = 6)
The attached program can be adapted to run drive homing on the Motion Coordinator if it is not possible to do the homing in the controller using DATUM. See the EtherCAT specification for drive homing mode in CiA402.
Trio - Modbus TCP Client
The Trio firmware can open a Modbus Client port and communicate with any Modbus Server. Port number is usually 502. You need to have the document from the slave vendor that lists the register numbers in the Modbus connection of the device. Probably ...
Load firmware and encrypted project from SD card
Put the firmware on an SD card and the encrypted project in the root directory. Then it needs a script in TRIOINIT.BAS on the SD card: IF INT(VERSION * 10000) <> 20304 THEN FILE "LOAD_SYSTEM" "MC405_20304" PROJECT_KEY "MyKey" FILE ...
EtherCAT Axis Types and Feature Enable
ATYPE is usually set automatically when the EtherCAT starts, depending on slave type and DRIVE_MODE in MC_CONFIG. 65 EtherCAT position 66 EtherCAT speed 67 EtherCAT Torque 68 EtherCAT Open Speed- No Feature code required 69 EtherCAT Reference Encoder ...
Set and Clear bits in TABLE values (Function)
Here are 2 functions to set and clear a bit in a given TABLE value. ' functions to set and clear bits in TABLE FUNCTION set_table_bit(index, bit AS INTEGER) DIM pattern AS INTEGER pattern = 1 << bit TABLE(index, TABLE(index) OR pattern) ENDFUNC ...
Will processes change with Motion Perfect 5?
Process numbering is controlled entirely by the firmware so nothing should change when you update Motion Perfect. For example, process numbers for MC405 are 0 to 9.
CPU Processing time
You can make things more efficient if you make sure a BASIC program never waits on WAIT UNTIL. WAIT UNTIL a=0 AND b=2 AND c=3 will keep the process runing in its slot. REPEAT WA(10) UNTIL a=0 AND b=2 AND c=3 will put the process to sleep while ...
XY single belt (FRAME=2) Homing?
This frame is very simple. X movement causes axes 0 and 1 to move in the same direction. Y movement causes axes 0 and 1 to move in opposite directions. In FRAME 0 you can make a move in X by MOVE(distance, distance) You can make a move in Y by ...
Is there some method to use a .dll into MC4N-ECAT?
You cannot import a DLL into the MC4N-ECAT. It has a BASIC compiler and IEC-61131-3 Compiler. The Operating System is a special Trio designed OS with large motion library. If you connect a PC to the MC4N-ECAT using Ethernet, then you can install a ...
Trio Motion Coordinator MC403 sudden axis status error
Q: We always come up with “Axis Status: Error” and the active status flag is W (1) – Following error warning range and motor stops nearly instantly with E (8) – Following error exceeds limit. How can we solve it? A: With SERVO=OFF, can you make the ...
MOVEADD example
The attached Motion Perfect project contains a program that demonstrates the MOVEADD command used on 3 move types. 1. Constant speed axis using FORWARD that is modified by MOVEADD 2. MOVEABS with modifying MOVEADD 3. MOVELINK with modifying MOVEADD
MC_CONFIG vs Flash parameters
All Motion Coordinators store the IP_ADDRESS, IP_NETMASK and IP_GATEWAY in Flash memory. So there is usually no need to add them to the MC_CONFIG. There are some differences with other system parameters. MC4N-ECAT, MC4N-RTX, MC6N-ECAT, Flex-6 Nano ...
What is the accuracy on the UNITS / REP_DIST?
Q: What is the accuracy on the UNITS / REP_DIST? UNITS = 2^23*3/360 ' Counts/deg REP_DIST = 180 ' deg REP_OPTION = 0 ' [-REP_DIST..REP_DIST] As UNITS is approx. 69905.0667 then what will happen when I have run the system for ...
What does SERVO_OFFSET do?
SERVO_OFFSET is a system parameter that is usually set by the operating system. The value depends on the SERVO_PERIOD, the modules fitted (to a MC664X) and the model of Motion Coordinator. It should not be necessary to set this in a system. Only ...
Is it possible to create a directory on the SD card using a variable?
Yes it is. ' create a new directroy on the SD card DIM dirname AS STRING(20) dirname = "folder1" FILE "MD" dirname folder_number = 3 dirname = "Folder" + STR(folder_number, 0) FILE "MD" dirname dir d Volume is MCCARD Volume Serial Number is ...
Encoder_ratio / Step_ratio
I have a problem setting high STEP_RATIO values. Answer: There is a ratio limit on the step ratio of 100:1 STEP_RATIO(-12600, 126) is OK but any higher ratio will give the error. Using a high ratio like the above is actually not a good idea. You are ...
CHANNEL_WRITE
How do I write axis variables or VR integer values into the channel? Like this? CHANNEL_WRITE(tcpserver_channel, " " + TIME$ + " " + CHR(VR(0)) + " " + CHR(VR(1)) ) Answer: No, the CHANNEL_WRITE needs to have a string as the data to write. ...
Z Marker Failure
Want a timout if the DATUM command fails to find the sensor or the Z. We don't have anything built in to the DATUM command itself. You could make 2 separate DATUM commands, one for the swtich and then one for the Z. Add a timeout to each one. ...
Live accel param from trajectory interpolator
If you need a parameter for acceleration that is equivalent to the VP_SPEED parameter for speed. There is a VP_ACCEL axis parameter that is available when the correct VP_MODE is used. It is always 0 in the nomral default mode. Set VP_MODE = 5 (It is ...
Closed loop using EtherCAT Analogue I/O
Can I use the Flex-6 Nano with Analogue input (AIN) as feedback and Analogue output (AOUT) controlling a hydraulic valve? Yes, ATYPE=31 supports this – use AXIS_ADDRESS bits 0..7 for the AIN channel number and AXIS_ADDRESS bits 8..15 for the AOUT ...
Ethercat PDO Comms Fail on Power-up with Yaskawa Sigma 7
MC6N, 2 machines behave the same. They came up with Unit error, System error and axis status errors. Yaskawa Sigma 7 shjows A12 error. Set AUTO_ETHERCAT = 0 and start from the MAIN program after a time delay with ETHERCAT(0, 0) e.g. WA(20000) ' 20 ...
ABB Drives
We found on some applications that the ABB drives work better when the first drive in the network is the Distributed Clocks master. Our default is that the controller is master. The ETHERCAT command function $93 is described thus: Function $93: ...
Fast EtherCAT start up.
The fast startup is done with ETHERCAT(0,0,5). It means the master does not wait for the drives to be in sync before going operational. The drives will still take the same amount of time to get in sync so you should delay doing any actual moves until ...
Info about PSWITCH
The PSWTICH is processed every servo cycle, so at 2 msec SERVO_PERIOD it will be accurate to within +/- 2msecs. HW_PSWTICH requires hardware that monitors the encoder counter. It is only possible to use on the built-in encoder of the MC664(X), the ...
UNITs vs Arcs question
In and XY motion system, if you make only linear lines, it does not matter if X and Y UNITS are not the same. But the MOVECIRC and MHELICAL must have the UNITS on X then same as UNITS on Y, otherwise they produce elipses and not circular arcs. The ...
Trouble with table
In the MC2xx range of Motion Coordinators, the TABLE is dynamic and the memory shared with the programs. When you first use it, there is no table. TABLE is allocated when it is written tot. You can see the size with TSIZE parameter. If a program ...
A Trio BASIC Function Library for calculating min, max and average
The attached library has 10 functions; result = compare_2(v1, v2) preset_max(index, value) preset_min(index, value) compare_max(index, value) compare_min(index, value) value = read_max_register(index) value = read_min_register(index) And for the ...
Motion Perfect terminals - cursor control
From Motion Perfect v4 version 4.4.1 onwards, the terminals 0, 5, 6 and 7 support a sub-set of the VT100 cursor control codes. These are in the form of escape sequences starting with the <ESC> code ASCII code 27 ($1B in Hex) Currently supported ...
Gathering analog input data using Flexslice Ain Module
A Visual Studio program connecting over Ethernet will not be deterministic. So there will be timing errors. The built-in SCOPE command can be used to log data. It will save data to TABLE at the servo cycle rate. So if SERVO_PERIOD is 1000 usec, then ...
Error Compensation in CSP Mode
COMPENSATE_XY in the axis with the following table puts +/- 10 compensation on the axis as it moves. The table has these values: TABLE(0, 0, -10, 10, -10, 10, -10, 10) The COMPENSATE_XY takes the length that is put in the command and divides it into ...
CONNECT command
Question: I use the CONNECT command and when I change the ratio the encoder slave doesn't move in the axis. I see the pulses of the master encoder move. This is the code: BASE(0) ' slave (following) axis SERVO = ON UNITS = 4000 DEFPOS(0) BASE(2) ' ...
Moves not getting to position
We have an odd situation with an MC4N running EtherCAT drives. The issue is that axis 1 is not getting to the commanded position via MOVEABS. The command MOVEABS is where we are hanging because the move seems to cancel. We did a the test with all ...
Timed ramps and dwells - a FUNCTION example
Functions to make timed position ramps and dwells. For example as might be used in a blow moulding controller. ' Function library to support timed ramps ' 'Declare a universal value to hold the table index DIM tab_index AS INTEGER ' Set up a linear ...
Parsing text srring from Hex to a value
Change a Hexadecimal String to a value using the BASIC Function Library. ' Function to convert a HEX number string to a value ' Call: hex_to_val(hex_string, string_size) ' e.g. x = hex_to_val("38E38D", 6) ' FUNCTION hex_to_val(hex_string AS STRING, ...