Looking for an advanced motor control tutorial
Looking for an advanced motor control tutorial
I recently found references to a whole group of new[?] motor control functions http://bricxcc.sourceforge.net/nbc/nxcd ... index.html including SetMotorRegulationTime. However, I haven't been able to find any detailed information about these routines. Could someone with extensive experience with these routines write a brief "Advanced NXT motor control for dummies" tutorial?
Can I use these routines with my current antiquated 1.28 firmware or do I need a the newest version of the John's EF?
A lot of experimenting with the normal motor control routines (OnFwdRegEx and all of his friends) convinced me that they were inadequate for fast, precise motor control. I'm hoping that these new[?] routines could help me to achieve this (see http://www.youtube.com/watch?v=ezUei3z6MJM) with a lot less work.
Can I use these routines with my current antiquated 1.28 firmware or do I need a the newest version of the John's EF?
A lot of experimenting with the normal motor control routines (OnFwdRegEx and all of his friends) convinced me that they were inadequate for fast, precise motor control. I'm hoping that these new[?] routines could help me to achieve this (see http://www.youtube.com/watch?v=ezUei3z6MJM) with a lot less work.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Looking for an advanced motor control tutorial
Yes they are new. I only know about some of the functions from first hand experience. I don't really understand the concepts used in motor control all that much; however, I found some of those commands to be extremely useful/easy to use. I am speaking specifically of the new absolute position regulation functions. I use these two lines to set it up.I use this line in the control, to tell the FW where I want to motor to be (degrees).Those are all you need to have the FW automatically make the motor go to the position you specify. It doesn't matter what position you were at previously, it just goes to the new one.
No, you do need the latest FW to use the functions.
Code: Select all
PosRegEnable (OUT_A);//Starts the precess I guess.
PosRegSetMax (OUT_A, 0, 0);//You can set the max speed and acceleration that the FW will use to get to the specified position. 0 is max, and the only number I use.
Code: Select all
PosRegSetAngle(OUT_A, Degrees);
No, you do need the latest FW to use the functions.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Looking for an advanced motor control tutorial
By latest firmware, do you mean John's FW?
Do you notice a significant speed increase when you set PosRegSetMax (OUT_A, 0, 0)?
Do you notice an accuracy improvement with SetMotorRegulationTime( 10 )?
In any case, thanks for the info. (Add thanks again for the BrickLink hint.)
Do you notice a significant speed increase when you set PosRegSetMax (OUT_A, 0, 0)?
Do you notice an accuracy improvement with SetMotorRegulationTime( 10 )?
In any case, thanks for the info. (Add thanks again for the BrickLink hint.)
Last edited by rghansen on 19 Mar 2011, 11:49, edited 1 time in total.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Looking for an advanced motor control tutorial
Sorry for not being clear. Yes, you need John's latest 1.31.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Looking for an advanced motor control tutorial
Then maybe it's time for me to install 1.31.
Please tell me that doing this is a no brainer that even I can do and that all my fears about being left with a "softly ticking brick" are entirely unfounded.
Please tell me that doing this is a no brainer that even I can do and that all my fears about being left with a "softly ticking brick" are entirely unfounded.
Re: Looking for an advanced motor control tutorial
is there meanwhile a stable RampUp/Dn without switching off when target speed reached?
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Looking for an advanced motor control tutorial
I am not really sure what you are asking...doc-helmut wrote:is there meanwhile a stable RampUp/Dn without switching off when target speed reached?
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Looking for an advanced motor control tutorial
I would say it is high time to update.
It is very easy to do. I have re-flashed my bricks many times (I have 5 NXT's, and I have re-flashed some of them about 10 times), I don't give it a second thought anymore. I always use the BCC Firmware Download tool. I used to always have to do it twice, the first time it would start clicking, and the second time it would actually download. John fixed that issue with the latest release however (I think he added a pause), so now it takes a little longer, but it only takes one try (at least the four times I have used it so far). There are obviously no guarantees, but I think it is worth whatever risk there may be.
It is very easy to do. I have re-flashed my bricks many times (I have 5 NXT's, and I have re-flashed some of them about 10 times), I don't give it a second thought anymore. I always use the BCC Firmware Download tool. I used to always have to do it twice, the first time it would start clicking, and the second time it would actually download. John fixed that issue with the latest release however (I think he added a pause), so now it takes a little longer, but it only takes one try (at least the four times I have used it so far). There are obviously no guarantees, but I think it is worth whatever risk there may be.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Looking for an advanced motor control tutorial
IIRC there once was a RampUp/Dn API function which didn't work correctly because the motors always are switched to "off" in the moment the speed limit has been reached.
Is there now a correct working RampUp/Dn API function which lets the motors ramp up or down to a speed target (I suppose you guessed that ) and lets them drive at the target speed if once reached the targetted speed limit?
Is there now a correct working RampUp/Dn API function which lets the motors ramp up or down to a speed target (I suppose you guessed that ) and lets them drive at the target speed if once reached the targetted speed limit?
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Looking for an advanced motor control tutorial
I am not really sure why you would need an API. Couldn't you program a really simple piece of code to do the same thing? Maybe I am misunderstanding, but you want it to essentially go to a target PWM %, but not instantly? For example, you set the speed to 100 (from 0), and you don't want the motor to instantly be going 100%, you want it to slowly speed up? I can think of several methods you could use to do something like that.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Who is online
Users browsing this forum: No registered users and 0 guests