文章

CAN-STEPCON-1H

DS-402 Implementation for Stepper Controller

支持的三种模式

  1. pv
  2. pp
  3. homing (method 17,18,19,20,21,22,35)

pv(Profile Velocity Mode), control with SDO.

  1. power on the module (CAN-STEPCON-1H)
  2. 00, 81 00 //NMT reset node
  3. 00, 82 00 //NMT reset comm objects
  4. 00, 80 00 //NMT pre-op
  5. 00, 01 00 //NMT op
  6. 6040 -> 0F //drive to enable operation state
  7. 280A -> 06 //max_gear set to 1/64 step
  8. 6060 -> 03 //set pv mode
  9. 6083 -> 00 00 00 64//slow down the acceleration from default 5000 to 100 (unit: 1 full_step/s^2).
  10. 6084 -> 00 00 00 64//slow down the acceleration from default 10000 to 100 (unit: 1 full_step/s^2).
  11. 60FF -> 00 00 60 00 //set target velocity to about 2 second per circle, counter clockwise.
  12. 60FF -> 00 00 C0 00 //set target velocity to about 1 second per circle, counter clockwise.
  13. 60FF -> 00 07 80 00 //set target velocity to about 0.1 second per circle, counter clockwise.
  14. 60FF -> FF F6 00 00 //set target velocity equal to negtive 00 0A 00 00, clockwise. (先取反,再加1,或者使用计算器)。
  15. 6040 -> 07 //drive to switched on state

Object 28FF: esd_mode, bit 0: PDO data in LSB_first order or in MSB_first order.

position and velocity values in PDOs are LSB-first (CANopen specific) or MSB-first (esd-mot specific). value : 0 MSB-First (default), 1 LSB-First

pv, control with RxPDO.

  1. power on the module (CAN-STEPCON-1H)
  2. 00, 81 00 //NMT reset node
  3. 00, 82 00 //NMT reset comm objects
  4. 00, 80 00 //NMT pre-op
  5. 00, 01 00 //NMT op
  6. 303, 0F 00 03 //RxPDO to node 3 with control word 00 0F(driver to enable operation state) and mode of operation 03 (pv mode).
  7. 280A -> 06 //SDO, set max_gear set to 1/64 step
  8. 503, 0F 00 00 0A 00 00 //RxPDO to node 3 with control word 00 0F(driver to enable operation state) and target velocity 00 0A 00 00 (MSB_first), counter clockwise.
  9. 503, 0F 00 00 00 01 00 //RxPDO to node 3, slow down, target velocity to 00 00 01 00 (MSB_first), counter clockwise.
  10. 503, 0F 00 FF F6 00 00 //RxPDO to node 3, inverse rotation, target velocity to FF F6 00 00 (MSB_first), clockwise.
  11. 303, 07 00 03 //RxPDO to node 3 with control word 00 07(driver to switched on state) and mode of operation 03 (pv mode).

pp(Profile Position Mode), control with SDO, absolute position.

  1. power on the module (CAN-STEPCON-1H)
  2. 00, 81 00 //NMT reset node
  3. 00, 82 00 //NMT reset comm objects
  4. 00, 80 00 //NMT pre-op
  5. 00, 01 00 //NMT op
  6. 6060 -> 01 //set pp mode
  7. 6081 -> 00 00 C0 00//set profile velocity.
  8. 6040 -> 3F //drive enable operation with bit absolute value,change_set_immediately,new_setpoint being set.
  9. 607A -> 00 00 10 00 //target postion set to abs 0x1000, drive starts to rotate from 0 to 0x1000 position with counter-clockwise directrion.
  10. 607A -> 00 00 00 00 //target postion set to abs 0, drive starts to rotate from 0x1000 to 0 position with direction clockwise.
  11. 607A -> FF FF F0 00 //target postion set to negtive abs 0x1000, drive starts to rotate from 0 to negtive 0x1000 position with direction clockwise.

pp, control word: change_set_immediately and new_setpoint, status word: setpoint_acknowledge.

  1. THere are 2 modes "Set of setpoint"(Not Supported by CAN-STEPCON-1H) and "Single setpoint mode"(Only suppored mode).
  2. Bit "change_set_immediately" in control word bit 5 setting to "0" is not supported, so the only value supported is 1, which means "interrrupt the actual positioning and start the next positioning".
  3. "new_setpoint" in control word bit 4 has no effect if I set it to value 0 "does not assume target_position", all the behaviour of the stepper moter seems like it only accepts value 1 "assume target_postion" of "new_setpoint".

pp, control with RxPDO.

  1. power on the module (CAN-STEPCON-1H)
  2. 00, 81 00 //NMT reset node
  3. 00, 82 00 //NMT reset comm objects
  4. 00, 80 00 //NMT pre-op
  5. 00, 01 00 //NMT op
  6. 303, 3F 00 01 //RxPDO to node 3 with control word 00 3F(drive to enable operation with bit absolute value,change_set_immediately,new_setpoint being set) and mode of operation 01 (pp mode).
  7. 403, 3F 00 00 00 10 00 //RxPDO to node 3 with control word 00 3F, and set target postion to abs pos 0x1000(if 28FF = 0) (MSB_first), or abs 0x100000(if 28FF = 0)(LSB_first).
  8. 403, 3F 00 00 00 00 00 //RxPDO to node 3 with control word 00 3F, and set target postion to abs pos 0.
  9. 403, 3F 00 FF FF F0 00 //RxPDO to node 3 with control word 00 3F, and set target postion to abs pos negtive 0x1000(if 28FF = 0)(MSB_first), or abs 0xF0FFFF(if 28FF = 1)(MSB_first).

Homing mode, method 17: Homing on the Negtive Limit Switch.

  1. Connect slotted light switch to Position Switch ES0 (ES Lower), refer to its Hardware Manual for more details. Keep clear inside the slot.
  2. power on the module (CAN-STEPCON-1H)
  3. 00, 81 00 //NMT reset node
  4. 00, 82 00 //NMT reset comm objects
  5. 00, 80 00 //NMT pre-op
  6. 00, 01 00 //NMT op
  7. 6060 -> 06 //set to homing mode
  8. 6098 -> 11 //select homing method 17
  9. 6099 01 -> 1F400 //set home speed, speed_during_search_for_switch to 500 full steps/s (1F400/100 = 1F4 = decimal 500).
  10. 6099 02 -> C800 //set home speed, speed_during_search_for_zero to 200 full steps/s (C800/100 = C8 = decimal 200).
  11. 6040 -> 1F //drive enable operation with homing operation start (bit 4) being set.
  12. The drive starts to rotate leftward (clockwise) at the speed of 500 full steps/s (valus is set in index 6099 sub-index 01), and at that time the slotted light switch is in inactive state, you can confirm it by checking the statusword bit 14 (lower limit switch active) output by TxPDO, this bit is not set.
  13. Put an opaque object inside the slot of the slotted light switch, the drive starts to rotate rightward (count-clockwise) at the speed of 200 full steps/s (valus is set in index 6099 sub-index 02), and at that time the slotted light switch is in active state, you can confirm it by checking the statusword bit 14 (lower limit switch active) output by TxPDO, this bit is set.
  14. remove the opaque object from the slot of the slotted light switch, the driver stops rotating.
  15. Bit 12: homing_attained in status word is set indicating homing attained.

Homing mode, method 18: Homing on the Positive Limit Switch.

  1. refer to the steps as above (Homing mode, method 17: Homing on the Negtive Limit Switch), only change the step 8. 6098 -> 12 //select homing method 18.
  2. After set 6040 -> 1F, The drive starts to rotate ** rightward (count-clockwise) ** at the speed of 500 full steps/s (valus is set in index 6099 sub-index 01), and at that time the slotted light switch is in inactive state, you can confirm it by checking the statusword ** bit 15 (upper limit switch active) ** output by TxPDO, this bit is not set.
  3. Put an opaque object inside the slot of the slotted light switch, the drive starts to rotate ** leftward (clockwise) ** at the speed of 200 full steps/s (valus is set in index 6099 sub-index 02), and at that time the slotted light switch is in active state, you can confirm it by checking the statusword ** bit 15 (upper limit switch active) ** output by TxPDO, this bit is set.
  4. remove the opaque object from the slot of the slotted light switch, the driver stops rotating.
  5. Bit 12: homing_attained in status word is set indicating homing attained.

Homing mode, method 19: Homing on the Positive Home Switch.

  1. refer to the steps as above (Homing mode, method 17: Homing on the Negtive Limit Switch), only change the step 8. 6098 -> 13 //select homing method 19.

method 19 的第一种情况:

  1. After set 6040 -> 1F, The drive starts to rotate ** rightward (count-clockwise) ** at the speed of 500 full steps/s (valus is set in index 6099 sub-index 01), and at that time the slotted light switch is in inactive state, you can confirm it by checking the statusword ** bit 8 (reference active) ** output by TxPDO, this bit is not set.
  2. Put an opaque object inside the slot of the slotted light switch, the drive starts to rotate ** leftward (clockwise) ** at the speed of 200 full steps/s (valus is set in index 6099 sub-index 02), and at that time the slotted light switch is in active state, you can confirm it by checking the statusword ** bit 8 (reference active) ** output by TxPDO, this bit is set.
  3. remove the opaque object from the slot of the slotted light switch, the driver stops rotating.
  4. Bit 12: homing_attained in status word is set indicating homing attained.

method 19 的第二种情况:

  1. before set 6040 -> 1F, there is an opaque object inserted in the slot of the slotted light switch, which causes ** bit 8 (reference active) ** being set, you can confirm it in status word output by TxPDO.
  2. After set 6040 -> 1F, The drive starts to rotate ** leftward (clockwise) ** at the speed of 500 full steps/s (valus is set in index 6099 sub-index 01), and at that time the slotted light switch is in active state, you can confirm it by checking the statusword ** bit 8 (reference active) ** output by TxPDO, this bit is set.
  3. remove the opaque object from the slot of the slotted light switch, the driver stops rotating directly, no more rotating in different direction.
  4. Bit 12: homing_attained in status word is set indicating homing attained.

Object 2810 es_lower_opt, 2811 es_upper_opt, 2812 reference_opt

  1. Bit 4: Active_State, which can be used to alternate the inactive and active state of lower, upper, reference switches.
  2. Bit 5: trigger transmit PDO3 on change. if this bit is set, like in 2810 es_lower_opt, in OP mode, each time you toggle the state of es_lower_opt (slotted light switch), there is a PDO3 (like id 0x383) will be transmitted with corresponding bit of status word being changed.

Object 2820: ref_position

After homing attained, the actual position the drive stopped at is recorded in this object. You may check Object 28FF bit 1 to ensure if this actual position value is valid or not.

Object 605C: disable_operation_option_code: ‘OPERATION ENABLE’ -> ‘SWITCHED ON’

value 0: disable drive function
value 1: slow down with slow down ramp and then disabling of the drive function

  1. 6084 (profile_deceleration),改为一个很小的值,如0x64(100)。
  2. 当Index 605C的值为1时,将drive由OPERATION ENABLE改为SWITCHED ON,电机会根据6084中的值慢慢降速。
  3. 当Index 605C的值为0时,将drive由OPERATION ENABLE改为SWITCHED ON,电机会立刻停止,而忽视6084的减速度值。
  4. Index 605B ‘OPERATION ENABLE’ -> ‘READY TO SWITCH ON’ 有相似的设定。

Object 2807h: t_auto_shutdow: timeout for ‘no movement state’

Default value: 250, means if no movement state is detected, after 25 seconds, drive disables operation state automatically. you can see the statusword changes from 0627 to 0623 automatically. If the value is set to 0, means there will be no auto state change from operation state to switched_on state (if 2808=3).

CAN-STEPCON-1H CANreal send list

can-stepcon-1h_canreal_sendlist.zip

Control CAN-STEPCON-1H by the application which uses esd CANopen software stack in Linux

Following 2 c lang files and 1 config file are the application which can be used to control CAN-STEPCON-1H running under pv mode. They were tested under Debian 4.19.0-18, with esd CANopen software stack v3.2.1.

pv_slave_canopen.c
pv_manager_canopen.c
config.xml

How to build with gcc:

  1. Build manager application gcc pv_manager_canopen.c -Wall -lntcan -lcalcan -lpsys -lCANopenManager -o manager.o.
  2. Build slave application gcc pv_slave_canopen.c -Wall -lntcan -lcalcan -lpsys -lCANopenSlave -o slave.o.

Steps:

  1. Net number: 3, node number of CAN-STEPCON-1h: 1, baud rate: 1000 kbps.
  2. Run slave application first.
  3. Place the config.xml to the same folder of the manager application.
  4. Run manager application, which changes some values of SDOs of CAN-STEPCON-1h, and makes CAN bus entering into op mode.