Answers.Body: <p>I can't say that I understand your problem, but maybe this link will help <a href="https://communities.theiet.org/blogs/698/1706" rel="nofollow noreferrer">EV3 Move Steering Block Explained </a> </p>
  
  <p>If you are asking about how the steering parameters relate to how much the machine will turn, then that is going to depend very much on the geometry of the machine: wheel diameter and wheel separation.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T12:15:41.870Z
Answers.LastActivityDate: 2018-04-09T12:15:41.870Z
Answers.UserDisplayName: Derek Andrews
Answers.Body: <p>I believe that it is the intention that the ratio between the speeds of the two motors is entirely determined by the turn parameter, not the speed parameter. </p>
  
  <p>I think the following code better represents how the turn block behaves:</p>
  
  <pre><code>for (var i = -100; i == 100; i++) {
    turnfactor = 2*i/100;
    if (turnfactor &gt;= 0) {
      motorB = speed;
      motorD = speed * (1-turnfactor);
    } else {
      motorB = speed*(1+turnfactor);
      motorD = speed;
    }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T16:27:47.763Z
Answers.Text: This is correct. Also seen in practice (with the number rearranged a bit) [here](https://github.com/ev3go/ev3dev/blob/master/motorutil/steer.go#L255) and [here](https://github.com/dlech/micropython-ev3dev/blob/ev3dev-stetch/src/uev3dev/motor.py#L260).
Answers.UserDisplayName: David Lechner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T14:55:36.097Z
Answers.LastActivityDate: 2018-04-09T18:07:15.313Z
Answers.LastEditDate: 2018-04-09T18:07:15.313Z
Answers.UserDisplayName: Michael Verschaeve
Body: <p>In my workshops I get asked regularly, what the turn option of the default steering block means (see the image).</p>
  
  <p><a href="https://i.sstatic.net/PzOwM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PzOwM.png" alt="enter image description here"></a></p>
  
  <p>Obviously, if the turn option is set to 0, the robot is moving forward. A positive value is turning right, a negative is turning left. So far, so good.</p>
  
  <p>I looked in the source code and found a programming scheme I tried to visualize. A large comment within the code describes the process as follows:</p>
  
  <blockquote>
    <ul>
    <li>Speed [-100 .. +100] is move forward or move backwards  Turn ratio
    [-200 .. +200] is how tight you turn and to  what direction you turn
    
    <ul>
    <li>0 value is moving straight forward</li>
    <li>Negative values turns to the left</li>
    <li>Positive values turns to the right</li>
    <li>Value -100 stops the left motor</li>
    <li>Value +100 stops the right motor</li>
    <li>Values less than -100 makes the left motor run the opposite
    direction of the right motor (Spin)</li>
    <li>Values greater than +100 makes the right motor run the opposite
    direction of the left motor (Spin)</li>
    </ul></li>
    </ul>
  </blockquote>
  
  <p>So the turn ration is multiplied by 2, because as a user we can just put -100 &lt;-> 100 in there. I then used this code to calculate some values:</p>
  
  <pre><code>for (var i = -100; i == 100; i++) {
    turn = i * 2;
    if (turn &gt;= 0) {
      motorB = speed;
      motorD = speed - turn;
    } else {
      motorB = turn + speed;
      motorD = speed;
    }
  }
  </code></pre>
  
  <p>If I visualize those values, I get the following image for speed 100:</p>
  
  <p><a href="https://i.sstatic.net/zS4k2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zS4k2.png" alt="enter image description here"></a></p>
  
  <p>That's fine. You can see the real turn value (the ones we as a user can set) and the calculated speeds for two (virtual) motors B and D. I tried this with the educator model and it works perfectly well. </p>
  
  <p>But when I use the same code for another speed value (33), I get motor outputs that are too high in my opinion:</p>
  
  <p><a href="https://i.sstatic.net/betge.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/betge.png" alt="enter image description here"></a></p>
  
  <p>The Motors will have values over +100/-100. Is there a threshold in the code and the motor outputs will be cropped?</p>
  
  <p>Did someone else dig into this? Did I made a mistake?</p>
  
  <p>P.S.: I love such things. If someone is interested in doing more if this, just ping me. :)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-09T16:31:26.913Z
Comments.Text: In addition to scaling the speed, the number of rotations of the motor is also scaled. For example, if the steering value is set to 50, one motor will turn the full number of rotations and the other motor will turn 0 rotations. If steering is set to 0, both motors turn the full number of rotations. If steering is set to 25, one motor will turn the full number of rotations and the other motor will turn half as many rotations. If steering is set to 100, one motor will turn the full number of rotations and the other motor will turn the same number of rotations in the opposite direction.
Comments.UserDisplayName: David Lechner
Tags: <ev3><ev3-g><steering>
Title: Steer with the LEGO Mindstorms EV3
UserDisplayName: Fabian Deitelhoff
ThreadText: # Steer with the LEGO Mindstorms EV3
  
  (Asked by: username_0 on 2018-04-09)
  
  In my workshops I get asked regularly, what the turn option of the default steering block means (see the image).
  
  Obviously, if the turn option is set to 0, the robot is moving forward. A positive value is turning right, a negative is turning left. So far, so good.
  I looked in the source code and found a programming scheme I tried to visualize. A large comment within the code describes the process as follows:
  
  
  Speed [-100 .. +100] is move forward or move backwards  Turn ratio
    [-200 .. +200] is how tight you turn and to  what direction you turn
    
    
  0 value is moving straight forward
  Negative values turns to the left
  Positive values turns to the right
  Value -100 stops the left motor
  Value +100 stops the right motor
  Values less than -100 makes the left motor run the opposite
    direction of the right motor (Spin)
  Values greater than +100 makes the right motor run the opposite
    direction of the left motor (Spin)
  
  
  
  So the turn ration is multiplied by 2, because as a user we can just put -100 <-> 100 in there. I then used this code to calculate some values:
  for (var i = -100; i == 100; i++) {
    turn = i * 2;
    if (turn >= 0) {
      motorB = speed;
      motorD = speed - turn;
    } else {
      motorB = turn + speed;
      motorD = speed;
    }
  }
  
  If I visualize those values, I get the following image for speed 100:
  
  That's fine. You can see the real turn value (the ones we as a user can set) and the calculated speeds for two (virtual) motors B and D. I tried this with the educator model and it works perfectly well. 
  But when I use the same code for another speed value (33), I get motor outputs that are too high in my opinion:
  
  The Motors will have values over +100/-100. Is there a threshold in the code and the motor outputs will be cropped?
  Did someone else dig into this? Did I made a mistake?
  P.S.: I love such things. If someone is interested in doing more if this, just ping me. :)
  
  **Tags:** ev3, ev3-g, steering
  > **Comments:**
  > **username_1**: In addition to scaling the speed, the number of rotations of the motor is also scaled. For example, if the steering value is set to 50, one motor will turn the full number of rotations and the other motor will turn 0 rotations. If steering is set to 0, both motors turn the full number of rotations. If steering is set to 25, one motor will turn the full number of rotations and the other motor will turn half as many rotations. If steering is set to 100, one motor will turn the full number of rotations and the other motor will turn the same number of rotations in the opposite direction.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-04-09. Score: 4
  
  I can't say that I understand your problem, but maybe this link will help [EV3 Move Steering Block Explained](https://communities.theiet.org/blogs/698/1706)
  
  If you are asking about how the steering parameters relate to how much the machine will turn, then that is going to depend very much on the geometry of the machine: wheel diameter and wheel separation.
  
  
  ---
  
  ### Answer by username_3 on 2018-04-09. Score: 2
  
  I believe that it is the intention that the ratio between the speeds of the two motors is entirely determined by the turn parameter, not the speed parameter. 
  I think the following code better represents how the turn block behaves:
  for (var i = -100; i == 100; i++) {
    turnfactor = 2*i/100;
    if (turnfactor >= 0) {
      motorB = speed;
      motorD = speed * (1-turnfactor);
    } else {
      motorB = speed*(1+turnfactor);
      motorD = speed;
    }
  }
  
  > **Comments:**
  > **username_1**: This is correct. Also seen in practice (with the number rearranged a bit) [here](https://github.com/ev3go/ev3dev/blob/master/motorutil/steer.go#L255) and [here](https://github.com/dlech/micropython-ev3dev/blob/ev3dev-stetch/src/uev3dev/motor.py#L260).  
  
  ---
  
  