- Posts: 425
- Thank you received: 0
sum2 gain settings to select two values
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
-
Less
More
10 years 2 weeks ago #81596
by auto-mation-assist
sum2 gain settings to select two values was created by auto-mation-assist
I have been trying to change the gain settings on both gain inputs of the sum2 function from within hal from the output of a mux2 function. Setp will set it to one of the two values I need for each input but I need to switch each gain input between two values from within hal. Is this possible if the mux2 output can somehow be converted to a float number? If not is there alternative that would give the same result?
Please Log in to join the conversation.
10 years 2 weeks ago #81605
by PCW
Replied by PCW on topic sum2 gain settings to select two values
mux2 does use floating point inputs and outputs
mux_generic can use either and can even do conversions
mux_generic can use either and can even do conversions
Please Log in to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 425
- Thank you received: 0
10 years 2 weeks ago #81617
by auto-mation-assist
Replied by auto-mation-assist on topic sum2 gain settings to select two values
sum2 was the source of my problem. The problem was that the below listed items in sum2 are parameters and can only be set by using "setp" in the hal file and can only input a number. To work around this problem I have modified my sum2 function and changed the three parameters to input pins, and then re-compiled linuxcnc. This fixes my problem but makes updating linuxcnc a little harder due to the customized sum2 having to replace the supplied one before compiling. I think that making these changes makes the sum2 function much more useful.
sum2.N.gain0 float rw (default: 1.0)
sum2.N.gain1 float rw (default: 1.0)
sum2.N.offset float rw
sum2.N.gain0 float rw (default: 1.0)
sum2.N.gain1 float rw (default: 1.0)
sum2.N.offset float rw
Please Log in to join the conversation.
10 years 2 weeks ago #81671
by andypugh
Replied by andypugh on topic sum2 gain settings to select two values
If you want to do mutiplication then the "scale" function is likely to work better than a modified "sum2"
The "gain" parameters of "sum2" are mainly intended to make subtraction possible, and maybe to handle unit conversion.
The "gain" parameters of "sum2" are mainly intended to make subtraction possible, and maybe to handle unit conversion.
Please Log in to join the conversation.
Time to create page: 0.089 seconds
