That code will run it forwards at powerlevel for 0.5 seconds, then at powerlevel + 10 for the instant before it goes back to the start of the loop. You never increase the value of powerlevel, therefore it'll be an endless cycle of power, and an instant of power + 10.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Fri Jun 28, 2013 10:15 am

coachkrauss

Rookie

Joined: Thu Sep 29, 2011 6:51 amPosts: 6

Re: What is the code for Robot Acceleration?

so what do you recommend? Can you give me an example of a simple code that will work?

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Fri Jun 28, 2013 11:11 am

Ernest3.14

Professor

Joined: Sat May 18, 2013 1:24 pmPosts: 272Location: Olympia, WA

Re: What is the code for Robot Acceleration?

Although to be picky, when you set a motor speed, you are setting acceleration. You just reach your terminal velocity extremely quickly

Although to be picky, when you set a motor speed, you are setting acceleration. You just reach your terminal velocity extremely quickly

coachkrauss wrote:

I thought motor values represent power?

To be picky, motor values represent average voltage applied to the motor*, which is basically proportional to motor speed for a fixed load on the motor and if the motor speed doesn't change too quickly.

The amount of power consumed by the motors depends on both this voltage and the amount of current that is being drawn, which is basically proportional to the load on the motor. Load on the motor is the amount of resistance** to the motor turning, whether from friction, the robot's inertia resisting acceleration, because the motor is lifting something, etc.

You can have the motor output command set to 100%, but if there's nothing hooked to the motor, it will be drawing very little power.

Also interesting is the amount of electric power consumed is not the same as the amount of mechanical power generated. If you have the motor set at "full power," but hold the wheels so they can't move, the motor will indeed draw its max amount of electrical power, but the amount of mechanical power will be 0. The ratio between the amount of mechanical power and the amount of electrical power is called the motor's efficiency.

More on brushed DC motor physics here and here for anyone who's curious.

--Ryan

*ignoring non-idealities of batteries which cause the system voltage to sag the more current that is drawn from them.

If you have the motor set at "full power," but hold the wheels so they can't move, the motor will indeed draw its max amount of electrical power...

Don't try this at home kids, we've burnt out way too many motors with that kind of stress testing

Yeah... also, no need to overvolt your XL motor to see if it'll snap an axle. Been there, done that. Bye-bye motor.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Sat Jun 29, 2013 10:34 pm

rcahoon

Site Admin

Joined: Tue Oct 09, 2012 10:34 amPosts: 192

Re: What is the code for Robot Acceleration?

Ernest3.14 wrote:

Don't try this at home kids, we've burnt out way too many motors with that kind of stress testing

Truth.

Conservation of energy still holds, so all the energy that you've put into the motor that can't get turned into mechanical energy get turned into heat instead. Burnt motors soon result.

Who is online

Users browsing this forum: No registered users and 0 guests

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