Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: acceleration problem

  1. #1
    Join Date
    Aug 2013
    Location
    Switzerland
    Posts
    16

    Default acceleration problem

    hello,
    i try to programme an acceleration bloc and I get a very strange behaviour. I use the char/move bloc and both big motors are not acting a the same.
    In my loop, one motor turn two tinmes faster as the other. Do you have any idea ?

    acceleration.jpg
    Last edited by switch; 09-16-2013 at 05:00 AM.

  2. #2
    Join Date
    Apr 2009
    Location
    Southern California
    Posts
    191

    Default Re: acceleration problem

    Quote Originally Posted by switch View Post
    hello,
    i try to programme an acceleration bloc and I get a very strange behaviour. I use the char/move bloc and both big motors are not acting a the same.
    In my loop, one motor turn two tinmes faster as the other. Do you have any idea ?
    I see two possible problems.

    1. The first Compare block uses ">" and that should be "<". The first time, the speed will be 45 and subsequent loops, speed will be increase by 10.

    2. Change the Move block to "ON" instead of "ON for Degrees". The "On for degrees" will cause the motors to move/stop repeatedly and I suspect you want a smooth acceleration.

  3. #3
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    316

    Default Re: acceleration problem

    This shows the value of commenting your programs even if you think they are "simple." Here is my version of the program with the comments I THINK are applicable. If the comments differ from what you had in mind then we have discovered the difficulty. I changed the movement block as suggested by LOLComets. capture_20130916_132307.jpg
    Bill Bourn
    Coach, FLL#91 F L eLements
    Mentor, FRC#2170 Titanium Tomahawks

  4. #4
    Join Date
    Oct 2009
    Location
    Long Beach, CA
    Posts
    166

    Default Re: acceleration problem

    I don't have an EV3 in front of me to test, but I think I see a couple problems:

    In the version of the loop posted by switch, the Move Block is set to 10 degrees of rotation, then coast. I presume that the intent is to increase the motor power every 10 degrees of motor rotation. This should give a smooth acceleration. But apparently this isn't working correctly. It's not clear why one motor would be running at twice the speed of the other, but this is likely caused by an unexpected interaction of the Move Block's error correcting algorithm with being reset every 10 degrees.

    One other problem is that the loop is set to 100 counts, which would make the motor turn 1000 degrees before the loop exits. But this is probably just a test, so you can fix that.

    The revised version posted by GWhizNonKid has a problem that there is no delay in the loop, so it will set the motor to 25 (init to 15, then add 10 before setting), then immediately set it to 35 and 45 before the motor has even started turning. Perhaps some sort of delay during the acceleration would be helpful.

    Terry
    FLL Coach 2006-2014
    Founding Mentor for FRC 1759 2006-2012
    FRC Field Supervisor, Los Angeles 2007-2014
    Principal Software Developer, EMC Corp.

  5. #5
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    316

    Default Re: acceleration problem

    Now I have run the program on a RileyRover 'bot from Damien Kee. Without a delay in the loop, the speed limit will be reached quicker than you can observe. I put a .1sec wait after the motor block and it makes the acceleration more noticeable, but only after I changed the speed increment in the lower switch leg to 2 instead of 10. In my previous message, I didn't mention that I put a starting value for speed prior to the loop.
    Bill Bourn
    Coach, FLL#91 F L eLements
    Mentor, FRC#2170 Titanium Tomahawks

  6. #6
    Join Date
    Sep 2013
    Location
    Minnesota
    Posts
    38

    Default Re: acceleration problem

    Ramping power seems like something you should want to do, but I see teams spend a lot of time and getting very little benefit. Before you hang your hopes on it spend a little time doing some experiments and see if the benefit you predict is the benefit you receive.

    I'd knock of a simple ramp block and run some repeatability tests, comparing the results against not ramping. Attached is a block that ramps power over a specified period of time. You specify the ending power, the ramping time and the number of steps used to bump up the power. Also attached is a test program that uses the block. I don't have my robot here, but it should work.
    Attached Images Attached Images

  7. #7
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    316

    Default Re: acceleration problem

    More gold from guru Dean. I did wonder about the "power" variable in use because I remembered the global nature of variables in EV3. I think you mentioned a naming scheme that localizes names by prefixing myblock name to them. Or has the picture merely truncated the name to what we see?

    Answering my own post - "power" is an external global variable that is adjusted by the myblock in the course of its operation.

    Somewhat embarrassed to say that it took too long by 30 seconds or so to see why the loop counter was tied to the switch block. Delay happens for every iteration of the loop except the first. Then I added to the internal commentary on the three blocks to the right of the switch to say power setting increment increases on each iteration of the loop. As I wrote that, I noted that the first power to the motors would already have been incremented by the bump. Seems like an oops to me. How then to have the first iteration at the starting power? I think moving the motor block between the power setting read and its increment will give the performance I expected at the outset. This will require another motor block outside the loop to set the final power at the limit value. I think the final computer power value can be passed out of the loop to it. Off to see if that's true.
    Last edited by GWhizNonKid; 09-16-2013 at 10:57 PM.
    Bill Bourn
    Coach, FLL#91 F L eLements
    Mentor, FRC#2170 Titanium Tomahawks

  8. #8
    Join Date
    Aug 2013
    Location
    Switzerland
    Posts
    16

    Default Re: acceleration problem

    Thank for the answers. It seem that 10 is a low value, I change lots of parameters but it is still not usable.

    The biggest impact is modifying the "break" at the end. With iteration of 36 and a "break", both motors will end with a small differrence. But if I choose to disable the break to go smoothly, on motors will turn faster than the other.

  9. #9
    Join Date
    Sep 2013
    Location
    Minnesota
    Posts
    38

    Default Re: acceleration problem

    Power is a global. I use it to keep track of the last motor power setting so I always know where to start the ramp. The test program initializes the value to 0 (unnecessary because uninitialized numeric variables are set to zero). The first ramp ramps power from 0 to 75, and the second ramp ramps power from 75 to 0.

    The comment about travel distance during the ramp is inaccurate, partially because I skip the first wait interval and the ramp ends immediately upon reaching max power, but mostly because I am commanding power and not rate. Duh! Must be a lack of sleep. The trick to ramping up power is for it to complete before you reach your destination. The trick to ramping down power is reaching zero power the same time you reach your destination. That is a far trickier proposition.
    Last edited by DeanHystad; 09-17-2013 at 07:10 AM.

  10. #10
    Join Date
    Aug 2013
    Location
    Switzerland
    Posts
    16

    Default Re: acceleration problem

    Thanks Dan, I will try to make it in this way. I started without variable to be sure that the alrgorythmus is correct but your bloc is very complete.

    My goal is to have an accelaration bloc and combine that with a line following.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. EV3 Battery Problem
    By Dean Hystad in forum Products & Equipment
    Replies: 20
    Last Post: 11-24-2013, 01:04 PM
  2. Classmate Imaging Problem! AUTOINSTALL.CMD not recognized
    By Lemonsy in forum Operator Console
    Replies: 3
    Last Post: 02-04-2011, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •