Phidget motor control + Ph encoder + Ph Spatial 3/3/3

Post any examples or modules that you want to share here
Post Reply
leonhernando
Posts: 4
Joined: Tue Dec 07, 2010 2:05 am

Phidget motor control + Ph encoder + Ph Spatial 3/3/3

Post by leonhernando »

Dear developers

I am trying to move a linear motor (attached in one end) like a lifting mechanical pendulum (where the linear motor have to changes in different angles).
I am comparing the position of the encoder (which is in one of axis of the mechanism) and the ph Spatial 3/3/3 (is the given position). The idea is measure the angle of the linear motor and goes to a pre-setup position or given angle. So if the value of the encoder is relative equal to the ph spatial (roll) the motor control should stop moving. If the value is different the motor should move increase or decrease the angle to meet the selected angle.

Could you please give me any idea how to do it?
Or if you could give a hand with one example, I’m really appreciated.
I have try, but still not quite on track...

Thanks you

hernando
DSP
Posts: 150
Joined: Fri May 14, 2010 10:55 pm

Re: Phidget motor control + Ph encoder + Ph Spatial 3/3/3

Post by DSP »

Basically what you need to do is use the FlowStone PID module:

Example: http://www.dsprobotics.com/support/viewtopic.php?f=11&t=32

You can learn about PID on Wikipedia if your not sure, but basically it allows you to have a target position and an actual position, then the PID algorithm will move the motor until it reaches the target, smoothly and with no overshoot.
Post Reply