Any of you who is using EPOS from MAXON motor and LabVIEW Real-Time might face the same problem with me. The RS232 -IMHO- is not fast enough to achieve real-time communication between the EPOS and RT controller, also I am using the LV-RT for the main program, thus it will be difficult to synchronize between two LVs program from two different computers which mainly caused by the communication overhead. The problem got worse when I knew that we could not download the EPOS dll file onto the RT. After getting my answer from NI forum, I decided to use the CAN Protocol which can reach up to 1Mbps.
For the first trial, we have the IXXAT CAN-USB device. The question is, how to interface USB device to the RT? Because if I use this device, then it will be RT <-> USB <-> CAN, which means that I need a driver for IXXAT CAN-USB for the RT! I emailed the IXXAT company, the engineer replied that they do not support the LV-RT. Anyway I successfully send command through CANOpen with this device on Windows platform, but it took 1 day for me to realize that I need to terminate the final CAN-bus with 120 Ohm. Fiuhh.. alhamdulillah it was working though 🙂
Then we bought the NI-CAN PXI 2 Port from NI with the OPENCan library. I successfully controlled the speed of the BLDC motor with the CANOPen using SDO only, but then I realized that there was a big delay between two SDO commands, which resulted almost 100% error (current speed – desired speed), currently I am going to write a new program by using both SDO and PDO.
I -insyaAllah- will continue this writing and explain briefly about SDO & PDO especially in the case of Maxon EPOS.
Monday, 4/feb/2007 @ 20:52 KST
The definition of CAN and CANOpen can be found by yourself in google :). I will explain briefly what I have learned, the CANOpen method to control the Maxon Motor using EPOS, for more detail you can read the EPOS Application Note: CANOpen Basic Information (pdf).
In EPOS there is an important dictionary (the source of everything), called Object Dictionary Access. It contains the System parameter (e.g. PID tuning value, velocity, etc), the DataRecorder(Encoder counter, etc), and so on. To control the motor, these parameters need to be changed. We can change the value by 3 methods:
- Directly click the field (of the column) and enter the desired value
- Using the Serial communication RS232 protocol
- CANOpen protocol
In the case of 1, you must be joking, but if you want to do it manually, no one can blame on you =P. The 2nd method, I have explained above, that it is not possible if we want to utilize the LabView RT, because there is a dll file which does not support the RT so it can not be downloaded onto the RT, unless you know how to reverse engineer this file and re-write your own code :D.
Now the 3rd method, with CANOpen there are 2 ways of writing the object dictionary access:
#1 is SDO (Service Data Object). It is a confirmed service, means that after you send the command, in between the timeout value you specified, there will be a confirmation packet which contains the value whether you successfully write the object or not.
#2 is PDO (Process Data Object). Opposite to the SDO, it is unconfirmed, thus it is very fast. But as a trade off, there are a “little” work to do, which is the PDO mapping.
At first time, I am using the SDO only, the problem is that, there is a big gap between sending the packet and receiving the confirmation packet, thus it become less real-time and worse, the data is not valid (I am writing a quite time critical program) .
Here’s some picture with SDO only:
If you take a look at the picture above the error looks very big, I guess it is caused by the delay of the SDO packets.
And in the above picture the error is very small with PDO packets.
And here is the video, if you need the code just write me a comment or send an email 🙂
This is an example program to initialize the Maxon EPOS through CANOpen. To be noted that the maxon UI Interface is always on when the lv program is running. Download here (rename the file to become .zip)!
Update: Thu 29/09/2011
Our machine configuration:
NI-PXI 7358 Motion Controller, NI-PXI 6259, NI-CAN PXI-8461/2 + CANOpen Library, Maxon BLDC Motor + EPOS 70/10, DES 70/10
Hello. I am trying to control a few maxon EPOS controllers with LabVIEW 8.5 and CANOpen and I am having a VERY hard time finding examples. Could you please send me an example vi of how you accomplished this?
Good afternoon. I’m trying to control (by now) a maxon’s RE40 with its EPOS 24/5 via CAN, using an IXXAT USB-CAN converter and using LV as a user interface. We are trying to do a force feedback system, so we would like to read the actual position value at the max. freq. possible (1Mbps aprox). The LV block diagram we had, inicializes the EPOS coms using the maxons library (which calls .dll taking so “long time”, reducing the max.freq). How can I access to the position variable using the IXXAT lCAN library? Can both maxons and IXXAT blocks be at the same diagram??
Thanks for eveything. Best wishes,
Jordi
Hi.
Sorry to bother you again, but I cannot find the Demo_WinDLL.vi in my system. Do you have any copy?
I’m trying to read the actual position value of the epos. I’m using the Minimon and the EPOS Command Analizer, I get the code and how it is structured, but I have no idea how to request that value using LV. Bring some light to this mistery!
Thanks again,
Best regards
Jordi
Hi again. So I decided to use LabVIEW RT 8.5 with CompactRIO to run the EPOS, so I can not use the DLL. I also can’t find a CANOpen example. Do you have a suggestion whether to use Channel API or Frame API?
Do I have to buy the CANOpen library from NI??
http://sine.ni.com/nips/cds/view/p/lang/en/nid/202614
Well I found out the hard way that USB and CompactRio CAN cards do NOT support the CANOpen protocol. CANOpen requires a “Series 2” CAN card. Since I require a LV Real-Time embedded controller, I am now switching from CompactRio to PXI. Just thought I would post this in case anyone else searches for this problem. Bondhan, are you still working on your EPOS control program?
Hi everybody!
I have Epos motors from Maxon (Epos 24/1 and Epos 24/5) and I would like to control them from a CompactRIO.
I’ve seen the last Michael reply and I am a little bit worried.
But searching a little in NI’s web, I’ve found the next link:
http://zone.ni.com/devzone/cda/epd/p/id/5474
I haven’t still read it, but it seems that is possible to control Epos motors with a CRIO.
Miachel, have you seen this example?
Has anybody succeeded with Maxon Epos motors and CompactRIO?
Any comments will be welcome.
Thanks in advance
Good to see that your website is back up!
Dani, when I talked to an NI applications engineer about using CANopen on cRIO, he said it is possible, but I would have to program everything from the ground up using CAN. This sounded very difficult from the way he was explaining it to me. It’s almost as if you are programming your own higher-level interface (CANopen) with CAN instead of using the actual CANopen libraries. To me that kind of defeats the purpose of using a higher-level interface.
Bondhan, Dani, feel free to email me at blazingbadger at gmail dot com about anything. Bondhan, I would really like to see your examples that you created if possible. Did you use the “CANopen Wizard” in EPOS_UserInterface?
Dani, I forgot to mention that for cRIO I think you have to use the FPGA to program the CAN interface. My PXI system was actually cheaper than the cRIO because I didn’t have to purchase the FPGA software (or learn how to use it).
Bondhan, thanks for posting your code! I’ll keep you updated on my progress. Hopefully I will see motors working very soon.
Hello,
I’m have final thesis on CanOpen Master with EPOS 24/1 as slave. I tried to configure EPOS 24/1 over RS-232 to control a motor but the motor does not run. I wonder if you ever try to configure EPOS 24/1 over RS-232 and it run.
I wait for your advise.
Thanks in advanced,
PTrieu
Bondhan,
I am also using PXI RT. I keep getting the same error when I try to run your code on my system. 1074388885 error – “No Ack” from the EPOS. Have you seen this before? It doesn’t even get past the CANopen Module Control.vi.
Also, are server COB ID and client COB ID always = x0?
Thanks again for all of your help so far.
I finally got the motors to move! My problem was that I wasn’t setting my CAN bus speed correctly. I eventually figured out that 500,000hz = “2” for the EPOS. I wrote the value in the EPOS GUI, then saved, then restarted the EPOS and it worked fine.
Now I just need to figure out how to read QC from the EPOS…
wah, akh bondan dosen yah ^^ masya Allah.. salam kenal yah ^^ xixixi
Hi , I’m having problems controlling EPOS 24/5 using FPWIN PRO or FPWIN GR (PLC software) , I tried using F171, F172 and F173 to send signal to EPOS 24/5 using the software but the motor does not move at all. Any know how to solve ? thank you so much all.
I want to send data from the computer to the EPOS fast in order to control the position of the motor but the time of the execution of each command is near to 7.5ms. I used the windows 32-bit DLL library of EPOS. This time is very similar when I use RS232 or CAN and the time with CAN should be shorter.
Could you tell me as reducing the time for data transmission? Or
Could you tell me as change the communication protocol to PDO with the same libraries?
The following is a part of the code that I used to stablish the reference in the motor control and obtain the actual position:
m_wNodeId = 1;
if(!VCS_MoveToPosition(m_KeyHandle,m_wNodeId, m_TargetPosition, 1, 1, &m_dErrorCode) )
{
printf(“Error VCS_MoveToPosition 1\n”);
VCS_GetErrorInfo (m_dErrorCode, m_pErrorInfo, m_MaxStrSize);
printf(“Error:%s\n”, m_pErrorInfo);
}
//Read Actual Position
RESULT = VCS_GetPositionIs(m_KeyHandle,m_wNodeId,&m_lStartPosition,&m_dErrorCode);
Thank you for your collaboration.
Hello, I am trying to control two RE10 DC motor with two EPOS 24/1 tied by CAN. How do I interface MATLAB to this setup ? Thanks
Hi
I am trying to control an RE29MAX Motor with an EPOS 24/5 via CAN, using an IXXAT USB-CAN converter and using LV(8.6 demo) as user interface. So far i have copied the maxons library into LV. But I don`t know how to start programming. So i want to ask if you have any example VI wich shows me how to start ?
I thought I’d make you aware of another CANopen example posted on NI’s site recently:
FPGA CAN Engine with CANopen Protocol Reference Example
http://zone.ni.com/devzone/cda/epd/p/id/6093
Thank-you for the other good info on CANopen and cRIO!
Hello all, I have a Maxon EC motor and i want to drive it using the EPOS 24/5 contorller using the RS232 interface using labview.
I want the position control in degrees and also want to read the feed back and convert it into degrees. Can Any one help me out and tell me how can i do this or tell me which documents i have to read for developing a VI which can do this.
I have one more question what does this “qc/turn” mean?
I will be very thankful to you guys for all the help.
To: Websites administrator.
Re: Replacement of domain http://www.ui.edu to http://www.ui.ac.id
Dear Sir,
Greetings from the university of Indonesia.
I would like to inform you that from August 2008, the University of
Indonesia (Universitas Indonesia) has changed its web domain and returned
to http://www.ui.ac.id , based on the consideration that we use Indonesia (id)
domain.
We notice that in your web you have a link to our domain and would be very
grateful if you could change the link in your web to http://www.ui.ac.id to point
to our university.
We appreciate you eagerness to collaborate with us, and look forward for
further collaborative work with University of Indonesia’s member.
Yours Sincerely
Riri Fitri Sari
CIO/ Head of Information Systems Development and services of the
University of Indonesia
7th floor Kampus Baru UI Depok 16424 Indonesia
riri@ui.ac.id
hello bondhan!
I have tried to run the labview example and as well as the GUI provided by the Maxon itself. But i am getting some errors. Can any one please explain how can i remove these errors.
1. when i use the profile position mode i get the motor rotated for two or three times. i dont know how can i attach a picture here so i am writing the values that have been set in that GUI and in the end there is the error.
target position: 1000 qc
Profile type: Sinusoidal
Profile Velocity: 1000 rpm
Profile Acceleration: 10000 rpm/s
Profile Decceleration: 10000 rpm/s
I get the following errors after two or three of execution of the command parameters given above.
Latest Error: Position Sensor Error 0x7320
Second Error: Encoder Resolution Error 0xFF03
I tried to read the details of the errors but i could not understand what they are trying to say.
I set the encoder resolution to 500 cpt and so qc is set to 1000. i dont know how to deal with these errors please guide me so that i can move on.
Hello bondhan,
I m thankful to you for your help. Now i am able to move my actuators to the desired positions but now the new issue is that i want to give my actuators a sine profile for which i have modified the labview example that came from maxon with the motor cd.
but the problem is that i cant go beyond 1.25Hz and the angle for my actuator is only 2 degrees. Can you please tell me is that a limitation of the software or the hardware. i am using labivew 8.5 and maxon EPOS 24/5 drive. when i try to cross this limit my actuator goes out of control can you please help?
I would like to mention one important conversion that i think is necessary.
1600 qc = 1 degree for my actuators systems.
so with this factor i cant go beyond 2 degrees and 1.25 Hz i want to test my actuator’s bandwith and for that i need to take it to 6 Hz with amplitude of 3 degrees may be. Please help me about this.
I would be very thankful for your help.
Hi there,
does anyone have experience with TwinCat (Beckhoff)?
I’m trying to communicate an EPOS with CANopen Terminal EL6751 of Beckhoff over EtherCAT-Bus.
It doesn’t seem to work well. The communication is not stable. There was also a TwinCat-Example on the CD of Epos. But the example was made for a another system, not mine.
Has somebody got it work with TwinCAT (EtherCAT bus with a CANopen Terminal on it)?
PS. I’ve had already the EDS-File of EPOS.
Hi:
I’m trying to comunicate MatLab whit a maxon motor control 4-Q-EC Servoamplifier DES 50/5. how can I do that?, I think I need a driver but I can’t find it, could you please explain?, I’m a student, and I making a my thesis.
I appreciate your time and prompt answer.
Cesar T.
Hi Cesar T.,
This is what I think.
The DES 50/5 has a RS232 Serial interface, which you can read and write with with Matlab. There is also a dll. library of maxon. You can call them from Matlab as well. That should work well. And I don’t think you will need any hardware for that.
Hello there,
i have read your answer on that high frequency issue but that does not give me a clear idea. My gear ratio is 303:1 and tell me one more thing how does this speed in rpm translate to the frequecy in Hz. can you please help me about this.
I am currently specifying only the target position as the input tell me how to give the input velocity and acceleration. please help me out for this
Hello,
I’m trying to control an RE-30 motor via an EPOS 24/5 controller within a simulation loop from the LabVIEW. I’ve been shooting my code back and forth to Maxon and the last answer came back that I have a delay of 60-100ms which is why my motor shakes around and goes crazy, but didn’t tell me how to reduce the delay. Any ideas? Do I have to switch from an RS232 to some other communication method?
Thanks,
Brian
Ha! The Maxon guy just told me I’ve exhausted his knowledge and that I’m on my own. Lovely. I was trying to control current and have become reasonably successful with that. Moving on to position, I’ve used the VCS Set Position Profile and VCS Set Position Must commands and it appears that it simply locks into whatever position the motor is in when the program is started instead of tracking the position commands I send to the motor. Any ideas why?
Hi student!
I am an Italian student and I have to realize a system to check a robot of two wheels with two Maxon motors and Epos.
Excuse for my bad English!
I am curious of your video and I see your blog with a lot of pleasure!
I am a person in love of the automation as you; in my project, I will try to check the two wheels for a thesis in my university. you have used LabVIEW for this experiment and the Maxon UserInterface for the movement. Do you have some material on the movement of both the two wheels?
I use a TRINAMIC PCI CARD for canbus communication, but this isn’t recognized from the maxon UserInterface. I can send single input to my motor, but I think this is very difficult! Any packet has a ID and a DATA but from manual I can’t reach how to do (initially I must check the channel speed, then the communication type etc…). What do you use to set your LabView program?
Thanks,
Mattia
I use a TRINAMIC PCI CARD because i’ve not a IXXAT adapter. So the maxon userinterface do not work in CANOPEN modality.
“I can send single input to my motor, but I think this is very difficult”.
Yes, I can send single data with this form: ID+DATA.
I read the maxon documentation and I understand how to command a motor whit SDO communication.
I think I need a PDO communication because I need to synchronize 2 motors, right?
If you want to synchronize 2 motors, you can do what is called trajectory planning. Giving 2 trajectories profile to the motors and program both in a single timed loop (same loop).
I also wanted to ask how you installed the libraries CANopen. Thanks
I can’t try your example for now because i’m waiting for the IXXAT adapter. Your example in labview need subVI in user.lib\canopen\canopen.lib\
I’ve installed the NI-CAN but there isn’t.
Can you zip and send me this directory?
I’m sorry I am not be able to do that, because that is copyrighted by NI. You can purchase -at my time- for USD$30, which is very cheap
Please note than NI-CAN and CANOpen library are different
Salam, Im ishak from kuala lumpur, Malaysia.
Currently, Im working with EPOS 24/1 with CANopen application. I would like to ask u some parts of my simulink model, Could you pls send me your email n we can discuss details ? Thanks for your help and happy ramadhan.
wa’alaikumsalam. my email: bondhan.novandy [at] gmail.com
Hi Bondhan,
As you describe in your article, I have the same kind of waveform (SDO only) when I use the tool “Data recording” under EPOS Studio 1.40. Do you or anybody else, know how the data is processed with this tool (SDO? PDO?)
Thanks
Hi Bondhan,
i’d like to run my maxon EPOS via CANOpen. I want to try a similar setup like you. Even same EC motor…
Could you please send me your VI you juse in the video above?
Thanks in advance!
Best regards
Michael
Hi Michael,
The sdo is already posted in this article. Since this is already published, I will upload the rest of the code after sometimes. I’ll check on my archives. Hope will find it :p (If I forgot please remind me).
Bonjour
We are going to drive Epos Maxon motor with Matlab. Could you help me?
We have some questions:
Is there exists an EPOS driver in xpctarget (MATLAB)?
I want to work with EPOS in xPctarget(of the matlab toolboxs):
1- Do you have a driver for xPCTarget?
2-Is it possible to use that dll in xPctarget?
3-Is it possible to code its driver in C?
Merci
Cordialement
TURLAN
Paris
Hello, unfortunately I didn’t have any experience in using xPCTarget :(.
I’m trying to move a motor with an EPOS and PX using OpenCan.library. At first i want to move the motor using the EPOS Position Mode. Following the manual to configure this mode i need to set ;
Operation Mode,
Max Velocity,
Max Acceleration
Position Setting Value.
I set those parameters (i cheked with EPOS Studio Object Dictionary Tool), but my motor is not moving yet. the status word indicate as true:
Ready to switched on
Switched on,
Operation enable
Voltage Enable
Quickstop
Do you have any idea how to make the EPOS pass the setting of Position Setting Value to Position Demand Value and in this way start moving the motor?
Muchas gracias por adelantado,
JCC
I have epos2 24/5 and i bought hd67552 for convertin profibus protocol to can because i want to drive my system over PLC (siemens s7-400) do. Does anyone did it with plc before? I need example codes. tryed all combinations to send to driver but nothing happened. all connections and pdo mappings are ok. but i couldnt realize the data mapping
hi’
i have a EOPS24/5 driver and EC 60 Flat 100 watt motor from maxon.
How can I set degree value from qc value?
hi can i get your sample code?
Hi Aliff, please look at the end of this article.