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.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Circular motion as a function of time

Hi guys.

 

Currently i'm trying to control the "Stage" movement of an optical tweezer set. I am able to achieve x and y-axes control. Moving on, I hope to achieve a circular movement.

 

As of now, I'm getting the x and y values from the (Marz Get Pos SubVi) and subsequently i control the radius (R) manually through my front panel.

 

To make it move around in a circular motion, I created a feedback loop of an increment function to supply value (A) in terms of radians (As the Cosine/Sine function only accepts radians values) into the Cosine and Sine function which is my new x= RCos^A while my new y= RSine^A. 

 

Finally, I was hoping to change this A in term radians setting the circular motion, i want it to be a function of time. When i set a value of t=2s, my program must be able to tell me the location of x and y at t=2secs. 

 

As attached is my connection so far, kindly enlighten me on how i could convert using radians into time instead. Thank you in advance. Feel free to ask any questions.

 

Best Regards,

Scott 

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

If you want to specify your movement as a function of time you will have to input velocity into your equation as well.  If you want constant velocity then your problem is relatively simple.  If not, then you will need extra code to generate the velocity profile.

 

Assuming you want constant velocity you can use the equation  x=R*cos(V/R*t) and y=R*sin(V/R*t), where V is the linear velocity.  This equation comes from cos(w*t) and w=V/R where w is the angular velocity.  Just make sure the units of your linear velocity and the units of your radius match up and you should be fine.

 

I'm assuming that's what you were looking for.  Not 100% sure though.  Let me know if I went down the right path.

 

Garrett

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