# swinging motion.

Hello,

I would like to generate a motion that swinging back and forth - a
sine/cosine wave form of motion out of a joint. What would be the best
way to get this motion?

Thanks,
Leng-Feng Lee

Hello Leng-Feng,

The driver type to use for this purpose is the Fourier driver in its
simplest form, i.e. with just a single sine term. Here is an example
that you can try.

Good Luck!
John, AnyBody Support.

// Fourier driver demo model

Main = {

AnyFolder MyModel = {

// Global Reference Frame
AnyFixedRefFrame GlobalRef = {};

AnySeg Seg = {
Mass = 1;
Jii = {1, 0.1, 1}/10;
AnyDrawSeg drw = {};
};

AnyRevoluteJoint Joint = {
AnyRefFrame &ref1 = .GlobalRef;
AnyRefFrame &ref2 = .Seg;
};

AnyKinEqFourierDriver Driver = {
Type = Sin;
Freq = 2;
A = {{0,1}};
B = {{0,0}};
AnyRevoluteJoint &jnt = .Joint;
};

}; // MyModel

// The study. Run the KinematicAnalysis
AnyBodyStudy MyStudy = {
AnyFolder &Model = .MyModel;
RecruitmentSolver = MinMaxSimplex;
Gravity = {0.0, -9.81, 0.0};
nStep = 1000;
};
}; // Main

— In anyscript@yahoogroups.com, “Leng-Feng Lee” <lengfenglee@…>
wrote:
>
> Hello,
>
> I would like to generate a motion that swinging back and forth - a
> sine/cosine wave form of motion out of a joint. What would be the
best
> way to get this motion?
>
> Thanks,
> Leng-Feng Lee
>

Thanks John,

An demo file explain the use of it very well. In future, it will be
great if the reference manual can include a small piece of code to
demonstrate how to use those classes… like you have shown here…

Thanks a lot!

Leng-Feng

— AnyBody Support <support@anybodytech.com> wrote:

> Hello Leng-Feng,
>
> The driver type to use for this purpose is the Fourier driver in
> its
> simplest form, i.e. with just a single sine term. Here is an
> example
> that you can try.
>
> Good Luck!
> John, AnyBody Support.
>
> // Fourier driver demo model
>
> Main = {
>
> AnyFolder MyModel = {
>
> // Global Reference Frame
> AnyFixedRefFrame GlobalRef = {};
>
> AnySeg Seg = {
> Mass = 1;
> Jii = {1, 0.1, 1}/10;
> AnyDrawSeg drw = {};
> };
>
> AnyRevoluteJoint Joint = {
> AnyRefFrame &ref1 = .GlobalRef;
> AnyRefFrame &ref2 = .Seg;
> };
>
> AnyKinEqFourierDriver Driver = {
> Type = Sin;
> Freq = 2;
> A = {{0,1}};
> B = {{0,0}};
> AnyRevoluteJoint &jnt = .Joint;
> };
> }; // MyModel
>
>
> // The study. Run the KinematicAnalysis
> AnyBodyStudy MyStudy = {
> AnyFolder &Model = .MyModel;
> RecruitmentSolver = MinMaxSimplex;
> Gravity = {0.0, -9.81, 0.0};
> nStep = 1000;
> };
> }; // Main
>
> — In anyscript@yahoogroups.com, “Leng-Feng Lee” <lengfenglee@…>
>
> wrote:
> >
> > Hello,
> >
> > I would like to generate a motion that swinging back and forth -
> a
> > sine/cosine wave form of motion out of a joint. What would be the
>
> best
> > way to get this motion?
> >
> > Thanks,
> > Leng-Feng Lee
> >
>
>
>
>
>
>

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com