I personally never managed to use these posreg functions - far too weird in my estimation.
But in case you want a different customized function based on PID regulation, I could probably help...
doc-helmut wrote:I personally never managed to use these posreg functions - far too weird in my estimation.
But in case you want a different customized function based on PID regulation, I could probably help...
Thanks. I just want motor hold the position after move.I thought it's a ordinary behavior.
For example, robot lift a heavy item, then hold it at higher position.
In NXT, I can use motor block, wait for motor stop, and brake.
In NXC ?
iplewis wrote:Do you have the enhanced NBC/NXC firmware loaded on your NXT? I believe all the regulation functions need it.
I checked the manual, you are right.
I found the Warning:
"This function requires the enhanced NBC/NXC firmware version 1.31+."
Thank you.
But you mean ALL regulation functions?
These functions call the "setoutput" and it has regulation parameter.
So, what can i do with setoutput and it's regulation parameter?
felix2ch wrote:Thanks. I just want motor hold the position after move.I thought it's a ordinary behavior.
For example, robot lift a heavy item, then hold it at higher position.
In NXT, I can use motor block, wait for motor stop, and brake.
In NXC ?
In NXC it's simply Off(port), then ports are stopped and held by a current brake force - but it's not quite strong.
If you want a stronger brake force and/or avoid manual / passive moving then you'd need a different functionality
- like posreg
- or e.g., my own PID control function using the follow-up mode
felix2ch wrote:But you mean ALL regulation functions?
These functions call the "setoutput" and it has regulation parameter.
So, what can i do with setoutput and it's regulation parameter?
Well, I'm not really an expert, but yes, I think ALL regulation functions. As far as I understand it, the PID controller is inside the enhanced firmware (presumably in version 1.31 upwards) so if you want regulation, you need this.
I should add that I am pretty sure this is true for position regulation, I'm not so sure about the 'speed' or 'synchronisation' regulation (I've never used them), but I think they all need the enhanced firmware.
As Doc says, if you just want the 'brake' effect from NXT-G, then Off() will work. Or equivalently, you can use SetOutput() with OUT_MODE_BRAKE in the OutputModeField.
I believe the official firmware supported PID and holding position, because NXT-G can do it.
After some digging works, i found the method for holding position.
Yes, the powered braking capability is part of the standard firmware and using SetOutput is the way to turn it on, though that could easily be wrapped in a preprocessor macro API function. This capability is demonstrated in NXT Power Programming and with the right search terms a number of threads can be found where it has been discussed here previously. I'm glad you were able to find an example.
afanofosc wrote:Yes, the powered braking capability is part of the standard firmware and using SetOutput is the way to turn it on, though that could easily be wrapped in a preprocessor macro API function. This capability is demonstrated in NXT Power Programming and with the right search terms a number of threads can be found where it has been discussed here previously. I'm glad you were able to find an example.
John Hansen
Thanks.
I searched this forum using "setoutput" term again. Exactly, you were told someone about it.