Page 2 of 2

Re: PosRegEnable -does'nt work

Posted: 04 Jul 2013, 06:30
by HaWe

Code: Select all

SetOutput(PORT, PowerField, 0,
                        OutputModeField, OUT_MODE_MOTORON|OUT_MODE_BRAKE|OUT_MODE_REGULATED,
                        RegModeField, OUT_REGMODE_SPEED,
                        RunStateField, OUT_RUNSTATE_RUNNING,
                        TachoLimitField, 0,
                        UpdateFlagsField, UF_UPDATE_TACHO_LIMIT|UF_UPDATE_MODE|UF_UPDATE_SPEED);
Hell, what a function call to brake a motor! Or does it more than just brake? I don't see through that elaboration.
Anyway, I think I'll propose it for the Nobel Prize for Literature :D

Re: PosRegEnable -does'nt work

Posted: 04 Jul 2013, 09:11
by felix2ch
doc-helmut wrote: Hell, what a function call to brake a motor! Or does it more than just brake? I don't see through that elaboration.
Anyway, I think I'll propose it for the Nobel Prize for Literature :D
That 's why john said " though that could easily be wrapped in a preprocessor macro API function. ".

Re: PosRegEnable -does'nt work

Posted: 04 Jul 2013, 09:26
by HaWe
surely it can be done.
Related to the original source code, I'm simply confused about the original number of letters, the (actually, apparently) non-C-like syntax structure, it's complexity and sophistication and the amount of OR-ed expressions or variables which are cited.
(That's one of the reasons why I in principle use my own PID controller, hereby I know what it does and how it works - but that's admittedly my own personal problem and should not (and must not ) bother you in any way.)

Re: PosRegEnable -does'nt work

Posted: 05 Jul 2013, 01:50
by felix2ch
doc-helmut wrote:surely it can be done.
Related to the original source code, I'm simply confused about the original number of letters, the (actually, apparently) non-C-like syntax structure, it's complexity and sophistication and the amount of OR-ed expressions or variables which are cited.
(That's one of the reasons why I in principle use my own PID controller, hereby I know what it does and how it works - but that's admittedly my own personal problem and should not (and must not ) bother you in any way.)
Yes, it should be more clearly and more flexible if use own PID controller.Of course, all regulation options in firmware will be give up.