Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a program to control a servo motor

I am new to LabView. I have never programed any kind of motor before.

 

My project involves creating a vibration machine by rotating an off ballanced eccentric mass. I will be doing this with a servo motor. I need to build a program to accelerate the motor to a specified speed, then decelerate back to zero.

 

The equipment I have is:

 

-LabView Softmotion

-NI cRIO-9076

-NI 9514

-AKD P00306 Drive

-AKM 13D Servo Motor

 

I have followed the "Getting Started with NI....." tutorial and successfully got the motor working on test bench. I have also downloaded the "Axis Straight Line" sample program and got it to work on the motor. Now I need to create my own program, or edit an existing one.

 

Creating the front panel does not seem overly complicated to me, but the block diagram part has me puzzled.

How should I get started?

0 Kudos
Message 1 of 7
(5,182 Views)

RyleyD,

 

It sounds like you already have the motor moving, which is the toughest part!  Now that everything is set up, performing a velocity move in SoftMotion is pretty easy.  You can use the same Axis Straight Line example VI, but change the move mode on the Straight Line Move Express VI to be "Velocity".  This allows you to specify a velocity setpoint, as well as accel and decel parameters.  The axis will accelerate to the specified velocity, then hold that velocity until you tell it to stop, an error occurs, or a new velocity setpoint is given.

 

A couple helpful resources:

 

http://zone.ni.com/reference/en-XX/help/371093T-01/nimclvfb/exstraightlinemove_00a10023/

http://zone.ni.com/reference/en-XX/help/371093G-01/nimclvfb/straightlinemove.mode_00a10014/

 

Good luck!

Cody A.
0 Kudos
Message 2 of 7
(5,168 Views)

I am trying to write two programs. One will take measurement from mounted strain gauges and display the pressure from the gauge is a simple graph over time. 

 

The other program needs to measure acceleration and frequency of a test specimen. I am familiar with mounting the strain guages, but I am very confused on how to write the program. 

 

Any suggestions?

 

Thank you.

0 Kudos
Message 3 of 7
(5,079 Views)

What exactly are you trying to accomplish?  What hardware and software do you have?

 

Also, if this is a DAQ related question, I would recommend starting a new Forum Thread on that board.  You'll likely get more input there.

Cody A.
0 Kudos
Message 4 of 7
(5,057 Views)

Hi.,

   I'm also facing the same problem, i've done my code to run the motor using user guides and manual but what i need is "To run the motor under certain conditions

1. move from one position to another and reverse continuously(looping)

2. two motors at the same time but one is x distance extra from the other

0 Kudos
Message 5 of 7
(3,898 Views)

Hi pranav8991,

 

Thanks for posting on the discussion forums to get help with your servo control and LabVIEW. I noticed you had postedover at http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/To-control-motorized-worm-drive-rotation-sta... a few days ago but no one responded. In order to most efficiently use the Forums, we recommend you keep all correspondance in one thread. In light of this, I'll go answer your questions over there, especially because this forum post is about a year old and concerning a different servo drive than the one you have.

 

Thanks!

Austin H.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 7
(3,861 Views)

fine..,

0 Kudos
Message 7 of 7
(3,848 Views)