Thanks all for the suggestions. The paper that describes the theoretical calculations is 20 years old from PSI, so I assume it's been implemented there, and I think also at SLAC for undulator controls based another paper I’ve seen. Since it will be operational for 30+ years, I’m leaning towards a C/C++ implementation using a well established matrix library.
Cheers,
Matt
> On Feb 19, 2020, at 10:36 PM, Johnson, Andrew N. <anj at anl.gov> wrote:
>
> Hi Matt,
>
> About 25 years ago (wow, was it really?) John Maclean and I devised the controls for the Gemini primary mirror where the IOC did various matrix calculations before passing the results to the dynamic support system actuators via CANbus. We did the maths in subroutine record sub’s using shared global variables to store the small number of large matrices we had to handle, and only used the sub-records to control when the calculations were executed (and to hold scalar parameters and results). We also used waveform records with “devSymb” device support to read and write the shared global variables, although I don’t remember how we synchronized everything to prevent races. The aSub didn’t exist at the time, although Gemini did soon devise the genSub that was its precursor.
>
> Nowadays I would certainly explore your idea of using aSub’s with a standard matrix library. Copying a 5x5x8=200 byte array across a DB link should be reasonably fast as long as you don’t need to do it too much (our matrices were considerably larger and the CPU much slower back then).
>
> HTH,
>
> - Andrew
>
> --
> Sent from my iPad
>
>> On Feb 19, 2020, at 4:49 PM, Pearson, Matthew R. via Tech-talk <tech-talk at aps.anl.gov> wrote:
>>
>>
>> Hi,
>>
>> I’m starting a project involving calculating neutron guide positions where the positions are defined by 5 cam based movers. The position calculations involve 5x5 matrix multiplication and inversions, and some of the matrix elements are trigonometric functions.
>>
>> I’m prototyping the calculations in Python, but does anyone have advice on how to implement the calculations in an EPICS database? My first thought is to use aSub records (or a custom record) linking to GSL libraries.
>>
>> I suspect similar work is routinely done on accelerator controls?
>>
>> Cheers,
>> Matt
>>
>>
>> Data Acquisition and Controls Engineer
>> Spallation Neutron Source
>> Oak Ridge National Lab
>>
>>
>>
>>
>>
>>
>>
- References:
- matrix multiplication and inversions Pearson, Matthew R. via Tech-talk
- Re: matrix multiplication and inversions Johnson, Andrew N. via Tech-talk
- Navigate by Date:
- Prev:
Re: MRF Delay Compensation Function Shen, Guobao via Tech-talk
- Next:
Re: MRF Delay Compensation Function Timo Korhonen via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: matrix multiplication and inversions Johnson, Andrew N. via Tech-talk
- Next:
Re: matrix multiplication and inversions Matt Rippa via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
|