Announcement

Collapse
No announcement yet.

Do parallel threads have much impact?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Do parallel threads have much impact?

    This is my 11 yo girls team's third season. Their second season they wrote a timer that runs parallel to their scheduling program and displays how much time is left on the clock. This season the scheduling program samples the time before and after missions, recording in a file how much time their robot spends in base vs how much time it spends on the field. After the last mission, they display the results on the screen. It's cool, and had no reliability impact. They have State in a few weeks, so they are not making this change now, but for next season they plan to have a second parallel program that samples and stores the x,y coordinates continuously, sampling the gyro and rotation sensor and converting polar coordinates to rectangular coordinates as fast as the EV3 will allow. Then they can plot their mission paths and look for variances. They alternatively want to have their turn and move myblocks sample and store the continuous (but unstored) x,y,heading to study repeatability. One girl thinks instead of driving in the polar world, they could drive in the x-y world.

    I'm certainly not discouraging this as an experiment, but can the EV3 keep up with all the parallel threads and file writes without having impact on their missions? I'm thinking if the overhead is there when they write their missions, it may be moot. They don't move for seconds, except when aligning to walls (they know they hit the wall when power drops to zero or a timer goes off, i.e. wheels spinning)
    scoTT

  • #2
    This question is impossible to answer. Software can be sensitive to or oblivious of timing issues. For example, a PID line follower will be greatly affected if the code does nothing to meter time. The sample rate is every bit as important as the gains. This is also true for a logic based (switch block style) line follower or "bang-bang" controller. The rate at which the "bang"s occur adjusts the the granularity of the turning gain, acting like "pulse width modulation". The faster the loop runs the better the results. On the other hand a proportional only line follower doesn't care much at about time. I can fun my proportional only line follower at 100 Hz or 20 Hz and not see any difference in performance. If you write to a file you will occasionally have fairly long pauses where the data is written to SRAM. If this pause happens at the wrong time I suppose it could cause problems.

    This question is either in the "try it and find out" or "who cares?" camps. I sounds like your team is having fun solving a problem that has nothing to do with FLL. Maybe they are bored with solving FLL missions. That happened with my daughter's team after their third season. I did them no favor talking them into a fourth season just because they were finally old enough to be eligible to win an invite to the World Festival. The girls were tired of FLL and the challenges of the game were not challenging anymore. That last season they had to make up their own challenges to make the season bearable. They still had fun, but there was no doubt a fifth season was not going to happen.
    Last edited by Dean Hystad; 01-28-2019, 09:40 AM.

    Comment


    • #3
      I agree with Dean... Results will vary, Clearly the girls are capable of trying this themselves. If they really want to do it, let them do it! I understand where you are coming from by asking the question, but it will heavily depend on how their particular code is written. Chances are, the girls will write this multi-threaded in a way that it will be easy to remove if it gets in the way, especially if they know it could cause problems.. Controlled experiments could be written to test when and how threads can bog down the brick, but they would only be applicable to the code that is running at that time.

      Comment


      • #4
        Thanks, I didn
        scoTT

        Comment


        • #5
          Hello,
          My team and I have actually done this and have just started a series detailing our program, which includes this style of movement. The way that we have programmed it the robot does manage to keep up with running multiple threads at the same time. If you're interested, here is the link to the first video.

          https://www.youtube.com/watch?v=AWEt...jx9OWUfQ76Rick

          Itay

          Comment


          • #6
            Cool. Great minds think a like. I'll show my kids after they finish.
            scoTT

            Comment

            Working...
            X