View unanswered posts | View active topics It is currently Fri May 24, 2013 1:14 am






Reply to topic  [ 2 posts ] 
Starting motors slowly? 
Author Message
Rookie

Joined: Sun Sep 18, 2011 2:20 pm
Posts: 8
Post Starting motors slowly?
Are you able to make the motors start slowly instead of the initial jerk...which can cause my robot to not start straight? Like a ramp up kind of speed change. Thanks, new to the forum, looking to learn!


Sun Sep 18, 2011 2:29 pm
Profile
Expert

Joined: Wed Jun 30, 2010 7:15 am
Posts: 179
Post Re: Starting motors slowly?
You can use a for loop like this:
Code:
task main(){
  int i;
  int final_speed = 100; //change this to the final speed you want your motor to end up at
   
  for(i=0; i<final_speed-1; i++){
    motor[motorA] = i;
    wait1Msec(20);
  }
  while(true){
    motor[motorA] = final_speed;
  }
}

This way, the motor will take up to 2 seconds to gradually build it's speed.

_________________
leonoverweel.com


Sun Sep 18, 2011 3:13 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 6 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.