Commanding Maxon Motors EPOS2 Motor Controller From MATLAB - File Exchange - MATLAB Central
Commanding Maxon Motors EPOS2 Motor Controller From MATLAB - File Exchange - MATLAB Central
File Exchange
In Linux:
- Download and install in the system the libraries: libEposCmd.so and libftd2xx.so
http://www.maxonmotor.com/medias/sys_master/root/8815100330014/EPOS-Linux-Library-
En.zip
In Windows:
- Download and install EPOS2 USB driver following the link,
http://www.maxonmotor.com/medias/sys_master/root/8811482415134/EPOS-USB-Driver-
Installation-En.zip
- Download and copy to directory "Epos2Windows" the files,
EposCmd.dll, EposCmd.lib
EposCmd64.dll, EposCmd64.lib
vxlapi.dll, vxlapi64.dll
http://www.maxonmotor.com/medias/sys_master/root/8815100133406/EPOS-Windows-DLL-
En.zip
2) Next, compile the files calling the script "Make". The script requires that "mex" was
properly setting up.
Example of use:
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 1/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
Files "test_epos.m" and "test_epos2.m" contain some example of controlling EPOS2 Motor
Controller.
Examples:
Examples:
From "test_epos.m",
>> a = OpenCommunication;
Connecting to node 1
Setting Node 1 to "Profile Position" type >> help SetOperationMode for further information
Stop
Close
>> CloseCommunication(a);
Motor1 = Epos2(1);
If (Motor1.IsInErrorState)
Motor1.ClearErrorState;
End
Motor1.EnableNode;
Motor1.SetOperationMode( OperationModes.ProfilePositionMode );
Motor1.MotionInPosition( 132000 );
Motor1.MotionInPosition( -132000, 4000, 6000, 1);
Motor1.Stop;
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 2/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
delete Motor1
ivan riaño im using matlab 2018 and work perfectly, the errors described before sounds like you are
19 Mar 2018 not adding the .dll and .lib files to the "Epos2Windows" folder
Pedro Same problem as gergely and Cheng again. Any ideas? Thanks!
Muñoz
12 Jul 2017
T_R
17 Jan 2017
Cheng Yuen I also have the same problem as gergely.. Could you pls help? Thank you!
Ong
20 Dec 2016
Plus a ton of other error in communication within the Definition.h file. Please let me know.
Thank you for your help, much appreciated. I also have EPOS 24 not EPOS P. Does that
matter just to retrieve position information?
behzad
3 Aug 2016
Thanks a lot.
Vahid Hi,
Mehrabi
27 Apr 2016 I have a problem in making the code in MATLAB UBUNTU. It gives me error as below:
/Epos2/Epos2/OpenCommunication.c:12:23: fatal error: Win2Linux.h: No such file or
directory compilation terminated.
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 3/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
Requires
MATLAB
MATLAB Release
MATLAB 8.2 (R2013b)
Tags
epos2 motor contr...
Cancel Save
Acknowledgements
Inspired: EPOS2 Support for Simulink Coder in Linux and Raspberry PI
Learn more
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.
» Watch video
Epos2/
Clean.m
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 4/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
ClearErrorState(handle,delete *.mexa64
delete *.mexa32
nodeid) delete *.mexw32
delete *.mexw64
CloseCommunication(handle)
DisableNode(handle,
nodeid)
EnableNode(handle,
nodeid)
Epos2
FindHome(handle,
nodeID, type)
GetCurrent(handle,
nodeid)
GetErrorState(handle,
nodeid)
GetObject(handle,
nodeID,
Index,...
GetOperationMode(handle,
nodeid)
GetPosition(handle,
nodeid)
GetVelocity(handle,
nodeid)
HommingMethods
IsTargetReached(handle,
nodeid)
Make.m
MoveToPosition(handle,
nodeid, p...
MoveWithVelocity(handle,
nodeid,...
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 5/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
OpenCommunication
OperationModes
QuickStop(handle,
nodeid)
SetCurrent(handle,
nodeid, value)
SetObject(handle,
nodeID,
Index,...
SetOperationMode(handle,
nodeid,...
SetPosition(handle,
nodeid,
pulses)
SetProfilePositionData(handle,
n...
SetProfileVelocityData(handle,
n...
SetVelocity(handle,
nodeid, velo...
test_epos.m
test_epos2.m
WaitForTargetReached(handle,
nod...
waitfortreal(tsim)
Epos2/
TestCurrentMotor.slx
testMaxonMotors.slx
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 6/7
18/04/2018 Commanding Maxon Motors EPOS2 Motor Controller from MATLAB - File Exchange - MATLAB Central
mathworks.com
© 1994-2018 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or
registered trademarks of their respective holders.
https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab 7/7