View unanswered posts | View active topics It is currently Wed Oct 01, 2014 8:17 am






Reply to topic  [ 3 posts ] 
Best way to fine control motors 
Author Message
Rookie

Joined: Wed Nov 12, 2008 11:27 am
Posts: 3
Post Best way to fine control motors
Which of these is the best way to have fine/precise control of the motor. My aim is to move exactly 50 degrees clockwise and then anti-clockwise repeatedly without progressive drifting of the start/stop positions.

In both cases:
- speed regulation is on
- brake mode is on
- motor power is about 50%

Option 1:

Variable = target encoder value
Start motor
Loop
Is motor encoder at target value?
Yes, exit loop
Stop motor

OR option 2:

Set motor encoder target = target encoder value
Start motor
Loop while motor power is greater than zero

Thanks,


Wed Nov 12, 2008 11:39 am
Profile
Rookie

Joined: Wed Jun 25, 2008 6:07 pm
Posts: 46
Post Re: Best way to fine control motors
Gravyuk,

There is also a "nMotorRunState[]" variable you may want to look into. It tells you what the motors are up to -- in particular, you can check to see if they're idle or in a 'hold' position. You would use it along with a specific encoder target. Unfortunately, sometimes they never quite hit idle if they are under high strain.

You may find this post interesting as well.


Wed Nov 12, 2008 12:22 pm
Profile
Rookie

Joined: Wed Nov 12, 2008 11:27 am
Posts: 3
Post Re: Best way to fine control motors
The reason I ask is I haven't got what I would consider perfect control and common sense dictates that I should use option 2 as it use less code as it relys on firmware, but then again I have seen the other method in various code examples so I wondered what the best way was.

What I need ultimately is the simplest code that turns and exact number of degrees reliably.

G


Wed Nov 12, 2008 12:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.