OpenSML icon indicating copy to clipboard operation
OpenSML copied to clipboard

Great Work, some improvements

Open elconfa opened this issue 5 years ago • 12 comments

Congratulations on this project! I have prepared the OpenSML_TC3.library file to be able to use your great work with Twincat. I have addes OpenSML_Status OpenSML_TC3.zip

In the "OpenSML_ProfilePosition" function it would be possible to add xAdditive to add a distance relative to the current position?

I'm also waiting for the Jog function and Probe.

Thanks Massimo

elconfa avatar Jan 29 '21 09:01 elconfa

Hi Thanks for you library file.

You can set xRelativeMode:=TRUE to enable relative move. it will calc in servo driver. write code like this:

rt_Additive(CLK:=xAdditive); //<- This is R_TIRG
ProfilePosition_X(
	Axis:=Axis_X , 
	xEnable:=xMoveEnable , 
	xExecute:=xMoveExecute OR rt_Additive.Q , 
	xContinueMove:=FALSE , 
	xRelativeMode:=TRUE ,  //<- Set TRUE to use Relative Mode
	diTargetPosition:=diTarget , 
	udiProfileVelocity:=udiVel);

Currently i dont have servo driver for program test, But i think you can use SyncVelocity to create jog mode. just be careful. Probe function is depend on servo driver, different servo driver have different probe function, I dont have idea about this for now. maybe we need a lot of people take some servo drive for program test.

Thanks

feecat avatar Jan 30 '21 02:01 feecat

I worked with SML library and I have found some trouble. I fixed all FB and tested: OpenSML_Home OpenSML_Power OpenSML_ProfilePosition OpenSML_ProfileVelocity_Jog OpenSML_Reset OpenSML_Status OpenSML_Stop

All seems to work good. For people I upload Library for Twincat and Library for Codesys OpenSML-master.zip

I'm glad to hear your opinion. Thanks

elconfa avatar Feb 02 '21 13:02 elconfa

Hi In you profilepositon if you continues move it take more time( iState change with 0 and 10\20\30), but i think its also good in actual use. Another problem is profile acc/dec not default on in device description file, Some plc software need manually add or even cant add it, only set it on servo commissioning software or manually create pdo write function, so in my code its didnt write.
Im suggest to read keba servoone usermanual, its best document of cia402 that i had see.

But you shared the library that could be useful, Great thanks.
And if you agree, can i add you library link into this repositories readme.md? If someone want they will quickly found library file, just import and test.
Thanks

feecat avatar Feb 04 '21 03:02 feecat

#And if you agree, can i add you library link into this repositories readme.md?

Yes, you can. I will check your suggestion. Thanks a lot. Massimo

elconfa avatar Feb 04 '21 07:02 elconfa

Hi feecat, I stumbled on your project and looks very promising. But I was not able to import the library into Codesys 3.5SP11Patch4. There was an error "Failed to open managed library. Reason: The project handle 122 is invalid." Something I am doing wrong? Dik

dlee99codesys avatar Apr 10 '21 00:04 dlee99codesys

Never mind, Copied an pasted the code into the program and now it works. Thank you very much!

dlee99codesys avatar Apr 11 '21 11:04 dlee99codesys

Hello Feecat , Hello Elconfa , Hello dlee99codesys, am (beginner) dealing with the OpenSML Lib. I have successfully included the library in my Codesy project. To my Ethercat driver I added a SML CiA402 servo axis and renamed it as Drive. I added the OpenSML_Power block and assigned the inputs/outputs. I declared the axis input/output as Drive. During compilation this error is displayed C0201: Type 'SML_Drive_ETC.Axis_REF_ETC_DSP402_SML' does not match the type 'OpenSML_Axis' of VAR_IN_OUT 'Axis'.

Do you guys have any idea what I am doing wrong?

Many thanks and greetings Juki01

juki01 avatar Nov 01 '21 14:11 juki01

Snipaste_2021-11-02_14-25-59

OpenSML_Demo_SGD7S.zip

Hi @juki01 Here is a simple example for YASKAWA SGD7S servo driver, I had use it in real project. As you can see, Standard softmotion axis is license protected in codesys, so just create variables and connect it to input/output mapping in OpenSML, then it works.

feecat avatar Nov 02 '21 06:11 feecat

Hi feecat, thanks for your quick reply. It has helped me. At the moment I'm still struggling with the Power FB :( . I would get back to you if I can't get it to work.

Thanks again for your help.

Greetings juki01

juki01 avatar Nov 06 '21 09:11 juki01

Hello feecat, I have a problem with the OpenSML_ProfilePosition FB. It is about the position accuracy. When positioning, the current position deviates from the set position by 3-4 increments loses per positioning. With the Codesys SML-Leicht FB in demo mode, the drive positions exactly. In the SMLOpen program, exactly the same parameters of the drive are set as in the Codesys SML-Light program.

Do you have an idea what this could be?

With kind regards juki01

juki01 avatar Nov 24 '21 11:11 juki01

Hi @juki01 Sorry for late. You should check "Target Position" and "Position Actual value" in device i/o mapping, Refer to the previous screenshot. The fieldbus drive never got increments loses in my tests. Did you are use Relative mode? it calc in servo (openSML Library), so maybe it takes problem.

feecat avatar Dec 07 '21 08:12 feecat

Hi feecat, thank you for your answer. As always, is the first look for the mistakes of others :( !! Your SML-FB blocks are o.k. ! I had not set the Inpos parameters of the drive correctly. After correcting the parameters, the drive positions exactly to the increment. Thanks for your help.

juki01

juki01 avatar Dec 10 '21 15:12 juki01