8.4 Follow process
1 Preparation
This operation manual is applicable to drive and control integrated HCRobot-HC-QC-RX-2.0.2.7-BRT
Before using the follow process, prepare the related components
5、Photoelectric sensor switch (conveyor line + signal follow);
6、Industrial camera (conveyor line + visual follow);
7、Switchboard (conveyor line + visual follow);
8、CAN encoder (currently only support BRITER CAN encoder). Note: Currently support RS485 communication analog module and CAN encoder [Please refer to the download link of CAN encoder: https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002- 21162664448.13.3c4c5e52jfTW2f&id=585418110537]
2 Component connection Refer to the corresponding port instruction manual for connection
2.1 Connection of RS485 communication analog module, CAN encoder and others to host CAN port

2.2 Double follow CAN encoder connection
Note:
3 、A 120Ω termination resistor must be connected in parallel between CANL end and CANH end of encoder for single follow; a 120Ω termination resistor must be connected in parallel between CANL end and CANH end of two encoders respectively for double follow; otherwise, communication will not succeed;
4 、For BRITER encoder, white line corresponds to Pin 1; green line corresponds to Pin 2; 24V single-ring encoder baud setting is 500kbps.
2.3 Industrial camera communication wire interface
Camera communication wire interface Encoder interface
Camera communication wire is connected to host monitor port, and ways of connection on the camera side are different for different brands. Refer to Camera Manual

3 Follow parameter setting and instruction steps
3.1 CAN Settings
After the encoder wire is properly connected, switch the key of the demonstrator to the stop location, and carry out operation in the sequence shown in the figure below:
Login permission → Settings → Product Settings → CAN Settings → CAN use to Encoder → ID config 0→ Baud Setting selected to 500kbps → power off and restart.

3.2 Description of follow parameters
3.2.1 Description of encoder parameters

14 TF En: After it is ticked, the system starts to read the encoder value;
15 Follow type: linear, conveyor whose follow path is a straight line; rotary, conveyor whose follow path is a circle.
16 Precision: namely encoder bits Precision confirmation method: precision is n, and encoder resolution = 2^n, e.g. for an encoder with resolution of 1,024, 2^n=1024 according to formula, if n=10, encoder precision is 10bit.
17 Feedback delay: tracking error caused by conveyor belt speed deviation or encoder sampling deviation during tracking, The precision is compensated by this value, the range is set to 0~2 s;
18 Count Reverse: after it is ticked, the encoder direction will be changed (Note: The encoder value must be continuously increasing during running);
19 Start offset: The offset from sensor log point to P0 (Unit: pu (pulse)). Start offset setting method: Put the product on the signal off position of the sensor, attach a marker to the product, and click Log A → start the conveyor belt → the product flows into the running range of the robot → stop the conveyor belt → click "Log B" → calculate, the computed result is the encoder difference from the sensor to the follow start. After computing, move the robot to the marker, and set in the log target and P0 in the module number;
20 Separation distance: distance between products, unit: mm; if the product distance is below the set value, the target will not be logged; Separation time: the time between the first product passing through the sensor and the second product passing through the sensor; if the time is below the set value, the second product target will not be logged; Separation angle: for rotary follow, the angle is calculated from the center of the circle composed of P1, P2 and P3, and the separation angle between the second product and the first product is equal to or below the set value, the second product will not be logged;
21 Separation trigger: For visual communication photo follow, after it is ticked, the system will send photos every running of set distance according to the conveyor line speed, and monitor communication photo M45;
22 Send Take Photo Cmd: After it is ticked, send Take Photo Command when separation triggers Take Photo, command format Encoder 1 sends Take Photo Command {"dsID":"www.hc-system.com.cam","reqType":"photo", "camID":0 } Encoder 2 sends Take Photo Command {"dsID":"www.hc-system.com.cam","reqType":"photo", "camID":1 }
23 Encoder ID reset: Set Encoder ID to 1 (only one encoder can be connected when resetting or setting the ID);
24 Encoder 2 ID setting: Set the encoder with default ID of 1 to ID2 (if an alarm is given for encoder setting failed, it needs to reset to factory defaults, then set ID2, and finally power off and restart) 3.2.2 Description of follow parameters


3.2.2.1 Linear follow calibration setting
13 Follow Type: conveyor line + vision and conveyor line + signal (the calibration method is the same for two types, conveyor line + vision does not need log target);
14 Follow Group 1: For single follow, only Follow Group 1 calibration point will be instructed; for double follow, note to instruct that points P0,P1,P2 need to follow end and the follow group of log target should be corresponding;
15 Set In: Tick P0, move the robot to P0 marker, and click Set In to log the current world coordinate value of the robot;
16 Run To: Tick P0, and click Run To so that the robot will moves to the previously set-in P0 position;
17 Start Follow: After P0, P1, P2 are set in, click "Start Follow" and insert into the program line so that the robot will execute follow from the current line;
18 Stop Follow: Tick "Stop Follow" and insert into the program line so that the robot will run to the current line and stop follow;
19 Log Target: For instructing log target use in case of follow + signal 1. When the sensor switch is within the robot's travel, log target is at the sensor switch; 2. When the sensor switch is beyond the robot's travel, log target is adjusted to the sensor switch through "start offset";
20 P0: log target, action needing to performed for follow task is instructed based on P0;
21 P1: follow start point, when the material arrives near the point, the robot starts to execute the follow action; the actual position of the robot before follow starts can be different from P1, but should not deviate too much; otherwise, it will prolong the time to follow the target;
22 P2: boundary point, P1 and P2 constitute the robot follow working range [p1, p2]; the robot does not act before P1; after the robot follows P2, you can choose Alarm or Stop Follow, and continue to execute the next line of program;
23 Follow speed: speed from home point to P1;
24 Fixed offset: Fixed offset value based on P0 (without tool, it is world coordinate X/Y/Z offset based on P0; with tool, it is tool X/Y/Z offset based on P0; note that the offset value is fixed and will not change along with the conveyor belt speed).
Note: 1. When P0, P1, P2 are calibrated and modified, the 3 points and log target of follow group 1 or follow group 2 must be modified at the same time, and P0-P2 calibration points must be on a straight line; 2. P0, P1 and P2 are calibrated along the X or Y direction and on the same straight line; set-in values of log target P0, P1, P2 are consistent with home points before follow start command and tools brought by follow track, and cannot bring workbench; P0 and P1 can be the same point, namely P0≥P1>P2 or P0≤P1;
3.2.2.2 linear follow start offset and follow command P0,P1,P2 calibration diagram
Start offset A

Start offset B/log target/P0

Calibrate P1 (You can set it to the same point as P0, that is, directly set in P1 to the position to which P0 is set in)

Calibrate P2 (follow boundary point. when the product is beyond P2, the robot will not follow the product)

3.2.2.3 Rotary follow calibration setting
Rotary follow: Follow type, Follow Group 1, Set In, Run To, Start Follow, Stop Follow, Log Target, Follow Speed, Fixed Offset and other parameters are followed with reference to the straight line, but the difference is that P0~P3 (4 points) need to be calibrated for rotary follow.

5 P0: log target, action needing to performed for follow task is instructed based on P0;
6 P1: follow start point, when the material arrives near the point, the robot starts to execute the follow action;
7 P2: calibration curve midpoint;
8 P3: follow boundary point. When the product is beyond P3, the robot will not follow the product, and you can select alarm or stop follow (P1~P3 are to calibrate a curve consistent with the angle of conveyor belt).
3.2.2.4 rotary follow start offset and follow command P0,P1,P2 calibration diagram
Start offset A

Start offset B/log target/P0

P1 (follow start point)

P2 (calibration midpoint)

P3 (follow boundary point)

3.3 M relay meaning

3.4 Address data definitions
Follow Process Address Data Definition Table

3.5 Follow + signal single follow setting and instruction steps
3.5.1 Create a new module number
Login permission → click module number position → create new → enter module number name → Confirm → click newly created module number → load

3.5.2 Encoder setting
Switch to the Stop location, and then successively click: Settings → Product Settings → craft Setting → Technology type (select SprayingProcess)
→ tick TF En 1, select or fill others as actually needed according to encoder parameter description.

3.5.3 Log target
After inserting Wait for sensor ON/OFF once in the subprogram 1, then insert log target. The target setting in is as follows:
3、There is no interference in the sensor within the range of the robot. The sensor OFF position is at the start marker point needs to be sprayed on the product. Move the robot above the point, and set in the log target.
4、There might be interference in the sensor beyond the range of the robot. It needs to set start offset. When the product is at the sensor OFF position, log A → start conveyor belt → the product arrives at a position that can be used to teach the track within the range of the robot → stop conveyor belt → log B → compute → the robot moves to the B position → set in the log target value → insert after sensor ON/OFF.

3.5.4 Follow command and track instruction
after log target → tick start follow 1 → tick P0 for setting in → tick P1 → start conveyor belt → when the product runs to the ready to track position → stop conveyor belt → move the robot to the marker → set in P1 value → tick P2 → start the conveyor belt → when the product runs to the position where the robot stops following → stop the conveyor belt → move the robot to the marker → set in P2 value → insert program line → insert the track needing to be followed after Start Follow → insert Stop Follow.

3.6 Follow + signal double follow setting and instruction steps
3.6.1 Create a new module number
Refer to single follow
3.6.2 Encoder setting
3.6.2.1 Encoder ID reset to factory defaults
Connect 24V power, CANL and CANH lines of encoder 1 → tick TF En 1 → set Follow Type → input encoder precision → start conveyor belt and observe current value of encoder (if the value of encoder is always negative, tick Count Reverse until you observe that the encoder value is increasing) → click encoder ID reset to factory defaults → untick TF En 1 → cut off the power for removing or disconnecting encoder 1 power supply.

3.6.2.2 Set encoder 2:
Connect 24V power, CANL and CANH lines of encoder 2 → tick TF En 2 → set encoder type → input encoder precision → start conveyor belt and observe current value of encoder (if the value of encoder is always negative, tick Count Reverse until you observe that the encoder value is increasing) → click encoder 2 for ID setting → cut off the power and connect the power wire of encoder 1 → power on → tick TF En 1 → start conveyor belt → observe whether the current values of two encoders increase → turn off one conveyor belt and observe current values of encoders → inspect whether ID is correct.
Remark: During double follow ID setting, only one encoder can be connected; otherwise, the ID cannot be reset to factory defaults

3.6.3 Log target
For log target, please refer to single follow. The log target of the two encoders are placed in two subprograms respectively.
3.6.4 Follow command and track instruction
Refer to single follow. Note that double follow is sequential follow, namely follow group 2 is tracked after follow group 1 is tracked.
3.7 Follow + vision setting and take photo command
3.7.1 Create a new module number
Refer to signal + follow single tracking
3.7.2 Connect to the camera
Set the camera IP and the robot system in the same network segment, and test whether it is normal for the camera to receive the command to take photos and send product coordinates to the robot.

3.7.3 Encoder setting
For encoder type, precision and other parameters, please refer to signal + follow single tracking
3.7.4 Start offset and follow command instruction
Take photos by camera hand-eye calibration. After recording the calibration point pixels of the calibration plate, click Set In A, to move the conveyor belt. After the calibration plate reaches the robot range, click Log B, and click "count". The robot moves to each calibration point, finish camera hand-eye calibration, and then count. The robot moves to the center of the calibration plate. The point is recorded as P0. Run the conveyor belt. The center of the calibration plate reaches the position where the robot needs to finish the track. Move the robot to the center of the calibration plate. The point is recorded as P1. Run the conveyor belt. The center of the calibration plate reaches the boundary of the track, and the robot moves to the center of the calibration plate. The point is recorded as P2.
3.7.5 Distance Trigger Take Photo
If it needs to send Take Photo Command at a fixed distance, tick Separation trigger, set fixed distance, which is the actual distance of the product's running on the conveyor belt; if the distance M45 set for running of the conveyor belt is ON (M45 OFF needs to be instructed), tick "Send Take Photo Cmd".
3.7.6 Wait data source command
After inserting the command into the subprogram (the "vision follow" command can only be edited in the subprogram), the coordinate data that the camera transmits to the robot in the protocol format will be temporarily stored in the data source (not saved after power off). Writing path: Programming → Action Menu → Vision and Remote → Data source selection "www.hc-system.com.cam::[HID:100]". Tick "Wait data source" → Fill in display time (If the camera sends no data within the set time during automatic running, alarm will be sent) → insert into subprogram.
Remark: The camera sends the absolute position to the robot format (for 2D vision, remove
"Z":"176.001","U":"0.000","V":"0.000"; the coordinate value is the absolute position based on P0)
{
"dsID":"www.hc-system.com.cam",
"reqType": "AddPoints",
"dsData": [ {
"camID":"0",
"data": [
{"ModelID":"0", "X":"610.001","Y":"12.001","Z":"176.001","U":"0.000","V":"0.000","Angel":"123.123",
"Similarity":"0","Color":"0", "Rel":"0"} ] } ] }
The robot receives a reply from the absolute position
{"cmdReply":["AddPoints","1"],"dsID":"www.hc-system.com.cam","reqType":
"AddPoints"}
If you need to distinguish color classification for placement, you can change "Color":"0" when the vision sends data, then judge the value by instructing 850,851 at the end of the follow, and jump to the corresponding discharge flag program.
Wait data source command (required to be inserted into subprogram)

3.7.7 Photo Take - output point: The camera selects IO trigger photo take
The camera selects the output point and begins to take photos: tick Photo Take → select "www.hc- system.com.cam::[HID:100]" for "Data Source" → select output point → tick ON or OFF → fill in Action Time (the time when the output point of a single photo taking is on or off) → fill output times (total number of photo output times of a single command) → separation time (interval between two photo takings) → tick port Y to output → click it to insert it into the subprogram line

3.7.8 Photo take - communication: The camera selects communication photo take
The camera selects communication photo:
(1) Tick Photo Take → select "www.hc-system.com.cam::[HID:100]" for "Data Source" → select communication → fill in number of photo taking times → fill in separation time → insert into program line.

⑵ Separation trigger photo take (used for removing duplicates)
Tick "Send Take Photo Cmd" (there is no need to instruct communication photo taking in the program; the robot will send Take Photo Command on the conveyor/every time it reached a set distance)
Set separation distance\do not tick "Send Take Photo Cmd", with need to instruct Wait M45 ON in program → communication photo (times set to 1, separation time set to 0) → instruct M45 OFF

Remark: The robot sends a command to take photos:
{
"dsID":"www.hc-system.com.cam",
"reqType":"photo",
"camID":0 }
Photo taking success replay:
{
"dsID":"www.hc-system.com.cam",
"reqType":"photo",
"camID":0,
"ret":1 }
3.8 Rotary follow setting and instruction steps
3.8.1 Create a new module number
Refer to single follow
3.8.2 Encoder setting
Switch to Stop location, successively click: Settings → Product Settings → craft Setting → Technology type (select spraying or none) → tick Follow En 1 → Select rotary for follow type, select or fill in others according to the actual needs with reference to the encoder parameter description.

3.8.3 Log target
For log target, please refer to single tracking

3.8.4 Follow command and track instruction
after log target → tick start follow 1 → tick P0 for setting in → tick P1 → start conveyor belt → when the product runs to the ready to track position → stop conveyor belt → move the robot to the marker → set in P1 value → tick P2 → start the conveyor belt → when the product runs to the midpoint in the follow range → stop the conveyor belt → move the robot to the marker → set in P2 value → tick P3 → start conveyor belt → when the product runs to the position where the robot stops following → insert program line → insert the track needing to be followed after Start Follow (all tracks are instructed based on P0) → insert Stop Follow.

4 Instruction mold program
4.1 Conveyor belt + signal single tracking program
Log target (the set-in value must bring the same tool as the home point and cannot bring a workbench)

Follow track (the follow track must bring the same tool as the home point and cannot bring a workbench)

4.2 Conveyor belt + signal double tracking program
Follow group 1 log target (the set-in value must bring the same tool as the home point and cannot bring a workbench)

Follow group 2 log target (the set-in value must bring the same tool as the home point and cannot bring a workbench)

Follow track

4.3 Conveyor belt + vision - communication trigger
Wait data source command instruction (required to be inserted into subprogram)

Follow track instruction

Continued

4.4 Rotary follow
Log target

Follow track


