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

OpenSML_Axiscontroller axis not enabling #6

Open
RinMa89 opened this issue Jan 18, 2024 · 1 comment
Open

OpenSML_Axiscontroller axis not enabling #6

RinMa89 opened this issue Jan 18, 2024 · 1 comment

Comments

@RinMa89
Copy link

RinMa89 commented Jan 18, 2024

Hi,

This is the first time i use Github for bug report so forgive me if i am not doing it wrong.

I noticed a small bug in the latest OpenSML.library V1.9.

When using the OpenSML_Axiscontroller FB the first time after starting the controller.
At STEP 10 of the state machine the axis gets disabled because the mode of operation has to be set first
there is a line to enable the axis again after operating mode = 8 but because the axis was enabled first the Axis.StatusWord.2 is still true and the state machine steps to STEP 20 before the axis is enabled again.

see the code change i made to fix this:

10://Set Mode
	Axis.Modes_of_operation:=8;//Cyclic Synchronous Position Mode
	Axis.ControlWord.3:=Axis.Modes_of_operation_display=8;//Success change mode, enable operation
	otg.CurrentPosition:=DINT_TO_LREAL(Axis.Position_Actual_Value) / Control.Scale;//Write actual position to otg
	IF Axis.StatusWord.2 **AND (Axis.Modes_of_operation_display=8)** THEN//Operation Enabled
		iState:=20;
	END_IF

I made another change to be able to change the cycle time of the otg FB, it was fixed to 0.01...

	otg(
		ControlInterface:= InterfaceType,//ControlInterfaceType.Position , 
		TargetPosition:= Control.lrFollowPosition , 
		TargetVelocity:= JogVel , 
		TargetAcceleration:= 0 , 
		CycleTIme:= **Control.CycleTime**,//was 0.01
		MaxVelocity:= MoveVel,//Control.para.MaxVelocity , 
		MaxAcceleration:= Control.MaxAcceleration , 
		MaxJerk:= Control.MaxJerk);//accept new position and going on

BR,
Rinie

feecat added a commit that referenced this issue Jan 18, 2024
@feecat
Copy link
Owner

feecat commented Jan 18, 2024

Hi Rinie,

Thanks for your feedback, Good suggestions. Please check newest V2.0.
Also this enabling bug will happen on othermode, i had patch it.

Thanks.

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

2 participants