Motor Ticks

6 replies [Last post]
Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

Hi everybody. This is Harrison. I was wondering exactly how many ticks are in one rotation? I have heard many rumors about the amount being about 1100, but I haven't gotten any confirmation on that. I do know that the speed range for the motors is like 0-1000 ticks per second.

Thank you for your help!

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

Also, how do you format the function "curr_pos" to recieve the current position of the motors?

Thanks!

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 2 years 29 weeks ago.

Please edit posts rather than double-posting if the original post was recent.

There is no exact value for ticks/revolution; it depends on the electrical properties of the motor. The black motors in Botball are somewhat close to 1100, but this varies by individual motor.

The maximum speed is not 1000, this is a myth which I wish KIPR would stop spreading. The maximum speed is simply whatever speed causes getpwm() to return 100%; this is dependent on the physical design of the robot (e.g. gearing, weight) and environment (are you going uphill?). On most robots I've worked with, 1000 ticks/second is way over the maximum speed, i.e. it maxes out the motors and causes the robot to start drifting. That said, I believe some simple robots can go to 2000 ticks/second or higher without maxing out the motors (at least, that's what I've heard from people such as David Culp, who typically know what they're talking about).

Someone at KIPR decided to make the mav() function show an error if you give it a speed over 1000... this is a horrible design decision and leads to confusion. That "feature" can easily be bypassed, if I recall correctly.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

Ok I will next time. Thank you for the all of the info. This helps me to better understand the motors. Now I can work on one of my individual projects!

Also, may you please answer my second question too? I think you know what you are talking about :)

Thank you again!

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

Sorry, I have another question: Why do you have to used the function "off();" to turn off the motors? What difference does it make if I do not use that in my program? Is this function just used after a freeze to tell the motor that it is able to release?

And is this function related any to mtp or mrp? or is it just used for motor and mav?

Thanks!

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

Ok, I found out that instead of using curr_pos to find the current position of the motor, I instead should use the function get_motor_position_counter();
So never mind about my question about how to format curr_pos

However, I still have my previous question unanswered (it is in the previous post).

Thank you!

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 2 years 29 weeks ago.

Not sure about on the Link, but on the CBC, motors freeze after completing an mrp() command. Frozen motors will disqualify you after the game has elapsed because the game rules require all power to be shut off to the motors. Also, frozen motors can drift over time. The off() command will shut off the power to the motor.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS