Page 1 of 1

Investigating motor control

Posted: 16 Jan 2011, 14:40
by gloomyandy
Folks,
a few of you may have read this discussion:
http://lejos.sourceforge.net/forum/view ... sc&start=0
over on the leJOS forum. It contains an interesting discussion into the characteristics of the Lego and leJOS motor controllers. I thought the results and techniques might be of wider interest hence this thread.

The story all started with leJOS unroller doing some tests. His blog explains it all here:
http://nxt-unroller.blogspot.com/2010/1 ... s-and.html
I had also been some work on the leJOS driver (to fix some problems we had with smooth acceleration), and I used unroller's tests to help me test and improve the driver. You see some of the details here:
http://www.gloomy-place.com/lejosmotor.htm

unroller has continued working on his own motor controller (using a technique called feed-forward), there are more details of this here:
http://nxt-unroller.blogspot.com/2011/0 ... d-for.html

Finally as part of the work I've been doing I wanted to find a way to let me observe the quality of the motor control in a moving robot. I came up with a technique using a laser and my dSLR, I've made a short video of how it works and some results here:
http://www.youtube.com/watch?v=NJ_6Qm_BNFI

Hope some of you find the above of interest...

Andy

Re: Investigating motor control

Posted: 16 Jan 2011, 15:46
by mightor
The laser pointer and long exposure pictures paint a very clear picture. Nice bit of research :)

- Xander

Re: Investigating motor control

Posted: 18 Jan 2011, 19:41
by schodet
Nice work !

Would you like to test using a shorter regulation interval for the LEGO algorithm? I have a "work in progress" version here : http://nxt-firmware.ni.fr.eu.org/binaries/, look at WIP Version 1.29i-d1d1374. I did not work on sync mode, but the shorter regulation interval may have an impact.

Unfortunately, I do not spend much time on LEGO currently, too busy with Eurobot.

Re: Investigating motor control

Posted: 19 Jan 2011, 18:20
by afanofosc
I grabbed a copy of the zips from the leJOS thread that Andy mentions above. Andy, do you have a newer/better copy of your code that you could send me or should I just grab the latest from SVN?

I am going to try to implement a leJOS mode for motor control in the enhanced NBC/NXC firmware and possibly the unroller control mode. Probably both are above my pay grade/competence level.

Andy, do you have any suggestions for implementing your algorithm in the standard firmware's state machine/output module architecture?

John Hansen

Re: Investigating motor control

Posted: 19 Jan 2011, 19:19
by gloomyandy
Hi John,
I updated the leJOS svn just the other day so the latest code is up there:
http://lejos.svn.sourceforge.net/viewvc ... iew=markup

I'm not sure how best to suggest that you implement things in the firmware. I guess the latest code I've used will help in that it has all of the state information for each motor collected together (because it all runs off a single thread). But you will have to convert the code to use an array of structs or something. I've no idea how you map things to the firmware I/O model, (i.e. the firmware API using the motor command structure), but I'm sure you know more about that than I do! Let me know if I can provide any more information on anything...

Good luck!

Andy

Re: Investigating motor control

Posted: 19 Jan 2011, 21:52
by schodet
afanofosc wrote:I am going to try to implement a leJOS mode for motor control in the enhanced NBC/NXC firmware and possibly the unroller control mode. Probably both are above my pay grade/competence level.
I have some work done on my side for an alternative regulation method, I hope we could agree on the interface in order not to have incompatible changes.