Hi, I have an X20SM1436-1 with which I want to control a stepper motor without any form of feedback.
The idea would be to do a calibration everytime before operation by moving the actuator to a set position which will trigger a digital input to confirm it’s reached, and from there just count the steps.
I’ve setup my motorwith mappMotion and I’ve been trying to move it useing MpAxisBasic library but with no results. I haven’t found any examples of stepper motor control without feedback so I’m a bit confused on the programming part, any suggestions or help?
Hello,
In the Configuration of the SM1436-1 there should be this line were you can set up the Feedback / Encoder Link. If you set it to no encoder the system knows that there is no feedback and just generates a set value for the movement.
On the Programming Part there is no differences.
I would also hint to read the Guide which contains a lot of information about how to commission a stepper axis. The most important part is that you configure the timing of SystemTimer and X2X/Powerlink in an synchron way.
Greetings
Michael Bertsch
I set up the axis object, configured the SM card with it, and configured the SystemTimer and X2X/Powerlink both at 1000us without tolerance.
Then when using MpAxisBasic I just wanted to enable it and see “MpAxisBasic.info.communicationReady = TRUE”, instead I get an error “mcAXIS_ERR_MPLINK_CORRUPT”.
the code I wrote is literally only:
PROGRAM _INIT
MpAxisBasic_0.Enable := 1;
MpAxisBasic_0.MpLink := ADR(axis_1);
END_PROGRAMPROGRAM _CYCLIC
MpAxisBasic();
END_PROGRAM
Hello,
your Program looks quite well. You only missed the Parameter reference but up now this is not relevant.
Local Variables
Declaration of Axis
PROGRAM _INIT
MpAxisBasic_0.Enable := TRUE;
END_PROGRAM
PROGRAM _CYCLIC
MpAxisBasic_0.MpLink := ADR(gAxis_1);
MpAxisBasic_0.Parameters := ADR(MpAxisBasicPar_0);
MpAxisBasic_0();
END_PROGRAM
The Axis Reference Variable contains some Adress Information to the System and is only filled with data during start up of the motion system.
So if you did your first Transfer, and the plc did not restart, the entry of the Variable is empty. This will lead to the descriped error.
Solution is just do a restart of the PLC to bring the motion system through startup.
You can have a look into the contend of the Axis-Reference.
The initialised data should look like this… the numbers can be differend as they are pointers to internal memory.
If you make a transfer and the only task using this variable gets deleted, the contend of a global variable can be lost. To prevent this, i generate a dummy Task only containing the Axis-References. So this task is unlikly to change and the variable is used by more than one task.
PROGRAM _INIT
gAxis_1;
END_PROGRAM
Greetings
Michael
apparently the problem is that the content of the axis reference is alway null:
I’ve tried creating a dummy task with only an init program that calls for my axistype but nothing, still empty. tried also restarting the PLC, still nothing.
Hello,
-
Check that the used axis reference has the same name as the configuration object defines.
-
Did you set up the AxisReference at the SM-Hardware Module Configuration
-
Check that the library McStpAx is part of the project.
-
Check logger for messages about the axis
Greetings Michael