Hi,
In CoDesys, Conroller configuration,
I have give Control word command of "Receive PDO Mapping" to bring my Actuator DSP 402 for Enable state but unfortunately It show all time same Status word. I have also remove my DSP402 slave out of canopen network to see what is happening and I have found still same "Status word" that probably means my conection or configuration or like some thing is wrong as Status Word is same in both cases.
Can any body tell me how can i know the connection between Master node Codesys SP RTE (peak PCI) and Slave Node DSP 402 is correct or not.Actually I want to go inside my slave node and want bring it enable state.
I have attached two photos of my control word and status word.
Please tell me if any suggestion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How is your PDO communication configured? Is it Asyn or Sync? Allot of devices may be set for Sync and you have the Sync object disabled. make sure the PDO configuration is set as async for now.
make sure baud rates match. make sure node ID's match.
make sure the drive is in the CANopen operational state.
What drive are you using? Most drives will have an LED, a keypad something that you can even monitor this.
Let CoDeSys do it for you. Use this (Assuming you have only one Node/Device in your CANopen stack):
```
FOR sEachNode := 0 TO MAX_NODEINDEX DO
   xoperational := FALSE;
  IF ((pCanOpenNode[sEachNode].nStatus = 5))THEN
      xoperational := TRUE;
  end_if
end_for
```
You get my point. This is the global can master structure.
nStatus
5 = operational
97 = Node not found
127 = pre-op
99 = Node doesn't match EDS file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi;
Thanks for your suggestion.
I have used another Pcan View for analysing my network. I have wirten small program.When I have load my Program in PLC then ; I have
000 2 01 04 ( 04 my node ID , 01 remote start, 2 DLC) means "remote start node"
(PCAN view: ID=0,Type=D,DLC=2,Data=1 4 )
PDO configuration is set as async in PDO mapping.
Then I observe in " CANopen Implicit variables (constant)"
I think, my node is now in "operational state". But I dont get for moving my EnCoTrive DSP402 actuator.I have to send now SDO or it is not necessary to send SDO.
( Normally when I have run my motor then I always Send SDO to write some velocity then I have give comand like Ready to switch, Enable volatge, opeartion via Hex Code )
But in codesys I dont get what should i have to for just move my Actuator (ENCO TRIVE).then I can try more application of Motor.
My Samll program: I am just trying
Controlword:=15; ( In "Enco TRive can node dsp 402" software, Control word : Bit 0 = switch on ,
Bit1= Enable votage, Bit3=Quick stop Bit3: Enable operation)
(So I have select "1111:Binary" = "F:Hex" = " 15: decimal" To use the control word
for Opeation Status)
operationmode:=3; ( Velocity mode =3 and Position mode =1. I have chossed velocity mode for a particular velocity
like 300 or 309 )
counter; ( for a timer. after a particular time ,i want to change velocity from 300 to 309 ) input:=counter.output; ( Just call function block of "Timer )
IF input =TRUE (if timer output true then velocity 309) THEN
velocity:=309;[/color] ELSE velocity:=300; (if timer output False then velocity 300)
Can you please tell what i should to start my actuator,just normal start with any velocity.
Thanks
asif
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You should never use SDO for PDO data. SDO is only for configuration not normal operating conditions. An SDO is a confirmed message in CANopen which means you send data and the drive responds (two messages per SDO). Too much overhead on the CAN bus. One thing is I don't know why you use this NMT with DLC?
NMT start command should just be 000 01 02 (to start node 2) or just use the global 000 01 00 (to start all nodes)
The next thing you need to do is map the PDO data to the drive.
You need the target velocity (velocity in RPM as oppose to hz, OD 6042 sub 00) mapped as a RPDO of the drive so that you write to this data point to send the target speed to the drive.
You need the command (OD 6040 sub 00) object mapped as a RPDO. This controls the state machine and gives the drive a run command.
You should have at least status register (OD 6041 sub 00) of the drive mapped as a TPDO.
That is the basics. So you control the state machine with the command and send the speed with the speed target.
Do you know how to map data to PDO? If you want send me your drives EDS file and I'll send you back a program that sets it up for you if you need more help.
Send me a project with only the target and the eds file. Make sure you package the whole project by using the File->Save/Archive menu from within CoDeSys.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
it is not possible to bring an EncoTRive axis into motion by a single access to control word only.
I did it the following way (I do not remember the meaning of controlword and statusword bits, check documentation yourself) :
When I want the drive to be off, I set controlword to WORD#16#0104. To switch the drive on, set controlword to WORD#16#0106. Wait for statusword = WORD#16#0621
Send a SwitchOn to the drive, for that set Controlword to WORD#16#0107. Wait for statusword = WORD#16#0623
Then the drive is switched on and ready to execute your commands, e.g. moving with a certain speed (Controlword = WORD#16#000F, speed is positive or negative to move ahead or back) or stopping (Controlword = WORD#16#0007).
This software is running on a real machine tool for 4 years now.
Best is to put the code into a little state machine.
Regarding the CAN bus traffic follow the advices of spfeif. I did all my PLC to drive communication with PDOs.
Have success
Rolf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes Rolf gave better detail then myself. The drive company should have a very basic block that handles the state machine for you. You should never have to deal with this yourself. At a minimum it should have a type of stop input (Quick, Ramp,) direction input (fwd/rev) cmd output, velocity output and status input. Follow Rolf and the DSP402 if you have to make it yourself otherwise I can give you a FB that should work for you. It is from another VFD MFG as long as they are not using any MFG specific bits to control the state machine in the CMD and Status it should put your drive into the READY state.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Rolf & Steve,
Thanks for your info. I will trying with your distation.
@Steve: How can I send you my Archive Proejct. I dont find your email address or is it possible to share message or document in Codesys forum?
It will be helpful to know about pdo mapping and sample program as I am very new in canopen & codesys.
Thanks you all again for informatic info.
Asif
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
0x1400(Id:$NODEID+0x200)->Controlword (2 Byte) + opeartion Mode (1 Byte) + traget velocity(4 Byte)
I have used these 3 parameters of total 7 byte in 0x1400(Id:$NODEID+0x200) (total capacity 8 byte)
In Tx_PDO mapping: 0x1800(Id:$NODEID+0x180)->Statusword (2 Byte) + Actual opeartion Mode (1 Byte) + Actual velocity(4 Byte)
St Program editor: controlword := WORD#16#0106;
But it has no effect on Status wors. It all time statusword = WORD#16#0640. Where as It should be statusword = WORD#16#0621.
I have also tries in
controlword := WORD#16#0107 but same Statusword=WORD#16#0640. actualy i dont understand why my Status Word is fixed on WORD#16#0640.
Thanks by,
Asif
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure your drive control source is CAN. Some drives allow multiple control sources. I have Altivar drives that can work from IO, CAN, MODBUS, LOCAL KEYPAD. Do you have a keypad? Maybe if you operate directly from the local keypad see if the status word changes. My email address should be under my profile?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the EncoTRive is available either with CANopen, Profibus or with Profinet. From that point of view - communication should be choosen correctly (otherwise you would have different connectors).
But I wonder why you can write to the drive control word, but the telegrams do not follow the changes (the values you gave in your yesterday's post are out of traffic monitoring, don't they?). Seems, there's a mismatch between PLC and PDOs, PLC seems to write to another address than the PDOs are read from.
I would suggest to check the matching of addresses again. I know, some of the PLCs have a pretty awkward PDO configuration ...
Rolf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi again,
just a quick question: on inspecting your Friday screenshots I saw, that the controlword is at %QB5, but it's expansion shows QX2.8 and up. Maybe that's the problem ...
Rolf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have used in PDO mapping: asynchronous-device profile specific.
CASE state_machine OF
0:
controlword:=WORD#16#0106;
IF statusword>=WORD#16#0621 THEN state_machine:=1;
END_IF;
1: controlword:=WORD#16#0107;
IF statusword>= WORD#16#0623 THEN state_machine:= 2;
END_IF;
2:
controlword:=WORD#16#000f;
IF statusword>= WORD#16#0637 THEN state_machine:=3;
END_IF;
3: Velocity:=300;
END_CASE;
Still my machine go to Statusword=1600 ( Word#16#0640) that means Bit6: Switch on Disabled.
can anybody tell me where is the problem because anyway machine have to go "Enable Operation Word#16#0637" but it goes to "Switch on Disabled word#16#0640"
[NB]: I have used >= sign in Machine program as = is not working sometimes. ( If I have put = sign then it does not change the State from 0 to 3)
Your state machine maybe is too quick. The EncoTRives need some time to switch from one state to another. The ">=" can be the reason ...
Did you apply all needed voltages to the drive (electronics supply, motion supply)?
With the EncoTRives I some years ago had a little problem. When enabling the drives, the power supply voltage dropped to zero and came back prettty slowly. This caused the drives to wait for a INIT telegram again.
No more ideas. Check the manual and ask the manufacturer.
Rolf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks all for ur info.
I can call a timer to delay every state (example: T#2s) but still just go to Bit6: Switch on Disabled.just when i run codesys, device Enable voltage is gone.
Actaully EncoTrive 24Vdc voltage is ok. As I can run the Drive via Pcan View all time by following.
So I just run that means EncOTrive Drive has no problem so power or elctricity connection of drive is ok and also canopen connection. I think,there is a mismatch between CoDeSys SP PLC or PDO mapping.
But i dont sure or know that if addition code is needed to communicate between CodeSys to CANopen node like ENCOTrive. I have just write a state_machine code 0x0106, 0x0107, 0x000f with Case..of statement with difineing control word & status word, and also done the mapping of the PDOs.
Thanks
Asif
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Strange ...
I had it running on a Beckhoff TwinCAT PLC via CANopen. However, it is long ago, and I do not remember the details just now. The CAN bus is not our standard.
Since you can move the drive via PCan, the wiring and supply are OK indeed. So it seems to be a CoDeSys and/or mapping issue. Unfortunately each PLC maker has a different philosophy to arrange external communication; TwinCAT experience will not help on other PLCs.
Does your bus monitor support telegram filters? If yes, you could trigger control words PLC to drive and analyze the answer. This way you also should be able to detect byte swaps.
Rolf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
In CoDesys, Conroller configuration,
I have give Control word command of "Receive PDO Mapping" to bring my Actuator DSP 402 for Enable state but unfortunately It show all time same Status word. I have also remove my DSP402 slave out of canopen network to see what is happening and I have found still same "Status word" that probably means my conection or configuration or like some thing is wrong as Status Word is same in both cases.
Can any body tell me how can i know the connection between Master node Codesys SP RTE (peak PCI) and Slave Node DSP 402 is correct or not.Actually I want to go inside my slave node and want bring it enable state.
I have attached two photos of my control word and status word.
Please tell me if any suggestion.
Hi,
I first would suggest to monitor the traffic on the CAN network.
http://www.ixxat.com/cananalyser_en.html). Not very expensive ...
Rolf
How is your PDO communication configured? Is it Asyn or Sync? Allot of devices may be set for Sync and you have the Sync object disabled. make sure the PDO configuration is set as async for now.
make sure baud rates match. make sure node ID's match.
make sure the drive is in the CANopen operational state.
What drive are you using? Most drives will have an LED, a keypad something that you can even monitor this.
Let CoDeSys do it for you. Use this (Assuming you have only one Node/Device in your CANopen stack):
```
FOR sEachNode := 0 TO MAX_NODEINDEX DO
   xoperational := FALSE;
  IF ((pCanOpenNode[sEachNode].nStatus = 5))THEN
      xoperational := TRUE;
  end_if
end_for
```
You get my point. This is the global can master structure.
nStatus
5 = operational
97 = Node not found
127 = pre-op
99 = Node doesn't match EDS file?
Hi;
Thanks for your suggestion.
I have used another Pcan View for analysing my network. I have wirten small program.When I have load my Program in PLC then ; I have
000 2 01 04 ( 04 my node ID , 01 remote start, 2 DLC) means "remote start node"
(PCAN view: ID=0,Type=D,DLC=2,Data=1 4 )
PDO configuration is set as async in PDO mapping.
Then I observe in " CANopen Implicit variables (constant)"
pCanOpenNode[0].nStatus=5
pCanOpenMaster[0].nStatus=5
I think, my node is now in "operational state". But I dont get for moving my EnCoTrive DSP402 actuator.I have to send now SDO or it is not necessary to send SDO.
( Normally when I have run my motor then I always Send SDO to write some velocity then I have give comand like Ready to switch, Enable volatge, opeartion via Hex Code )
But in codesys I dont get what should i have to for just move my Actuator (ENCO TRIVE).then I can try more application of Motor.
My Samll program: I am just trying
Controlword:=15; ( In "Enco TRive can node dsp 402" software, Control word : Bit 0 = switch on ,
Bit1= Enable votage, Bit3=Quick stop Bit3: Enable operation)
(So I have select "1111:Binary" = "F:Hex" = " 15: decimal" To use the control word
for Opeation Status)
operationmode:=3; ( Velocity mode =3 and Position mode =1. I have chossed velocity mode for a particular velocity
like 300 or 309 )
counter; ( for a timer. after a particular time ,i want to change velocity from 300 to 309 )
input:=counter.output; ( Just call function block of "Timer )
IF input =TRUE (if timer output true then velocity 309)
THEN
velocity:=309;[/color]
ELSE
velocity:=300; (if timer output False then velocity 300)
Can you please tell what i should to start my actuator,just normal start with any velocity.
Thanks
asif
You should never use SDO for PDO data. SDO is only for configuration not normal operating conditions. An SDO is a confirmed message in CANopen which means you send data and the drive responds (two messages per SDO). Too much overhead on the CAN bus. One thing is I don't know why you use this NMT with DLC?
NMT start command should just be 000 01 02 (to start node 2) or just use the global 000 01 00 (to start all nodes)
The next thing you need to do is map the PDO data to the drive.
You need the target velocity (velocity in RPM as oppose to hz, OD 6042 sub 00) mapped as a RPDO of the drive so that you write to this data point to send the target speed to the drive.
You need the command (OD 6040 sub 00) object mapped as a RPDO. This controls the state machine and gives the drive a run command.
You should have at least status register (OD 6041 sub 00) of the drive mapped as a TPDO.
That is the basics. So you control the state machine with the command and send the speed with the speed target.
Do you know how to map data to PDO? If you want send me your drives EDS file and I'll send you back a program that sets it up for you if you need more help.
Send me a project with only the target and the eds file. Make sure you package the whole project by using the File->Save/Archive menu from within CoDeSys.
Hi,
it is not possible to bring an EncoTRive axis into motion by a single access to control word only.
I did it the following way (I do not remember the meaning of controlword and statusword bits, check documentation yourself) :
Then the drive is switched on and ready to execute your commands, e.g. moving with a certain speed (Controlword = WORD#16#000F, speed is positive or negative to move ahead or back) or stopping (Controlword = WORD#16#0007).
This software is running on a real machine tool for 4 years now.
Best is to put the code into a little state machine.
Regarding the CAN bus traffic follow the advices of spfeif. I did all my PLC to drive communication with PDOs.
Have success
Rolf
Yes Rolf gave better detail then myself. The drive company should have a very basic block that handles the state machine for you. You should never have to deal with this yourself. At a minimum it should have a type of stop input (Quick, Ramp,) direction input (fwd/rev) cmd output, velocity output and status input. Follow Rolf and the DSP402 if you have to make it yourself otherwise I can give you a FB that should work for you. It is from another VFD MFG as long as they are not using any MFG specific bits to control the state machine in the CMD and Status it should put your drive into the READY state.
Hello Rolf & Steve,
Thanks for your info. I will trying with your distation.
@Steve: How can I send you my Archive Proejct. I dont find your email address or is it possible to share message or document in Codesys forum?
It will be helpful to know about pdo mapping and sample program as I am very new in canopen & codesys.
Thanks you all again for informatic info.
Asif
Hi;
In Rx_PDO Mapping in CodeSys:
0x1400(Id:$NODEID+0x200)->Controlword (2 Byte) + opeartion Mode (1 Byte) + traget velocity(4 Byte)
I have used these 3 parameters of total 7 byte in 0x1400(Id:$NODEID+0x200) (total capacity 8 byte)
In Tx_PDO mapping:
0x1800(Id:$NODEID+0x180)->Statusword (2 Byte) + Actual opeartion Mode (1 Byte) + Actual velocity(4 Byte)
St Program editor:
controlword := WORD#16#0106;
But it has no effect on Status wors. It all time statusword = WORD#16#0640. Where as It should be statusword = WORD#16#0621.
I have also tries in
controlword := WORD#16#0107 but same Statusword=WORD#16#0640. actualy i dont understand why my Status Word is fixed on WORD#16#0640.
Thanks by,
Asif
Make sure your drive control source is CAN. Some drives allow multiple control sources. I have Altivar drives that can work from IO, CAN, MODBUS, LOCAL KEYPAD. Do you have a keypad? Maybe if you operate directly from the local keypad see if the status word changes. My email address should be under my profile?
Hi all,
the EncoTRive is available either with CANopen, Profibus or with Profinet. From that point of view - communication should be choosen correctly (otherwise you would have different connectors).
But I wonder why you can write to the drive control word, but the telegrams do not follow the changes (the values you gave in your yesterday's post are out of traffic monitoring, don't they?). Seems, there's a mismatch between PLC and PDOs, PLC seems to write to another address than the PDOs are read from.
I would suggest to check the matching of addresses again. I know, some of the PLCs have a pretty awkward PDO configuration ...
Rolf
Hi again,
just a quick question: on inspecting your Friday screenshots I saw, that the controlword is at %QB5, but it's expansion shows QX2.8 and up. Maybe that's the problem ...
Rolf
Hi,
I have used in PDO mapping: asynchronous-device profile specific.
CASE state_machine OF
0:
controlword:=WORD#16#0106;
IF statusword>=WORD#16#0621 THEN state_machine:=1;
END_IF;
1: controlword:=WORD#16#0107;
IF statusword>= WORD#16#0623 THEN state_machine:= 2;
END_IF;
2:
controlword:=WORD#16#000f;
IF statusword>= WORD#16#0637 THEN state_machine:=3;
END_IF;
3: Velocity:=300;
END_CASE;
Still my machine go to Statusword=1600 ( Word#16#0640) that means Bit6: Switch on Disabled.
can anybody tell me where is the problem because anyway machine have to go "Enable Operation Word#16#0637" but it goes to "Switch on Disabled word#16#0640"
[NB]: I have used >= sign in Machine program as = is not working sometimes. ( If I have put = sign then it does not change the State from 0 to 3)
Thanks
Asif
canopen codesys.zip [126.77 KiB]
Your state machine maybe is too quick. The EncoTRives need some time to switch from one state to another. The ">=" can be the reason ...
Did you apply all needed voltages to the drive (electronics supply, motion supply)?
With the EncoTRives I some years ago had a little problem. When enabling the drives, the power supply voltage dropped to zero and came back prettty slowly. This caused the drives to wait for a INIT telegram again.
No more ideas. Check the manual and ask the manufacturer.
Rolf
Thanks all for ur info.
I can call a timer to delay every state (example: T#2s) but still just go to Bit6: Switch on Disabled.just when i run codesys, device Enable voltage is gone.
Actaully EncoTrive 24Vdc voltage is ok. As I can run the Drive via Pcan View all time by following.
604 8 2B 40 60 00 06 01 00 00 Response: 584 8 4B 41 60 00 21 06 00 00
604 8 2B 40 60 00 07 01 00 00 Response: 584 8 4B 41 60 00 23 06 00 00
604 8 2B 40 60 00 0F 00 00 00 Response: 584 8 4B 41 60 00 37 06 00 00
So I just run that means EncOTrive Drive has no problem so power or elctricity connection of drive is ok and also canopen connection. I think,there is a mismatch between CoDeSys SP PLC or PDO mapping.
But i dont sure or know that if addition code is needed to communicate between CodeSys to CANopen node like ENCOTrive. I have just write a state_machine code 0x0106, 0x0107, 0x000f with Case..of statement with difineing control word & status word, and also done the mapping of the PDOs.
Thanks
Asif
Strange ...
I had it running on a Beckhoff TwinCAT PLC via CANopen. However, it is long ago, and I do not remember the details just now. The CAN bus is not our standard.
Since you can move the drive via PCan, the wiring and supply are OK indeed. So it seems to be a CoDeSys and/or mapping issue. Unfortunately each PLC maker has a different philosophy to arrange external communication; TwinCAT experience will not help on other PLCs.
Does your bus monitor support telegram filters? If yes, you could trigger control words PLC to drive and analyze the answer. This way you also should be able to detect byte swaps.
Rolf