Answers.Body: <p>The answer is basically the same as the LED question that you linked. On the EV3 output ports, pin 2 is internally connected to pin 6. So, when you tell a motor to go in reverse (negative power value), pin 2 is powered, which in turn raises the voltage on pin 6. Both pins 5 and 6 are used for automatically detecting when a motor is connected.</p>
  
  <p>So, when you use a negative power setting, most of the time (but not 100% of the time), it it will trick the EV3 into thinking there is a motor connected and the motor will stay powered. However, when you use a positive power setting, pin 1 is powered instead of pin 2, so the EV3 thinks that there is no motor connected (because nothing happens to pin 5 or pin 6). So, in this case, the device connection manager in the EV3 software takes over and resets the motor port, which causes it to stop sending power to the motor.</p>
  
  <p>I attached an oscilloscope to pins 1 and 2, to see what is going on.</p>
  
  <p><a href="https://i.sstatic.net/MTNQR.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MTNQR.jpg" alt="oscilloscope showing EV3 output port pins 1 and 2"></a></p>
  
  <p>As you can see, the output is only turned on for 380ms, then it turns itself off. The motor was instructed to run indefinitely, but in reality, this is not what happens.</p>
  
  <p>Since your test involved running the motor for 1s but it really only runs for 380ms, one would expect the car to run 38% of the distance as in the reverse case. You observation was 33% (one track length vs. 3), so that is quite close to what is expected.</p>
  
  <p>As a workaround, you can Use the Unregulated motor block in a loop like this...</p>
  
  <p><a href="https://i.sstatic.net/rSUNA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rSUNA.png" alt="enter image description here"></a></p>
  
  <p>It is important to use two different "power" values. Each time you change the value, it turns on the output port again. If you use the same value, the software won't update the motor port and the device connection manager will take over and turn off the output.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-12T04:52:25.210Z
Answers.Text: Appreciate the thorough analysis and solution.  I've forwarded this info to the MOC designers.  You can see their work starting on page 34 of the 50th issue of BrickJournal.  I've got the digital version; the hardcopy version hasn't arrived yet.  Your help will be incorporated into whatever they've got planned for Bricks By the Bay 2018.  I'll try to post a video after the convention in July 2018.  Thank you!
Answers.UserDisplayName: Walt White
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-11T01:08:03.253Z
Answers.LastActivityDate: 2018-04-12T15:01:19.323Z
Answers.LastEditDate: 2018-04-12T15:01:19.323Z
Answers.UserDisplayName: David Lechner
Body: <p>I'm helping some fellow Bay Area LEGO User Group builders who want to use an EV3 to power a 9V train.
  I'm using the NXT to 9V conversion cable (<a href="https://www.bricklink.com/v2/catalog/catalogitem.page?P=x1676" rel="nofollow noreferrer">https://www.bricklink.com/v2/catalog/catalogitem.page?P=x1676</a>)
  with the old 9V metal train track connectors (<a href="https://www.bricklink.com/v2/catalog/catalogitem.page?P=5306c01&amp;C=0#T=C&amp;C=0" rel="nofollow noreferrer">https://www.bricklink.com/v2/catalog/catalogitem.page?P=5306c01&amp;C=0#T=C&amp;C=0</a>) and the Unregulated Motor (UM) block in EV3=G.</p>
  
  <p>My first test was to have the train travel one second in one direction then one second in the opposite direction in an infinite loop.  The results were fine with the train going in the direction that used a negative power in the UM block, but either no motion or shaky motion in the direction that used positive power values.</p>
  
  <p>I tested the track with a multi-meter and verified that the power was only consistent and steady when using the negative power.</p>
  
  <p>On this site I found an interesting answer describing what is probably happening:
  <a href="https://bricks.stackexchange.com/questions/9881/using-the-unregulated-motor-block-and-conversion-cable-to-light-leds">Using the unregulated motor block and conversion cable to light LEDs</a>
  But that answer is only partly applicable -- I found that if I put a one second Wait block between power changes, then the power is consistent.  But different!</p>
  
  <p>So a power setting of +40% for one second moves the train one track segment, while a power setting of -40% for one second moves the train three track segments.  It looks like I can generate a workable program, but I'm curious about why this behavior is happening, and if there will be other surprises.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-11T01:10:10.123Z
Comments.Text: Also see https://bricks.stackexchange.com/q/2325/3498
Comments.UserDisplayName: David Lechner
Tags: <mindstorms><trains><ev3-g><motor>
Title: EV3 Unregulated Motor - different plus/minus power behavior
UserDisplayName: Walt White
ThreadText: # EV3 Unregulated Motor - different plus/minus power behavior
  
  (Asked by: username_0 on 2018-04-08)
  
  I'm helping some fellow Bay Area LEGO User Group builders who want to use an EV3 to power a 9V train.
  I'm using the NXT to 9V conversion cable (<https://www.bricklink.com/v2/catalog/catalogitem.page?P=x1676>)
  with the old 9V metal train track connectors (<https://www.bricklink.com/v2/catalog/catalogitem.page?P=5306c01&C=0#T=C&C=0>) and the Unregulated Motor (UM) block in EV3=G.
  
  My first test was to have the train travel one second in one direction then one second in the opposite direction in an infinite loop. The results were fine with the train going in the direction that used a negative power in the UM block, but either no motion or shaky motion in the direction that used positive power values.
  
  I tested the track with a multi-meter and verified that the power was only consistent and steady when using the negative power.
  
  On this site I found an interesting answer describing what is probably happening:
  [Using the unregulated motor block and conversion cable to light LEDs](https://bricks.stackexchange.com/questions/9881/using-the-unregulated-motor-block-and-conversion-cable-to-light-leds)
  But that answer is only partly applicable -- I found that if I put a one second Wait block between power changes, then the power is consistent. But different!
  
  So a power setting of +40% for one second moves the train one track segment, while a power setting of -40% for one second moves the train three track segments. It looks like I can generate a workable program, but I'm curious about why this behavior is happening, and if there will be other surprises.
  
  **Tags:** mindstorms, trains, ev3-g, motor
  
  > **Comments:**
  > **username_1**: Also see https://bricks.stackexchange.com/q/2325/3498  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-04-11. Score: 1
  
  The answer is basically the same as the LED question that you linked. On the EV3 output ports, pin 2 is internally connected to pin 6. So, when you tell a motor to go in reverse (negative power value), pin 2 is powered, which in turn raises the voltage on pin 6. Both pins 5 and 6 are used for automatically detecting when a motor is connected.
  
  So, when you use a negative power setting, most of the time (but not 100% of the time), it it will trick the EV3 into thinking there is a motor connected and the motor will stay powered. However, when you use a positive power setting, pin 1 is powered instead of pin 2, so the EV3 thinks that there is no motor connected (because nothing happens to pin 5 or pin 6). So, in this case, the device connection manager in the EV3 software takes over and resets the motor port, which causes it to stop sending power to the motor.
  
  I attached an oscilloscope to pins 1 and 2, to see what is going on.
  
  [![oscilloscope showing EV3 output port pins 1 and 2](https://i.sstatic.net/MTNQR.jpg)](https://i.sstatic.net/MTNQR.jpg)
  
  As you can see, the output is only turned on for 380ms, then it turns itself off. The motor was instructed to run indefinitely, but in reality, this is not what happens.
  
  Since your test involved running the motor for 1s but it really only runs for 380ms, one would expect the car to run 38% of the distance as in the reverse case. You observation was 33% (one track length vs. 3), so that is quite close to what is expected.
  
  As a workaround, you can Use the Unregulated motor block in a loop like this...
  
  [![enter image description here](https://i.sstatic.net/rSUNA.png)](https://i.sstatic.net/rSUNA.png)
  
  It is important to use two different "power" values. Each time you change the value, it turns on the output port again. If you use the same value, the software won't update the motor port and the device connection manager will take over and turn off the output.
  
  > **Comments:**
  > **username_0**: Appreciate the thorough analysis and solution.  I've forwarded this info to the MOC designers.  You can see their work starting on page 34 of the 50th issue of BrickJournal.  I've got the digital version; the hardcopy version hasn't arrived yet.  Your help will be incorporated into whatever they've got planned for Bricks By the Bay 2018.  I'll try to post a video after the convention in July 2018.  Thank you!  
  
  ---
  
  