mbs examples for CANopen
6 years 10 months ago #29532176
by jajek
mbs examples for CANopen was created by jajek
Hello
Anybody using motor drivers with CANopen ?
Any practical example of microBasic script(s) for interfacing CANopen ?
Thanks
Anybody using motor drivers with CANopen ?
Any practical example of microBasic script(s) for interfacing CANopen ?
Thanks
Please Log in or Create an account to join the conversation.
6 years 10 months ago #29532177
by blake
Replied by blake on topic mbs examples for CANopen
The following user(s) said Thank You: jajek
Please Log in or Create an account to join the conversation.
6 years 10 months ago #29532178
by jajek
Replied by jajek on topic mbs examples for CANopen
Any microbasic scrip examples with PDOs ?
Please Log in or Create an account to join the conversation.
6 years 10 months ago #29532181
by jajek
Replied by jajek on topic mbs examples for CANopen
I set CAN mode to "CANopen". Device periodically sends TPDOos with time delays as configured.
But it looks to me that drive does not hear SYNC message (CAN ID 0x080, no data bytes) when it is sent over the bus. It does not "double" send any of TPDO messages and it looks that script does not "hear" SYNC messages in general.
Can microbasic script also receive CAN messages in CANopen mode? Can it send CAN frames in this mode?
But it looks to me that drive does not hear SYNC message (CAN ID 0x080, no data bytes) when it is sent over the bus. It does not "double" send any of TPDO messages and it looks that script does not "hear" SYNC messages in general.
Can microbasic script also receive CAN messages in CANopen mode? Can it send CAN frames in this mode?
Please Log in or Create an account to join the conversation.
6 years 10 months ago #29532183
by niko
Replied by niko on topic mbs examples for CANopen
Hello,
Unfortunately, currently all TPDOs are configured as asynchronous and are initiated tight away the configuration of CANOPEN. THerefore the transmission type cannot be changed using the repsective SDO and thus the SYNC feature is not working as it should.
In order to fix this, firmware modification is neccesary. Please let us know what is your issue and why you need SYNC in order to figure out a workaround.
Unfortunately, currently all TPDOs are configured as asynchronous and are initiated tight away the configuration of CANOPEN. THerefore the transmission type cannot be changed using the repsective SDO and thus the SYNC feature is not working as it should.
In order to fix this, firmware modification is neccesary. Please let us know what is your issue and why you need SYNC in order to figure out a workaround.
Please Log in or Create an account to join the conversation.
6 years 10 months ago #29532184
by jajek
Replied by jajek on topic mbs examples for CANopen
We need SYNC feature to have optimal CANopen bus load and quick reaction time. Also SYNC appraoch shall gather status information from motors at closer time point. In our robot we have one CAN bus for 10 nodes. 8 of them are motors that work in parallel. With periodical/asynchronous TPDOS there will be slower response time and longer motor control loop, therefore, robot would need to move slower or it would be less precise. SYNC feature optimizes the performance in efficient way.
Please Log in or Create an account to join the conversation.
6 years 10 months ago - 6 years 10 months ago #29532190
by niko
Replied by niko on topic mbs examples for CANopen
1 work around could be the following:
Increment the value of one VAR by sending the respective SDO command. Let's say VAR 1 (so index ox2005, subindex 0x01).
Write a script with which you will check every 2ms if this value has changed. If so set CTPS to 0. This action will trigger TPDOs to be sent once.
The latency from receiving the SDO command and sending the TPDO is 1ms. Is this adequate to your specifications?
Check the script below:
prevvar1 = getvalue(_VAR,1)
top:
currvar1 = getvalue(_VAR,1)
if(currvar1 <> prevvar1) then
setconfig(_CTPS, 1, 0)
'setconfig(_CTPS, 2, 0)
'setconfig(_CTPS, 3, 0)
'setconfig(_CTPS, 4, 0)
end if
prevvar1 = currvar1
wait(1)
goto top
Increment the value of one VAR by sending the respective SDO command. Let's say VAR 1 (so index ox2005, subindex 0x01).
Write a script with which you will check every 2ms if this value has changed. If so set CTPS to 0. This action will trigger TPDOs to be sent once.
The latency from receiving the SDO command and sending the TPDO is 1ms. Is this adequate to your specifications?
Check the script below:
prevvar1 = getvalue(_VAR,1)
top:
currvar1 = getvalue(_VAR,1)
if(currvar1 <> prevvar1) then
setconfig(_CTPS, 1, 0)
'setconfig(_CTPS, 2, 0)
'setconfig(_CTPS, 3, 0)
'setconfig(_CTPS, 4, 0)
end if
prevvar1 = currvar1
wait(1)
goto top
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds