Re: [Emc-users] Take control of PID control
2013/5/12 Andrew parallel.kinemat...@gmail.com OK, I see now. There's a workaround for the problem. http://linuxcnc.org/lucid/emc2/index.php/italian/forum/24-hal-components/6487-pid-pin-problems Could You, please, explain, how does it solve the problem? OUT pin cannot be connected to IO pin. That solution proposes inserting passthru component in the middle, so initial OUT is linked to passthru.in and initial IO is connected to passthrough.out which is float out pin, the same type as initial OUT, so I would expect getting the same cannot link OUT pin to IO pin error. Or am I missing something here? -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 5/11/2013 3:52 PM, Andrew wrote: An IO pin can be connected unless there’s an OUT pin on the signal An OUT pin can be connected only if there are no other OUT or IO pins on the signal Regards, Kent Yes, I have read that too. I fail to understand what is the meaning of an IO pin? It is no different from an OUT pin. I will try to compile a pid.X.Pgain-in, it does not seem difficult. But normally when a plain user sees the need to make changes in old tried code that user likely has a problem with basic understanding ... -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/12 Viesturs Lācis viesturs.la...@gmail.com Could You, please, explain, how does it solve the problem? OUT pin cannot be connected to IO pin. That solution proposes inserting passthru component in the middle, so initial OUT is linked to passthru.in and initial IO is connected to passthrough.out which is float out pin, the same type as initial OUT, so I would expect getting the same cannot link OUT pin to IO pin error. Or am I missing something here? Hi Viesturs, I start losing my attention. Really I did not check that solution thoroughly. Does not seem to change much. Looks like a component has to assign values to PID pins directly, otherwise it would not work. The developers must know better if IO status for PID parameters is used for some reason. If not, it would be convenient to change it to IN. Andrew -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/12 Viesturs Lācis viesturs.la...@gmail.com Could You, please, explain, how does it solve the problem? OUT pin cannot be connected to IO pin. That solution proposes inserting passthru component in the middle, so initial OUT is linked to passthru.in and initial IO is connected to passthrough.out which is float out pin, the same type as initial OUT, so I would expect getting the same cannot link OUT pin to IO pin error. Or am I missing something here? Hi Viesturs, I start losing my attention. Really I did not check that solution thoroughly. Does not seem to change much. Looks like a component has to assign values to PID pins directly, otherwise it would not work. The developers must know better if IO status for PID parameters is used for some reason. If not, it would be convenient to change it to IN. Andrew I tried the passtru component. This does not work as I and maybe some one else expected. The load warning is different. The symbol == is new to me. But the value is not passed correctly. So it almost works. servo2.hal:49: Warning: pin 'X.Pgain' is connected to a signal float 0.06 P0 == input.0.abs-rx-position == passthru.0.in float 0 P0a = X.Pgain = passthru.0.out // Lars -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/12 Viesturs Lācis viesturs.la...@gmail.com Could You, please, explain, how does it solve the problem? OUT pin cannot be connected to IO pin. That solution proposes inserting passthru component in the middle, so initial OUT is linked to passthru.in and initial IO is connected to passthrough.out which is float out pin, the same type as initial OUT, so I would expect getting the same cannot link OUT pin to IO pin error. Or am I missing something here? Hi Viesturs, I start losing my attention. Really I did not check that solution thoroughly. Does not seem to change much. Looks like a component has to assign values to PID pins directly, otherwise it would not work. The developers must know better if IO status for PID parameters is used for some reason. If not, it would be convenient to change it to IN. Andrew I tried the passtru component. This does not work as I and maybe some one else expected. The load warning is different. The symbol == is new to me. But the value is not passed correctly. So it almost works. servo2.hal:49: Warning: pin 'X.Pgain' is connected to a signal float 0.06 P0 == input.0.abs-rx-position == passthru.0.in float 0 P0a = X.Pgain = passthru.0.out // Lars It indeed does work! I just forgot to addf passthru.0, embarrasing! // Lars -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 05/11/2013 02:19 PM, Lars Andersson wrote: Hi group, Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. The statement net P0 input.0.abs-rx-position == pid.0.Pgain gives me servo2.hal:35: Signal 'P0' can not add I/O pin 'pid.0.Pgain', it already has OUT pin 'input.0.abs-rx-position' halcmd: Can I do something better? This means that an out pin is already driving the pid.0.Pgain in pin. You can't have two or more pins driving any input. So, you must unlink the out pin from the pid pins before you try to link another out pin to the input. I think the command is unlinkp, but it depends on what you are trying to unlink. You should read the integrators manual http://www.linuxcnc.org/docs/LinuxCNC_Integrator_Manual.pdf The description of the commands is about half-way down. Jon Jon There is only one output input.0.abs-rx-position driving the IO 'pid.0.Pgain'. The trick was do drive the IO with an IO. Andrew pointed this out in this thread. // Lars -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 5/12/2013 3:39 AM, Lars Andersson wrote: On 5/11/2013 3:52 PM, Andrew wrote: An IO pin can be connected unless there’s an OUT pin on the signal An OUT pin can be connected only if there are no other OUT or IO pins on the signal Regards, Kent Yes, I have read that too. I fail to understand what is the meaning of an IO pin? It is no different from an OUT pin. I admit I struggled to wrap my brain around this notion when I first read the LinuxCNC docs. Syntactically, there is a difference in these pin types simply because the parsing rules in halcmd say there is a difference. In particular, the two rules quoted above mean two or more OUT pins can never be connected together by a signal, two or more IO pins can, or one OUT pin and one or more IO pins can. Semantically, the difference is conditional on the internals of the components involved. A quick grep of the src/hal/components directory shows the pin-direction definition HAL_IO occurs in 13 component files, pid.c included. I haven't studied how the IO-pin type is used in each, nor have I studied carefully different HAL configurations which use these particular components. Consequently, I can't say whether this HAL analog to tri-state logic is essential or merely convenient. Regards, Kent -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/12 Kent A. Reed kentallanr...@gmail.com I admit I struggled to wrap my brain around this notion when I first read the LinuxCNC docs. Syntactically, there is a difference in these pin types simply because the parsing rules in halcmd say there is a difference. In particular, the two rules quoted above mean two or more OUT pins can never be connected together by a signal, two or more IO pins can, or one OUT pin and one or more IO pins can. Looks logical that IO pin not only can be a source of signal (that's what OUT pin does), but also its value can be defined with setp. Just wonder what happens when several IO pins and no OUT pins connect to a signal. An IO pin which value has been defined first (say, with setp) must change all other IO pins values. Must be useful sometimes. Andrew -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 5/12/2013 6:02 AM, Lars Andersson wrote: The symbol == is new to me. Lars: '=' denotes bidirectional signal flow and is the symbol intended to correspond to IO pins as opposed to IN or OUT pins. Remember, though, the quote from the docs in my earlier message---these direction-indicator symbols are merely a convenience to the user. They don't communicate any information to LinuxCNC. The reason I get downright pedantic about this point is that we users are so used to the symbols we forget they may lie to us. If the HAL configuration file was generated by LinuxCNC from a loaded configuration then the symbols are correct according to the component declarations known to HAL. If the file was generated by a user using an editor then they may or not be correct. It won't matter to HAL when the file is parsed (although the actual pin connections will) but it would confuse a user who tries to make sense of the file. But you've already solved your problem, which is the important part of this thread. Regards, Kent -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On Sunday 12 May 2013 10:08:08 Kent A. Reed did opine: On 5/12/2013 6:02 AM, Lars Andersson wrote: The symbol == is new to me. Lars: '=' denotes bidirectional signal flow and is the symbol intended to correspond to IO pins as opposed to IN or OUT pins. Remember, though, the quote from the docs in my earlier message---these direction-indicator symbols are merely a convenience to the user. They don't communicate any information to LinuxCNC. The reason I get downright pedantic about this point is that we users are so used to the symbols we forget they may lie to us. If the HAL configuration file was generated by LinuxCNC from a loaded configuration then the symbols are correct according to the component declarations known to HAL. If the file was generated by a user using an editor then they may or not be correct. It won't matter to HAL when the file is parsed (although the actual pin connections will) but it would confuse a user who tries to make sense of the file. But you've already solved your problem, which is the important part of this thread. Regards, Kent Generally, in carving up my own .hal files, I've found that when setting up a net line, I can more easily parse it mentally later if I treat that line as net(tab)arbitrary-signal-name(tab)source-pin(tab)destination-pin(tab)destination-pin Where the (tab)destination-pin can be repeated as needed to send a signal several places. I can go back 6 months later and still figure out what I was doing. Because linuxcnc ignores all those == thingies, adding those can quickly become confusing, just count tabs instead. Cheers, Gene -- There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) My web page: http://coyoteden.dyndns-free.com:85/gene is up! My views http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml QOTD: You want me to put *holes* in my ears and hang things from them? How... tribal. A pen in the hand of this president is far more dangerous than 200 million guns in the hands of law-abiding citizens. -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 11 May 2013 20:19, Lars Andersson l...@larsandersson.com wrote: Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. As you have seen, an underlying problem is that the Gains are IO pins. They used to be parameters, but it was decided that pins would be more useful, but then it was realised that an input pin can not change its own value, so that internal limiting is a problem, so they were made into IO pins. Which isn't necessarily better. (ref http://psha.org.ru/irc/%23emc-devel/2013-04-30.html#19:09:14 ) The already-existing tristate-float component ( http://www.linuxcnc.org/docs/html/man/man9/tristate_float.9.html ) can be used to make the conversion. -- atp If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 11 May 2013 20:19, Lars Andersson l...@larsandersson.com wrote: Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. As you have seen, an underlying problem is that the Gains are IO pins. They used to be parameters, but it was decided that pins would be more useful, but then it was realised that an input pin can not change its own value, so that internal limiting is a problem, so they were made into IO pins. Which isn't necessarily better. (ref http://psha.org.ru/irc/%23emc-devel/2013-04-30.html#19:09:14 ) The already-existing tristate-float component ( http://www.linuxcnc.org/docs/html/man/man9/tristate_float.9.html ) can be used to make the conversion. I tried a different approach and duplicated the pins, one IO and one IN like this in mypid.c retval = hal_pin_float_newf(HAL_IO, (addr-pgain), comp_id, %s.Pgain, prefix); if (retval != 0) { return retval; } retval = hal_pin_float_newf(HAL_IN, (addr-pgain), comp_id, %s.Pgain-in, prefix); if (retval != 0) { return retval; } It compiles correctly and loads correctly and the regulator obeys the IN pin, but it does not reflect in the value of the IO pin. Don't understand why? Both points to the same internal variable. -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 11 May 2013 20:19, Lars Andersson l...@larsandersson.com wrote: Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. As you have seen, an underlying problem is that the Gains are IO pins. They used to be parameters, but it was decided that pins would be more useful, but then it was realised that an input pin can not change its own value, so that internal limiting is a problem, so they were made into IO pins. Which isn't necessarily better. (ref http://psha.org.ru/irc/%23emc-devel/2013-04-30.html#19:09:14 ) The already-existing tristate-float component ( http://www.linuxcnc.org/docs/html/man/man9/tristate_float.9.html ) can be used to make the conversion. I tried a different approach and duplicated the pins, one IO and one IN like this in mypid.c retval = hal_pin_float_newf(HAL_IO, (addr-pgain), comp_id, %s.Pgain, prefix); if (retval != 0) { return retval; } retval = hal_pin_float_newf(HAL_IN, (addr-pgain), comp_id, %s.Pgain-in, prefix); if (retval != 0) { return retval; } It compiles correctly and loads correctly and the regulator obeys the IN pin, but it does not reflect in the value of the IO pin. Don't understand why? Both points to the same internal variable. This is the rsult after setting X.Pgain-in: halcmd: show pin X.Pgain Component Pins: Owner Type Dir Value Name 7 float I/O 0 X.Pgain 7 float IN 55.84 X.Pgain-in == P0 -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
Kent A. Reed wrote: On 5/12/2013 6:02 AM, Lars Andersson wrote: The symbol == is new to me. Lars: '=' denotes bidirectional signal flow and is the symbol intended to correspond to IO pins as opposed to IN or OUT pins. It is important to remember that these symbols ( =, =, etc.) are for the human reader, ONLY, and are completely ignored by HAL. Jon -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
[Emc-users] Take control of PID control
Hi group, Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. The statement net P0 input.0.abs-rx-position == pid.0.Pgain gives me servo2.hal:35: Signal 'P0' can not add I/O pin 'pid.0.Pgain', it already has OUT pin 'input.0.abs-rx-position' halcmd: Can I do something better? halcmd show thinks pid.0.Pgain is a pin, man pid thinks pid.0.Pgain is a parameter. Seems that man wins over halcmd?! Thanks! Lars -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/11 Lars Andersson l...@larsandersson.com Hi group, Trying to control servo P I and D at runtime with potentiometers to practise loop optimising. The statement net P0 input.0.abs-rx-position == pid.0.Pgain gives me servo2.hal:35: Signal 'P0' can not add I/O pin 'pid.0.Pgain', it already has OUT pin 'input.0.abs-rx-position' It means that input.0.abs-rx-position is OUT pin. Though iy should not be. I guess that == might be wrong Try this: net P0 input.0.abs-rx-position pid.0.Pgain Andrew -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
2013/5/11 Lars Andersson l...@larsandersson.com Yes, input.0.abs-rx-position is an out pin, it is the value from a potentiometer. My wish is to feed this into the PID Pgain IO pin so I can modify Pgain by turning a knob. I find that net seems to treat OUT and IO pins equal. setp makes a difference between OUT and IO so I can change Pgain with setp while the system is running, but I can't make signal do it. I am yet to find a way around this. OK, I see now. There's a workaround for the problem. http://linuxcnc.org/lucid/emc2/index.php/italian/forum/24-hal-components/6487-pid-pin-problems Andrew -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Take control of PID control
On 5/11/2013 3:52 PM, Andrew wrote: I guess that == might be wrong Quoting from the Basic HAL Tutorial section on net: The command net creates a connection between a signal and and one or more pins. If the signal does not exist net creates the new signal. This replaces the need to use the command newsig. The optional direction indicators =, = and = are only to make it easier for humans to follow the logic and are not used by the net command. and, farther down, A pin can be connected to a signal if it obeys the following rules: An IN pin can always be connected to a signal An IO pin can be connected unless there’s an OUT pin on the signal An OUT pin can be connected only if there are no other OUT or IO pins on the signal Regards, Kent -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users