Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great Work, some improvements #2

Open
elconfa opened this issue Jan 29, 2021 · 12 comments
Open

Great Work, some improvements #2

elconfa opened this issue Jan 29, 2021 · 12 comments

Comments

@elconfa
Copy link

elconfa commented Jan 29, 2021

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

@feecat
Copy link
Owner

feecat commented Jan 30, 2021

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

@elconfa
Copy link
Author

elconfa commented Feb 2, 2021

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

@feecat
Copy link
Owner

feecat commented Feb 4, 2021

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

@elconfa
Copy link
Author

elconfa commented Feb 4, 2021

#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

@dlee99codesys
Copy link

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
Copy link

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

@juki01
Copy link

juki01 commented Nov 1, 2021

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

@feecat
Copy link
Owner

feecat commented Nov 2, 2021

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.

@juki01
Copy link

juki01 commented Nov 6, 2021

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
Copy link

juki01 commented Nov 24, 2021

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

@feecat
Copy link
Owner

feecat commented Dec 7, 2021

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.

@juki01
Copy link

juki01 commented Dec 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants