LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Maxon motor control with LabView

Solved!
Go to solution
Highlighted

Hello everybody, I am new here and I have been trying to learn how to make this process work for a while and I have ran out of options. LabView is very hard to comprehend.

 

I am trying to control a Maxon motor using the epos 24/5 controller. I have a vi that does what I need to do, but I need to find a way to make the process run faster. Basically is going to control a wing that is going to go back and forth at very high speeds. I am not sure what I need to do, also I would like to generalize the process by being a able to input a function or a position wave of my choosing. If any of you all can help me it will be greatly appreciated. Thanks ahead. 

0 Kudos
Message 1 of 14
(3,463 Views)
Solution
Accepted by topic author CarlosUT

CarlosUT,

 

Without the Epos subVIs it is difficult to tell where the slowdowns might be.

 

Consider:

1. The mathscript node is probably much slower than native LabVIEW code, paticularly for what looks like very simple logic.  Replace it with functions from the Comparisons palette.  Also consider intializing the feedback node so you know where it starts when the VI is called.

2. Learn some basic dataflow principles. Your Delay (ms) and Stop controls are read exactly one time at the beginning of execution of the VI and those initial values are passed to the loop. Any later changes in those values will not be seen inside the loop. Move the terminals into the loop.

3. Duplicated code: You have the same subVI in each case of the case structure. Move the subVI outside the case structure and just use the case structure to select which set of values will be used.

4. Since the minimum value of Delay (ms) is 150, the loop cannot execute more than about 6 times per second.  You do not specify what you mean by  high speeds for the wing control, but this may be a factor.

 

Lynn

0 Kudos
Message 2 of 14
(3,444 Views)

Hey Lynn,

 

I appreciate your response, I was able to change the stuff you recomended and made sense that way. Because I am just begining to learn the program, I have a question of how to implement your #1 comment, the mathscript node idea I was helped with, matter of fact everything on the vi I was helped with. What I meant by high speeds is that I want it to flap around at least 30 hz. Thanks.

0 Kudos
Message 3 of 14
(3,438 Views)

Well I was able to follow trhough with all the steps you pointed out even 1. I'm feeling good thank you, I will keep messing with the numbers to see how fast I can get it to the number I need. But if you have any ideas of how can I generalize this to input a position waveform it will be appreciated.

0 Kudos
Message 4 of 14
(3,429 Views)

That should work better.

 

I have no idea how fast the motor and controller can respond.  That is likely to be the limiting factor.  Tp get to 30 Hz, you need to reduce the delay to less than 33 ms and the Move to Absolute Position.vi must execute in less than 33 ms.

 

In general to follow a position profile you will want to create an array of the positions over time.  Then read the array one element at a time and send it to the controller.  The details may depend on how you want to generate or enter the array.  If the position is to be specified every 33 ms, then a simple array will work. If the time intervals vary, you can use a cluster of {time, position} in an array.  Inside the loop you read the array element, wait until the specified time, then update the position and go to the next element in the array.

 

Lynn

0 Kudos
Message 5 of 14
(3,412 Views)

Hi everyone,

I'm just starting to work with Labview (i'm quite new to the software) in order to pilot a Ec-max 40, 70W  maxon motor with GP42 planetary gearhead 74:1. I've mounted the setup comprising maxon motor, EPOS2 50/5 control axis and USB cable to communicate with PC. I used EPOS studio software as well, for setting up motor parameters. Now my big issue is to create a labview vi in order to directly pilot the motor. I've downloaded the maxon epos instrument driver available on maxon motor website but i didn't figure out how to correct use them to run motor.

 

Does anybody can help me in this?? what i mean is to know if anyone have faced same problem before and If you can attach me an example of how to get through.

 

Regards,

Davide

0 Kudos
Message 6 of 14
(2,882 Views)
Hi Davide,

I graduated almost a year ago so I don't think I have my old vis. If you are new to LabVIEW speaking from experience I would try to understand how LabVIEW really works in a high level and low level aspect.

The stuff that max on provides is the basic necessity you need, but it lacks presentation as to how to do it. Unless you have worked with LabVIEW before. Also understand if you try to do anything that requires very fast response USB is slow relatively. At one point I found out the fastest way to use the epos controller was to use LabVIEW to get into the right mode. And use a digital or analog signal to do the control of the motor. Through the ports on the side there is a analog and digital inputs.

I'm my case I believe I was using the 24/5 with a hall sensor and a 3 channel 512count encoder.

Know that maxon provides a lot of documentation that is hard to understand at first, but as you work through it will male sense. I would start at a high level of what you want to do and pick the right control function for the epos controller(there is so many). (Also understand what all of them do even if it sounds hard it may be the better way to go)

After this you begin by getting the controller to the right state. After that you just work your way through it, very time consuming if LabVIEW coding is not second nature and it will click at one point.

Understand that knowing how you want to do it is the key at the begining. In my experience I was trying to do something complicated so I used the encoder to read the position and had the controller do the rest. I just fed it position values all the way through. (After using almost all the options max on provided)

Good luck with it.

(If you know LabVIEW it will be second nature)
(Try to learn what all the high level and low level vis do some times using the vis that maxon created to get it in state is not what you want to do, you may just want one part of it)
0 Kudos
Message 7 of 14
(2,868 Views)

Davide,

 

I found some screen captures, this vi worked really well the only problem I ran into was the I could not adjust for the inertia of what I was controlling so it would  not follow the sinousoidal wave I needed. You can do a similar set up for analog input for position.

 

I highly advise of learning labview properly first, instead of just going at it. As starting small knowing what is going on( a lot of little things) and working your way up.

(i had help in this one so some of the details of the control such as outputting of the digital signal I do not comprehend fully)

 

Carlos

0 Kudos
Message 8 of 14
(2,856 Views)

Hello. Good evening.

 

I am electronic engineering's student and I'm developing a LabVIEW VI to control one EPOS2 70/10 and a brushed DC motor and I use an incremental encoder too.

However when I run the examples provided by Maxon Motor, called MoveToRelativePosition, MoveWithVelocity, MoveWithIPM, DataRecording and GUI Demo, in which I'm basing me to build my Virtual Instrument, the VIs sometimes run, sometimes LabView stop and other times an error occurs in VCS_OpenDevice.

Could you help me solve this problem?

Thank you very much in advance.

0 Kudos
Message 9 of 14
(2,364 Views)

Gabriel,

 

It has been almost 2 years since I used labview, if you follow my schematics i posted as pictures you should at least be able to run the motor.

0 Kudos
Message 10 of 14
(2,351 Views)