Absolute Position Regulation Tips [NXC]

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: Absolute Position Regulation Tips [NXC]

Post by schodet »

h-g-t wrote:Just wanted to say that I finally bit the bullet and used the new motor regulation.
Thank you very much Mr Schodet! :D :D :D
Thank you :)
h-g-t wrote:Can I read one of the rotation counters to get the absolute values without cancelling the positive regulation mode?
Sure, you can use:

Code: Select all

GetOutput (the_output, TachoLimit);
to read the current requested position.

Actually, PosRegAddAngle (the_output, 10) is equivalent to PosRegSetAngle (the_output, GetOutput (the_output, TachoLimit) + 10).
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Absolute Position Regulation Tips [NXC]

Post by h-g-t »

Are ther any specific commands to disable regulation?

If not, which 'normal' commands will disable it?
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Absolute Position Regulation Tips [NXC]

Post by h-g-t »

OK, let me rephrase the question.

If I want to reset the starting position for positive regulation -

1. Do I have to disable then re-enable regulation (if so, how)?

2. Can I just re-use the 'enable positive regulation' code and this automatically resets the starting point?

Advice appreciated as it affects how I write the program.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: Absolute Position Regulation Tips [NXC]

Post by schodet »

h-g-t wrote:OK, let me rephrase the question.
If I want to reset the starting position for positive regulation -
1. Do I have to disable then re-enable regulation (if so, how)?
2. Can I just re-use the 'enable positive regulation' code and this automatically resets the starting point?
Advice appreciated as it affects how I write the program.
Yes, calling PosRegEnable will reset everything.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Absolute Position Regulation Tips [NXC]

Post by h-g-t »

Thank you - appreciate your help.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 26 guests