locked
Lego NXT pulse with modulation mode RRS feed

  • Question

  • Is that possible to use PWM mode for controlling Lego motors? I need to get exact angles from my robot. Or, probably, there is another way to do it?
    Wednesday, March 28, 2012 7:48 PM

Answers

  • Oh, yes, MATLAB is a great thing. I built an application that meets all my needs just a couple of hours. It includes a number of PID controllers. But i thought, that MRDS may provide similar opportunities as new 2012a MATLAB.
    Thursday, March 29, 2012 2:59 PM

All replies

  • Lego motors have encoders with 1 deg precision.  You should be able to get precise angle by monitoring the encoder ticks.

    Wednesday, March 28, 2012 7:56 PM
  • You will find it difficult to do remotely though. 

    You probably need to look at writing code to run on the Lego (up to an including your own firmware). There is a package called motor control,

    http://www.mindstorms.rwth-aachen.de/trac/wiki/MotorControl

    whose intention is to do just that. But my personal experience, I lost the ability to read from the sensors, so it wasn't as helpful as I had hoped.

    As far as using it with MRDS, the latency caused by bluetooth is just too great to accomplish this.

    Realistically if you want remote control, with 1 degree accuracy, you might want to look at other platforms.

    Wednesday, March 28, 2012 8:07 PM
  • Oh, yes, MATLAB is a great thing. I built an application that meets all my needs just a couple of hours. It includes a number of PID controllers. But i thought, that MRDS may provide similar opportunities as new 2012a MATLAB.
    Thursday, March 29, 2012 2:59 PM
  • Well I see you answered your own question, according to the moderation. 

    But just in case, that program is part of the MATLAB toolbox - but it does not require MATLAB to run.  In my case, I replaced MRDS supplied Lego services, and used Mindsqualls C# to talk to MotorControl, to achieve what you asked via MRDS.

    But apparently you already knew that. (WTF?)

    Friday, March 30, 2012 4:05 AM