From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sinusoidal Linear Actuator Control - Help Needed

Hi,

 

I am trying to get a linear actuator (Haydon-Kerk Ametek 3H4A-2.33-815) to move with sinusoidal motion but am unable to figure it out using the driver files provided to me by the company I ordered from.  The IDEA drive is Haydon-Kerk Ametek PCM4826E-K. The communications manual here (https://www.haydonkerkpittman.com/-/media/ametekhaydonkerk/downloads/products/drives/idea_drive_comm...) provides the command sets for use with this drive.

 

I have been able to get the linear actuator to move in one direction, either forward or backwards, until I hit the stop button or until it reaches its max/min position.  The problem I am having is trying to get it to perform continuous movement going forward and backward in a cyclic regime until I hit the stop button.  After talking to several people experienced in LabView, they seem unsure whether this is possible using the files provided by the company which I have attached in a zip file below.  It includes 5 .vi files for different functions  (read, write, parse position, parse max current, and find drive) and a sample program that combines all of these functions.

 

I have also attached a .vi file called "While_Loop_Movement" which moves the linear actuator with the 'M' command to a specific position.  I programmed the loop to read out the position of the actuator before the loop is executed and after the stop button has been pressed. 

 
The Case_Structure_Movement .vi file has three 'cases' for the linear actuator to move: forwards (using the 'M' command), backwards (using the 'M' command), and a default stop case (using the 'E' command). 
 
While these modified files do work in moving the actuator, they are mostly a result of me messing around with the original files Ametek provided in order to get the actuator to move.  Please note that the 'positions' referenced with the 'M' commands are all relative, and not absolute.  I currently do not know how to get an absolute position value.
 
Ideally, the goal is to get the actuator to move in a sinusoidal motion and to be able to control the displacement amount as well (in millimeters).  Furthermore since I am not sure how to obtain an absolute position value from the actuator I am not sure how to control the displacement (as it is reading in as bytes and it is not saving its previous position before executing the next movement; the actuator just moves a distance relative to where it was already at).

 

If anyone could help with (1) the problem of getting sinusoidal motion rather than movement in one direction or (2) the problem of how to get an absolute start position and tell the actuator to move an absolute number of steps it would be greatly appreciated!  Thanks

0 Kudos
Message 1 of 5
(2,571 Views)

My guess is you do not have a linear actuator well-suited for the task you wish to do.  This device appears to be designed for a simple "Move" command, largely without feedback control (i.e. "open-loop").  Note the warnings at the beginning of the manual.  What I think you want to do is to have the motor work in "position-feedback", essentially following a signal (voltage) that specifies the position of the motor.  Many motors function in velocity mode -- the more "juice" you give it, the faster it turns, so you need a position sensor and position feedback (and logic) to "synthesize" a Position Mode.

 

Bob Schor

0 Kudos
Message 2 of 5
(2,531 Views)

Hi,

I just started a project using the IDEA drive with a stepper and it appears you should be able to do what you want to do with the command dictionary provided in your link. You'll have to build your own VI's to fully implement their command dictionary but there aren't many commands so it should go quick.

 

The manual states that you get actual position if you have an encoder:

Description
This command requests the position of the motor either theoretical, or actual if an encoder is enabled.

 

I think you could clear the encoder then move your actuator using the move or index command while polling it using the 'o' or 'I' command and when you read that the movement has stopped you would command the motor to move back to it's starting position then repeat the process.

 

Alternately your could use the program functions and IO lines to self trigger an interrupt on end of movement causing the program to reverse direction and go home then repeat the process.

 

Hope this helps.

0 Kudos
Message 3 of 5
(2,495 Views)

Could you clarify what you mean when you say "clear the encoder."  Does this mean set position to 0 or just not use the encoder at all?

 

For the code, I was going to set an initial position labeled as 0, tell the motor to move (extend) a certain amount of mm (using the M command), then trigger an interrupt that makes the actuator return to the initial position labeled as 0 and put all of that within a while loop so it gets repeated until stopped.  Does this sound like what I would need to do or am I missing anything important?

 

Also, after reading the communications manual, I keep seeing that a subroutine is needed for an interrupt but I can't find where it shows how to create a subroutine and name it.  Do you know anything more about this?

 

Thank you so much!

0 Kudos
Message 4 of 5
(2,480 Views)

Hi,

If your motor has an encoder, clear the encoder count to zero counts while parked at your home position.

It would be helpful to add a home limit switch and a full travel limit switch to your setup as well in case you lose control of the motion, you would need to use two of the digital inputs for that.

 

It appears you can do what I mentioned before and add the switches as I mentioned above by using their drive programming software tool here:

https://www.haydonkerkpittman.com/learningzone/ideadrivesoftware

This tool allows you to set up the drive parameters, assign inputs and outputs on the digital IO lines and write a program that can loop and call subroutines on the drive that you define with the tool.

In fact, depending upon the requirements of your application you may be able to implement your motor task without LabVIEW or any other software driven external control because you could implement subroutines on the drive to start and stop based on the state of the limit switches and an additional mechanical start/stop switch wired to one of the unused digital inputs.

 

Hope this helps and good luck!

0 Kudos
Message 5 of 5
(2,464 Views)