Tracking of the sun, which increases the efficiency of solar energy production systems, has shown considerable development in recent years. This development has been achieved by custom-positioned light sensors, image cameras, sensorless chronological systems and intelligent controller supported systems or by synergetic use of these systems. This study contributes to this research area with a novel spherical-based sensor which measures spherical light source emittance and localizes the light source. This sensor was built by using miniature light sensors placed on a spherical shaped three-dimensional printed body with data acquisition electronic circuitry. Besides the developed sensor data acquisition embedded software, preprocessing and filtering processes were conducted on these measured data. In the study, the outputs of Moving Average, Savitzky-Golay, and Median filters were used for the localization of the light source. The center of gravity for each filter used was determined as a point, and the location of the light source was determined. The spherical sensor system obtained by this study is applicable for various solar tracking methods. The approach of the study also shows that this measurement system is applicable for obtaining the position of local light sources such as the ones placed on mobile or cooperative robots. Solar energy is one of the most promising energy sources in today’s world, where clean and sustainable energy production is highly important. Considering the energy outlook of the world and the studies conducted, solar energy will be accepted as one of the primary energy sources among energy production sources in a few decades ,2,3. DemAn increase in the demand for solar energy has accelerated the studies on increasing efficiency in solar-powered systems. Despite the efficiency-enhancing studies conducted in solar cell technologies, the efficiency levels of the systems installed with solar panels still have not reached the desired level. Therefore, methods that will increase the total efficiency of solar-powered systems are of great benefit. The tracking of the sun’s position in the sky is one of the technologies used within this context.Studies on photovoltaic tracking systems and developed technologies were presented in the studies conducted in a wide range by ,11,12,13Most of the studies using sensors, Light Dependent Resistors (LDRs), cameras, and specialized sun sensors are preferred. In the studies using LDRs, the positions where the light intensity of the sun in the sky is high are detected by specially positioning these LDR sensors within the installed systems. The positions of LDRs can be placed either in West-East or North-South directions, or in special positions ,17,18,19Use of camera sensors is another sensor approach for the solar tracking systems. Generally, a powerful embedded microcomputer is needed to employ image processing algorithms and camera with fisheye or wide-angle lenses are utilized in order to capture required images ,28,29,30In this study, a novel spherical light-based positioning sensor is proposed to locate a light source in spherical angular form. This sensor offers applicability for various control techniques like those mentioned above. The developed sensor can be positioned beside a solar cell to obtain more efficient energy from the sun or beside robots in industrial production to detect the location referenced to a light source. The sun is considered as the light source; but, from a wider perspective, this light source can be any light source emitted in different wavelengths. Light sensors placed on the spherical body in conformity with the spherical angles provided the required sensor data for tracking of the light source. As the advantage of spherical placement of these light sensors, geometric transformations are not needed while interpreting the data.The layout of the study is given in The designed measuring system consists of a spherical measuring body with light sensors placed on it, circuits designed for measurement, and embedded software architecture. In this measurement system, the beams radiated from a light source fall onto the spherical body. Light sensors were placed on the spherical body in conformity with the spherical angles. An experimental setup was carried out to present a light source and sensor relation. Thus, raw sensor data was collected by the sensor electronics, the multiplexer logic, microcontroller, and the embedded software on the microcontroller. Collected raw sensor data were transferred into the computer environment by means of USB serial communication. With this transferred data, pre-processing of the raw data using filters and light sensor localization calculations can be performed in a personal computer (PC) environment using MATLAB. Moving Average, Savitzky-Golay, and Median filtering were used comparatively to process the raw data in order to better find the coordinates of the light source and obtain more accurate results. After filtering a threshold was applied to ignore the light sensors which has low light data. Furthermore, the center of gravity calculation was used to find the exact light coordinates independent of the exact locations where the sensors were placed. Then raw sensor data, three types of filtered data, and center of gravity coordinates were shown graphically in three-dimensional spherical and two-dimensional top view.The overview of the sensor measurement system is given in The spherical sensor body collects the reaching light emissions from the light source with the installed 37 light sensors combined with multiplexers and a microcontroller. Simply, the microcontroller reads the light sensors using a multiplexer mechanism and forms a data format which is to be sent. Then, the collected raw light intensity data is transferred by USB serial communication to the PC. In the PC, raw data is preprocessed and filtered using MATLAB software to find the exact light sensors effected by the light source. Then, the raw and filtered data is visualized to test and see the sensor working properly.The response time of the developed measurement system can be defined as the result of data acquisition, preprocessing, filtering, localization, and visualization. During the data collection phase, the response time of analog circuits and microcontroller circuits was measured as approximately 15 msec. The preprocessing, filtering, and localization processes were measured as a maximum of 25 msec in the MATLAB environment. Thus, the total sensor evaluation time corresponds to 40 msec. Here the fastest filtering algorithm is Moving Average method, with an 8 msec response time. The response time of all processes including visualization is a maximum of 820 msec, using a standard office PC. The measured time varies depending on the processing capacity of the computer used.In recent years, especially for prototype development, the high impact of additive manufacturing (AM) or three-dimensional (3D) printing technologies in general has become apparent. Thanks to AM technology, localized, customizable productions of the objects rather than mass production and transportation are made possible. Thus, such parameters as cost and time can be saved on to a considerable extent. AM technology also provides novelties for industrial components that have been traditionally produced. These components, about which common knowledge regarding the mechanical design are already known, can be reproduced with different materials in a customized way . BesidesIn this study, a CAD model of the spherical body was designed in a computer and then manufactured by using AM technology as a prototype. For the light sensors, gaps are created on the spherical body in horizontal and vertical directions and with 30° angular distances to enable the light sensors to fit in. This 30-degree aperture in half sphere corresponds 36 light sensors, and we obtain 37 light sensors involving the light sensor located on the top of the dome. The produced model can be seen in The designed model was sliced with the Cura software and printed using PLA filament material with a 0.4 mm nozzle diameter using the Ender 5 3D printer.By considering the printing quality, printing was completed with the help of supportive structures. In the post-processing phase, supportive structures required for the printing were taken apart and the printing was cleaned up. Then the rasping process was applied manually on a limited extent to obtain a smoother surface. The diameter of the model sphere is 50 mm, the inner thickness for the sphere is 5 mm, and for the part into which the sphere is placed it is 10.92 mm. The inner part of the sphere is left empty. In this way, enough space to place the light sensor cables onto the circuit cards is acquired. The body is affixed to the circuit box underneath with screw holes on both sides to make the body stable and balanced during the measurements. The 3D printed body created based on the designed model and used during the rest of the study is shown in LDR’s can be used for detecting the sun’s position in the sky during solar tracking. In these studies, LDR’s are placed in specific positions in a way to represent the geographical directions with various methods. Although solar tracking is made possible by using LDR’s in this way, we had mentioned that the results are obtained within certain limits and the angular outputs could not be attained.In our study, instead of LDRs, TEMT 6000, a phototransistor sensitively working especially on the visible wavelengths, is used as the light sensor. Thus, electrical current is obtained with a linear curve in accordance with Lux, the luminous intensity unit emerging in the light sensor. These light sensors exhibit the sensitivity peak point value at 560 nm and the range of spectral bandwidth is 360–970 nm . ConcordIn the study, light sensors are placed on the spherical body with the distance of r = 25 mm fixed radius value and used in array order. Top view of the locations of 37 light sensors is shown in Examining the installment of the light sensors in the spherical structure, 30°-degree angular spacing is created among the light sensors in azimuth direction and in elevation direction. The light sensors are numerated with the symbols of S1, S2, S3, S4, … S37. The enumeration starts from the 0° azimuth and 0° elevation (S1) and continues in the elevation direction with 30° elevation (S2), 60° elevation (S3), then S4 comes in 30° azimuth and 0° elevation and continues like that. The S37 is in the top of the sphere in 90° elevation in every azimuth angle.Data acquired from the light sensors, placed on the spherical body, compose the raw sensor data. TEMT 6000 light sensors used in the spherical sensor produce linear current output in the range of 10–1000 lux. These values, which are read as voltage values by the ATmega328P microcontroller, are read in the range of 0–5 V with 10-bits analog to digital conversion resolution. Voltage output values (0–5 V) of 37 light sensors are read by the designed multiplexer circuits.Reading procedure is carried out by sequentially reading the light sensors connected to three multiplexers. The voltage values read by the light sensors are transformed into luminous intensity (lux) values by the microcontroller. Then data transferred serially using a serial-USB adapter to PC MATLAB environment via USB interface. In order to prevent possible speed and synchronization problems, the data to be transferred is optimized in terms of data verification.In the empirical experiments carried out, optimal serial communication speed is determined as 500 kbps (~62.5 kb/s) considering the transfer capacity of the microcontroller. Freezing and lagging problems are observed under this value during the MATLAB visualization process. On the other hand, when the study is carried out above this level, loss can be seen in the transferred data. Transferred data are checked by the Checksum method from both communication nodes and the data are proved to be error-free. In addition, in order to protect the stability of the transferred data load, balanced data flow is provided by sending the same amount of data bit during each transfer process.The raw sensor data is plotted graphically for different azimuth and elevation angles to understand how much the reference light sensor position differs from the position measured in Experiment 1. To reduce the difference, the raw sensor data should be filtered for better sensor results. Experiment 1 setup and related graphs are given in the following sections.Experiment 2 was designed for filtering purposes and three different smoothing filters were tested to filter the raw sensor data and the improved results are presented in the following sections. For this purpose, Moving Average (MA) filter, Savitzky-Golay (SG) filter, and Median Filter (MF) were used for noise reduction or smoothing out the short-term fluctuations in a data set. Thus, high-frequency or ambient noise components were filtered from the data coming from the sensors. However, these filters work in slightly different ways and have different strengths and limitations.X denotes measured data samples and n denotes amount of measured data for averaging.The MA filter is a simple filter that uses the measured data sequentially for averaging ,43. The Algorithm 1: 40 Points—Moving Average Filter Algorithm2:  for each sensor_value do3:    do until i = 40 4:      Measure Si5:      sum = sum + Si, i = i + 16:      For i = 40, A = sum/407:      end8:    repeat for next 40 sensor_value9:  end for sensor_value1:  Define A = 0, sum = 0, i = 1The MA filter used in the study; 40 measurement samples were used in order to take average for each filtering window. The 40-point MA filter algorithm used in this study is given in Algorithm 1.The Savitzky-Golay Filter is introduced as a smoothing algorithm ,45. The Algorithm 2: Savitzky-Golay Filter Algorithm2:  for i in range data_length3:    window = data[integer(i—data_length/2): integer(i + data_length/2 + 1)]4:    coeffs = polynomial fit in range of window_length5:    poly = define polynom using coeffs6:    y[i] = poly(integer (data_length/2))7:  end1:  Define data, data_length, window_lengthSavitzky-Golay filtering calculations are given in Algorithm 2. Additionally, more enhanced and superior versions are available ,47.AlgoAlgorithm 3: Order = 5 Median Filter Algorithm2:  Measure light sensors array S3:  for each 5 light_sensor_values  do4:    Sort light_sensor_values5:    Select median6:    Assign Yi to median value, i = i + 17:  end for 5 light_sensor_values8:  repeat for next light_sensor_values1:  Define Y = 0, i = 1Median filter is another filtering and de-noising algorithm used in signal processing applications ,49. The Algorithm 4: Threshold algorithm2:  total = mu + sigma3:   maxvalue = find max (sensor_data)4:   thrvalue = total / maxvalue1:  Define sensor_data, mu, sigmaA histogram was applied using 37 light sensors data to find maximum point of the curve which is useful to calculate the threshold value for discarding the light sensors has lower light intensity value. The calculated threshold values are given in the Results section and applied before the filtering methods to get more accurate sensor localization data. The threshold value calculation algorithm is given in Algorithm 4.The result localization sensor data were processed with the center of gravity angles calculation to find a theoretical light source coordinates as a point. Both angles were simply calculated as a ratio of each light sensor angle weighted sum over total 37 light sensor values. The equations are given to find the elevation and azimuth angles of the center of gravity in Equation (3) and (4) derived from the study  considerAfter finding the center of gravity azimuth and elevation angles, the Cartesian coordinates can be calculated using the conversion Equations (5)–(7); therefore, the spherical center of gravity point is easily marked on the spherical graphics to determine the light of source localization. This conversion can be easily done by using sph2cart function of MATLAB.Spherical sensor raw data filtered—threshold applied processed data and center of gravity can be visualized and the related plots given in Azimuth and elevation angles are the angles used for determining the sun’s location in the sky. Azimuth angle (φ) states the angle that is formed by the sun’s position and the geographical north while the elevation angle (θ) points out the angle that the sun forms with the horizontal plane. The relationship of the sun in the sky with the observer reference point is shown in On condition that the measurement system remains at the fixed position, the measurements were made by moving the used light source in azimuth and elevation angles and with 30° angular distance. The measurements were made for 37 different locations in total.The distance between the measurement system and the light source (d) was fixed at 40 cm value. The reason is that h and d values increase more than necessary depending on the elevation θ angle value.Required h, d, and R parameters were calculated with the trigonometric features in the measurements, and they were determined by using a laser meter in each measurement. The direction of the light source was controlled with a laser. Thus, erroneous measurements were avoided even though the light source was manually placed at the elevation and azimuth angles.Spherical body and the electronic box used in the measurement system were placed in a way to enable independent movement in azimuth direction. By designing the experimental setup in this way, angular rotation of the measurement system was ensured without needing the movement of the light source in different azimuth angles.Experimental environment was isolated from interfering and external light sources during the experiments.The proposed measurement system was tested in the experiment environment and measurement values that are corresponding to the reference values were aimed to be obtained. Artificial light source was used in the experiments conducted and location of the light source was changed and thus, measurements were maintained and recorded. Subjects paid attention to regarding the experimental setup design and some key points were as follows:According to key points mentioned, the experimental setup shown below in The electronic box contains the necessary electronic system to operate the sensor and get the sensor data to a PC via USB connection. The electronic box can be rotated to adjust the sensor azimuth direction.Using the experimental setup two different experiments were carried out to prove the sensor operation success.Experiment 1: A LED light source was directed to selected light sensors to test the intended light sensor values. Here the aim of the experiment is to find which light sensor is affected by a light source and shows the maximum light intensity value. The measured maximum value has a close neighborhood with the reference target light sensor. The parameters are shown in The total six measurements were conducted at these locations and the results of sensor data recorded as raw .txt data which labeled as measurement number (MN) for Experiment 1. The measured sensor location difference and the sensor values in the neighborhood were displayed in Results Section 3.1Experiment 2: A LED light source was directed to light sensor groups aiming one of them in six designed measurements to apply filtering to refine the light sensor outputs and to calculate the center of gravity. Here the light source distance was higher than the one in Experiment 1. The reference light sensors were selected as a group of neighbors to find out how the sensor system differentiates these neighbors from each other. The parameters related to the measurement numbers for Experiment 2 are given in The light source was positioned in relation to the distance parameters of d, R, and h. The first four experimental measurements were aimed to test S1, S2, S3, and S37 respectively, only changing the elevation angle from 0° to 90° degrees and keeping the azimuth angle fixed at 0°. The last two measurements were aimed to test S35 and S32, respectively, turning the table in azimuth direction from North to East with keeping the elevation angle as 30° and moving azimuth angle from 330° to 300°.The total six measurements were conducted at the mentioned locations and the results of sensor data were recorded as raw .txt data which labeled as measurement number (MN) for Experiment 2. The histograms plots, three-dimensional, and two-dimensional sensor graphical visualizations of the measurements were given in the Results Raw data measurements for Experiment 1 were carried out using the experimental setup mentioned in Here, the measured data were shown as raw data values without any processing. Elevation and azimuth angles, at which the light source is located, were accepted as reference points. Measurement results yield the highest outputs mostly around reference point or their neighbors. It is seen that the light was scattered, and the light sensors created approximate values with neighbor points.In the first three measurements, the azimuth angle was kept constant at 150° and the elevation angle was changed from 60° to 0°. In these three measurements, the position of the light source was decreased in terms of the elevation angle. Thus, it was seen that the light beams scatter more, and the total measured values decrease. The reference point and the measured point which has the maximum value was at a close neighborhood but not at the same point. In the last three measurements, the azimuth angle was kept constant at 330° and the elevation angle was changed from 60° to 0°. Here, again the reference point and the measured point location are at different points, but they are closer each other than the first three measurements. In some cases, a match can also occur, such as at 0° altitude and 330° azimuth. This shows that different measurement accuracies are possible because of the light source being manually adjusted. This can be fixed either through an automatically controlled experiment setup or by using filtering and mathematical calculations to find the exact localization points as in According to the filtering methods mentioned in For three filtering methods, all 37 light sensors data were plotted to show light sensors value when the light source was spotted directly to the location of S1 at an elevation of 0 degree .Especially the zero valued sensor data were really considered to be removed for finding the right threshold value. The average value of 12 was nearly the same for all the filters mean value. This is the discarding low limit of the sensor data which is shown in From Six different measurements were designed in which the experimental light source was aimed at different sensor regions to see and test how the sensor works. The collected sensor data of these measurements were processed using MATLAB. First, a histogram was applied to all of the 37 light sensors data to see the illumination range of the light sensors and the histogram distribution. Using normal distribution fitting on the histogram data, the threshold parameter was calculated. The threshold value was applied to the raw data for eliminating the sensor data which do not contribute much. The calculated threshold value ensures that the light source localization is more reliable and correct. Then, three selected filtering methods were applied to raw data to obtain a more precise localization result.The histogram was applied with MATLAB histfit function (histogram fitting) with normalized y data. This function draws a histogram of the values in the data by creating several bins equal to the square root of the number of items in the data and then fits it to a normal density function. After, MATLAB fitdist function (distribution fitting) fits a normal distribution to sensor data, and mean value and standard deviation parameters were calculated. μ shows the mean value and therefore maximum point of the fitted histogram curve. This can be a candidate for a threshold value considering the maximum sensor value. However, here a higher value which corresponds to the 70.7% of the maximum value was preferred. σ shows the standard deviation and the final threshold value is here calculated as sum of histogram μ and σ values. Using the ratio of final threshold value over maximum sensor value, we get the normalized threshold value to apply a threshold filter. The above processing steps were repeated for every measurement and related threshold values were given for each of the measurement numbers (MN1 to MN6) in The histogram plots were given in Two display formats were preferred to visualize the data obtained with the measurements. The first one was the representation based on spherical coordinates; the second one was the top view to see 360-degree light sensors positions from top. For a better understanding and to see the sensor experiment results, the NORTH was shifted 180-degree in clockwise. Therefore, S1-S2-S3 was now in the place of S19-S20-S21, and S19-S20-S21 was in the place of S1-S2-S3. Yet still the light sensors placement direction was the same as clockwise. In these plots also the minimum and maximum values of light intensity values with color codes were given in color bars. Referring to these lux color codes the light sensor values were shown in 3D sensor locations. The top view was also given to perceive all sensor values in the spherical form. Finally, the calculated center of gravity was marked with a black dot in each of the 3D and top views.The Raw Data, Moving Average Filter output, Savitzky-Golay Filter output, and Median Filter output plots in three-dimensional hemisphere format and in top view format were given in Graphic plots for the measurements from MN3 and MN4 were shown in Graphic plots for the measurements from MN5 and MN6 were shown in Although three methods described for smoothing of the sensor data, further research can be done on different techniques to get better results. Here all filters perform nearly the same. However, median filter produces more reliable results.There have been many studies on solar tracking systems and sun sensors in the literature. These studies are focused on various problems of solar energy systems. Collecting the highest energy from the sun is one of these problems. To achieve that, the position of the sun in the sky must be determined accurately.Many methods have been proposed that provide a solution to this issue. LDRs have been frequently used as a sensor circuit element, especially in the early studies. Although LDRs are preferred because they are cheap and easily available, it is not possible to build high accuracy systems with them. Besides, systems that use geographic location and time-date information also achieve good results. In these systems, there is a need to make astronomical calculations or to provide these data from external sources. Obtaining these data by calculating instantaneously brings with it high computational needs in the area where these systems are located. With the development of sensor technologies, technologies such as MEMS , in which microelectronic circuits are used, have also contributed to the field of solar energy. These technologies have provided high accuracy data to be obtained, but the difficulty of production and high cost prevent their widespread use. In addition, image processing technologies have also become one of the solutions that require intensive computation in order to establish high-accuracy systems in this field.When all the proposed methods are examined, it is seen that each of them has advantages and disadvantages. In this context, it is understood that there is a need for cost-effective and highly accurate solutions. In addition, it stands out as a desired feature that these solutions do not require intensive calculations and detailed geographical information. In this study, we intended to contribute to filling this gap in the literature. The aim was to find a solution for finding the position of the sun in the sky. The work in this study focuses on designing a spherical solar positioning sensor with high accuracy that can be used in solar tracking systems. In the first part of the study, a 3D sphere model was created in a computer aided design software to take advantage of spherical data collection. In order to obtain the data, appropriate light sensors were determined, and studies were carried out to realize the optimum use in this design. In this context, it was determined that the most appropriate sensor angular interval should be 30° for a sphere with the determined diameter. Accordingly, the light sensors were placed in the spherical prototype model. Then, electronic circuits that transmit the data measured by the sensor to the computer environment were designed.The novel sensor proposed in this work is an easily fabricated spherical structure with light sensors spaced at appropriate intervals. Thus, unlike any planar light sensor  or camera sensor structure , it does not require the addition of a lens for angular position sensing and finding the position of the incident light in spherical coordinates. In addition, since the position of the light source is detected spherically, there is no need to apply any geometric transformation. Thus, a light source positioning sensor that can be designed in hemispherical or fully spherical form for the intended use, where the number of sensors and the sensor light detection wavelength can be selected, has been obtained. This sensor is simple to manufacture, low cost, easy to use and can be used not only for locating light sources such as the sun but also for locating light sources in industrial production sites.The transmitted raw data had noise components. In order to avoid these noisy components of raw data and extract significant data, Moving Average (MA), Savitzky-Golay (SG), and Median (M) filters were applied. As an algorithm complexity MA and M filters are easier to implement then the SG filter. For low-pass filtering all filters perform similarly, but Median Filter was consistent in all measurement examples and easy to implement. Therefore, Median Filter was selected as a filter. The filtering method and the parameters can be properly selected with further new experiments in the future works.Then, visual image representations related to the tracking of the light source were obtained. These visual images can be processed to find the light source localization, but the processing power is needed. As a solution, the coordinates of the light source were calculated to get a more accurate and numerical result using center of gravity calculations. The center of gravity algorithm was implemented in azimuth and elevation coordinates for 37 independent light sensors to find spherical coordinates. Every light sensor independently has its center of gravity is on its center points, but the resulting center of gravity output can be any point on the sphere’s surface. Using the center of gravity result spherical coordinates; the microcontroller, programmable logic controller (PLC), or a PC can gather the localization coordinates numerically from the novel sensor designed. Since the sensor works by using the center of gravity algorithm to localize the sun according to the highest light intensity values falling on the light sensors, it also works accurately in cloudy or shady weather conditions. Cloudy or shady weather conditions are known to adversely affect the accuracy of the system in solutions where diffuse radiation is not taken into account or where the sun’s position is found only by the chronological method.The final system has a resolution depending on the number of sensors used. The selected light sensor numbers as 37 (which was designed to correspond 30-degree aperture in both azimuth and elevation angles) is at a level that can accurately track the source in solar energy applications basically. In addition, the center of gravity calculation allows us to have more resolution as a spherical localization to obtain rather than the discrete exact sensor localizations. However, considering the different usage areas of the sensor—for example in robotics—it may be necessary to adapt the large number of sensors. This will cause an increase in the complexity of the system as well as the software load and the data transfer size will be scaled up. However, because of the scalability of the sensor construction this can be easily implemented by changing the mechanical design.The sensor acts as a specifically designed spherical camera sensor which does not need any spherical lens attached to a planarly oriented camera, as we are accustomed to. Therefore, the spherical mathematical conversion is not needed to localize the light source position in a three-dimensional space. Thus, the natural three-dimensional structure of the studied novel localization sensor will have a software load advantage.Future academic studies or utilization in real life light localization problems can be inspired by this study. In addition, the potential of the study will lead various research in sensor design, solar energy, and robotics applications. Some of the possible future works are listed below.The sensor test was done with a manually adjusted mechanical testbed. The sensor orientation was also adjusted with hands. For more accurate tests an automatic motor driven testbed can be built.This study can be made more compact and standalone and can be turned into a smart sensor that can be used directly at the point where it is positioned with appropriate processing capacity and can be directly integrated into solar tracking systems. Several smart sensors can be deployed in an internet of things (IoT) environment for the smart interconnected applications.The studies that can be done on the production technology of the sensor computer aided model can be transformed into a more advanced sensor where more light sensors can be used together and can be optimized in terms of sensor placements. Thus, the resolution of the sensor can be increased.The spherical sensor structure will be able to find new areas of use in indoor environments with light sensors that will operate at different wavelengths. For example, it can be used for location coordination of mobile robots working in dark factories which yields energy saving.Fuzzy logic, neural network, or deep learning algorithms can be used to increase the performance of the sensor in the light source localization or light source tracking process.The spherical sensor, which is one output of the study, was resulted with a national patent and applied for the international patent.


In this work, the impact of implementing Deep Reinforcement Learning (DRL) in predicting the channel parameters for user devices in a Power Domain Non-Orthogonal Multiple Access system (PD-NOMA) is investigated. In the channel prediction process, DRL based on deep Q networks (DQN) algorithm will be developed and incorporated into the NOMA system so that this developed DQN model can be employed to estimate the channel coefficients for each user device in NOMA system. The developed DQN scheme will be structured as a simplified approach to efficiently predict the channel parameters for each user in order to maximize the downlink sum rates for all users in the system. In order to approximate the channel parameters for each user device, this proposed DQN approach is first initialized using random channel statistics, and then the proposed DQN model will be dynamically updated based on the interaction with the environment. The predicted channel parameters will be utilized at the receiver side to recover the desired data. Furthermore, this work inspects how the channel estimation process based on the simplified DQN algorithm and the power allocation policy, can both be integrated for the purpose of multiuser detection in the examined NOMA system. Simulation results, based on several performance metrics, have demonstrated that the proposed simplified DQN algorithm can be a competitive algorithm for channel parameters estimation when compared to different benchmark schemes for channel estimation processes such as deep neural network (DNN) based long-short term memory (LSTM), RL based Q algorithm, and channel estimation scheme based on minimum mean square error (MMSE) procedure. It can be noticed that the high energy consumption by the connected terminals in the current wireless networks can create an essential challenge in designing the upcoming 6G wireless systems . TherefoRecently, many authors have investigated different machine learning algorithms and artificial intelligence tools to optimize the resource allocation problems in NOMA system . FurtherIn the context of optimizing communication systems, several works have employed the Q-learning algorithm to enhance the performance of wireless networks based on different perspectives. The work in  applied Basically, by incorporating deep learning into RL, deep reinforcement learning (DRL) can address the challenges associated with Q-learning in terms of Q-table storage. Based on that, the work in  introducDeep reinforcement learning was also introduced in  to arrivSeveral machine learning (ML) algorithms have been suggested to clearly address diverse issues in wireless networks such as channel assignment, beamforming, and power allocation. Also, several RL algorithms have been proposed to handle the channel estimation task in wireless communication systems. However, most of the current research that covers the channel prediction task in the NOMA system is mainly dependent on deep neural networks (DNN) which include some sort of complexity in the network structure. Hence, in this work, we aim to introduce a deep reinforcement learning scheme based on a simplified DQN approach to reduce the complexity structure and at the same time enhance the channel estimation process. Furthermore, to the best of the authors’ knowledge, there is no study that explores the utilization of deep reinforcement learning (DRL) based deep Q network (DQN) algorithm for estimating the channel parameters for user devices in the NOMA system. In addition, and to the best of the authors’ knowledge, there is no study that has investigated the performance of NOMA system when both the DQN algorithm that used as channel estimator and the optimized power scheme are jointly implemented for user detection in NOMA system. It is worth mentioning that unlike classical deep learning algorithms, which mainly depend on learning from a training data set, the proposed DQN algorithm is developed based on the LSTM network to adapt to the variations in the channel and to dynamically enhance the system performance based on the interaction with the environment. A simplified DQN structure is proposed to demonstrate how RL based DQN algorithm is developed to predict the channel parameters for each user in the NOMA cell in Rayleigh fading channels.Investigate the combination between the RL algorithm and the LSTM model, to compose the simplified DQN structure in order to be utilized as a channel estimator.Validate the efficiency of the proposed DQN scheme, by establishing different benchmark schemes for comparison. Three different simulation environments are established as follows: (1) Channel prediction scheme based on standard minimum mean square error (MMSE) procedure ; (2) StaSimulate the impact of integrating the simplified DQN structure for channel prediction and the optimized power scheme derived in  for the In this work, the contributions can be summed up as shown:The remainder of this paper is structured as follows. In a NOMA cell, numerous user devices can be served via the same resource block (RB) by employing the power domain (PD) in both uplink and downlink transmissions. In this paper, we are considering a downlink NOMA cell, where the BS can serve distinct types of users or devices at the same time via different fading channels. At the transmitter side, the BS can assign a specific channel or subcarrier to every set of user devices, and the signals of these devices can be multiplexed using unique power levels. At the receiver side, each user device will receive the desired signal beside the undesirable signals related to other devices in the same channel that will be considered either as interference or noise. The undesirable received signals will be considered as noise if the power level of the desired signal is high, otherwise, these additional signals will be regarded as interference. To decode the desired signal, each user device will use the successive interference cancelation (SIC) procedure. The SIC technique will first decode the signal with the highest power level and then subtract that signal from the principal signal, and this process will continue until the desired signal is decoded.i. In the NOMA scenario, the data rate i can be expressed as follows:i, and i, and N. In the NOMA cell, all signals related to the N devices are combined, and the BS will transmit this composed signal to all users in the cell. The composed signal i. The composed transmitted signal i and Typically, before applying the SIC procedure at the receiver side, the channel parameters for each user need to be available or estimated to perform the equalization process. Also, to calculate the data rate or channel capacity for each user, we need to calculate the signal to interference plus noise ratio (SINR), and SINR itself includes the channel gain  follows :(3)X=∑i=Then, these user devices will be assigned power levels as follows:i can be represented as shown: The SINR for user device The BS can allocate power pression :(8)Pi=PTThe expression in (8), can be interpreted as follows: for proper achievement for the SIC process, the user device with low CNR must have a higher power level than the sum of power levels for other devices that have high CNR.Based on the aforementioned analysis, in what follows we will consider the scenario for three users downlink PD-NOMA system, and we will provide some sort of mathematical analysis for the achievable capacity for each user when both perfect SIC and imperfect SIC are applied . As indiThe 1st term in (11) represents the desired signal for far user, but the 2nd term denotes the interference term from the middle and near users. Far user is usually described by poor channel condition and his particular signal Likewise, the attainable bit rate for the middle user Typically, the user near the BS has a good channel condition; therefore, his signal In the case of imperfect SIC, the attainable bit rate for the middle user can be expressed as:In this section, we will introduce the concept of deep reinforcement learning (DRL), which is a special case of reinforcement learning procedure ,18. ReinObservations: the continuous measurements of the properties of the environment, and all of the observed properties in the environment can be included in the state space States: the discret observation at time step t can be denoted as state Actions: an action t from the action space Policy: a policy denoted by π(.), is the criteria that control how to select a certain action at any given state while interacting with the environment.Rewards: the immediate reward State-action value function: denoted by π.The fundamental elements in the deep reinforcement learning (DRL) algorithm can be listed as follows ,18:Obsert, the agent’s state will change from the current state In the DQN framework, when an agent selects an action  follows ,18:(17)  follows ,19:(18)QThe expression in 19) is known as the Bellman equation. The benefit of the Bellman equation is to represent the state-action Q-value function into two components: the instantaneous reward function ,19. On t is knownt.The basic DQN architecture is shown in t and T time steps. To minimize the loss function t time step using a stochastic gradient descent (SGD) algorithm applied on a batch of random samples selected from the replay buffer In this section, the simplified DRL structure will be introduced, and lgorithm . It is o follows :(21) Wt+Phase 1: Initialization and generation of training dataPerform a few random actions with the environment to initialize the experience replay data.Initialize the weights for the policy DNN and copy these weights to the Target DNN.Based on the initial interaction with the environment, random states can be generated to be used as input for the policy DNN.The policy DNN will predict the Q-values for all actions that can be decided in the current state, and then those Q-values will be inspected to select or identify a certain Q-value based on the most suitable action.Based on the selected and executed action, the experience replay will receive the reward and move to the next state.The experience replay will store the results in the replay buffer.Each result will be considered as a sample training data, that can be later used as training data.Starting with the first time step,Phase 2: Select a random batch for trainingSelect a batch of random samples from the replay buffer and use these samples as an inputs for both the policy DNN and the target DNN.From the random sample, use the current state as input to the policy DNN.The policy DNN can predict the Q-values for all actions that can be performed in the current state.Based on the decided or selected action, the policy DNN will identify the predicted Q-value.The next state from the selected random sample will be used as input to the Target DNN.The Target network will predict the Q-values for all actions that can be performed in the next state, then the Target DNN will select the maximum of those Q-values.Phase 3: Get the Target Q-valueThe immediate reward from the environmentThe max Q value that has been predicted by the target DNN in the next stateThe Target Q-value can be decided based on two componentsPhase 4: Compute the Loss functionCompute the loss function between the Target Q value and the predicted Q Value in terms of mean squared error (MSE).Phase 5: Back-propagate the Loss functionBack-propagate the loss in order to update the weights of the policy DNN using SGD.At this stage, the weights of the Target DNN are not updated and remain fixed, and this completes the processing for this time step.Phase 6: Repeat for next time stepThe policy DNN weights have been updated but not the Target DNN.This allows the policy DNN to learn to predict more accurate Q-values, while the weights for the target DNN remain fixed for a while.The process will be repeated for the next time step.T time steps, copy the policy DNN weights to the Target DNN. This step will enable the Target DNN get the updated weights so that it can also predict more accurate target Q-values.After L, which is the dimension of the input layer. In our scenario, we choose the input layer of the DNN to include 128 neurons, and the input states to the input layer will be shifted to the subsequent layer after updating the weight parameters [Long-short term memory (LSTM) network is a developed design from the recurrent neural network (RNN), which can inspect long-term dependencies and has the ability to remember previous information for future usage. The LSTM network has a chain structure consisting of multiple LSTM cells and the proposed DQN structure shown in rameters ,22.W, the recurrent weights R, and the bias b.As shown in The third layer in both the policy DNN and the target DNN is a fully connected layer that processes the outputs of the LSTM layer, and it assembles all of the characteristics and internal information gathered by the prior layers. The fully connected layer behaves separately at each time step, and all neurons in a fully connected layer are connected to all the neurons in the previous layer.The last adopted layer in both the policy DNN and the target DNN is the regression layer, which is responsible for computing the mean square error (MSE), improving the cell status, and updating the cell weights. A regression layer can also predict the response of the trained network. It is worth mentioning that normalizing the training data in the LSTM network enables the stabilization and acceleration of the training process for neural networks. It is shown in The design of a single LSTM cell is basically shown in Typically, the DQN framework involves an agent, a deep neural network (DNN), and the environment. The agent will interact with the environment via the DNN and decide which action to take. In our proposed DQN framework, the BS will be considered as an agent, and it will interact with the environment, which includes the user devices and fading channels. At the start, the agent (BS) will start exploring the environment to collect the information or the states for each user device in the cell, such as power distribution, user distance, channel model, and path loss ,24.t via the simplified DQN structure illustrated in Typically, at each time step T time steps. At each episode, the main aim is to estimate the channel parameters for each user in order to maximize the sum rates for all users in the NOMA cell. In our simplified DQN approach, the dimension of the input layer for the DNN based LSTM is set equal to the available states in state space S for each user, and correspondingly the dimension of the output layer is equal to the number of possible actions in the action space A for each user. As indicated in The period of time in which the agent interacts with the environment via the proposed DQN scheme is termed an episode, and every episode has a total duration of t. The second approach is the exploitation, where the agent can decide on an action to maximize the state-action value function The first approach is the exploration, where the agent discovers and carries out random actions at a time step t and correspondingly, the agent can receive a positive or negative reward and move to a new state In our proposed near-greedy action selection policy, the agent has an exploration rate of Initially, the distance between each user device and the BS and channel path loss needs to be specified in the dataset to facilitate the random generation of the channel coefficients for every user in the examined NOMA system ,14,22. IS can be created to include the following states:(a)The current power factor (b)The current user distance (c)The present channel path loss As previously mentioned, in our channel estimation procedure, we need to efficiently predict the channel parameters for each user device in the examined NOMA cell to facilitate the maximization of the sum rates for all users in the considered NOMA system at each time step S for N users NOMA system can be represented as [Accordingly, the resultant state space ented as ,14,25Change the distance of the user device within a limited range of 5 m.(b)Increase or decrease the power distribution factor For each user, all the actions that can be chosen by the agent (BS) can be selected from action space Algorithm 1 Proposed DQN Algorithm for channel parameters estimationInitialize policy DNN and target DNN networks with random weights Initialize experience replay memory (ERM).Randomly generate the exploration rate for each episode do for each step do   for each user device do                  based on            Select the channel parameters and add to action space end for       Observe the immediate rewards Insert Create a mini batch with random sample of tuple for each tuple in mini batch do    Predict the Q-values using policy DNN.    Approximate Q    Calculate the loss between      values generated from Policy DNN.     Update the weights end forend forT steps.end forThe reward function also plays an principal role in the DQN algorithm, and there are many ways to assign the rewards based on the selected action. In our developed DQN scenario, we decided to calculate the rate for each user in the NOMA system using (1), to reflect the immediate reward Initialize the weights for both the policy DNN and the target DNN.6).Initialize the ERM with a typical size of 10,000 Generate a random channel coefficients based on the fading model parameters with size = 120).(b)Based on the pilot symbols, approximate the channel coefficients with size = 8).(c)For each user, both the randomly generated channel parameters and the coefficients generated based on the pilot symbols will be combined and used as initial channel parameters. Initialize data records (tuples).Assign initial distance, initial power factor, and path loss, and prepare the state space Select a random state The policy DNN will select a random action and correpondigly select a random Q-value, and based on this step, the policy DNN can predict the channel coefficients.Calculate the rate, and based on the calculated rate the reward can be assigned.Go to the next state Compose a tuple Store a tuple Generate experience tuples = 1000, and store these tuples in ERM.Select a random batch of the tuples from ERM with batch size 32 tuples.4Number of episodes = 20, and number of steps = 10(a)From the policy DNN, select the Q-values (channel coefficients) randomly.(b)From the Target DNN select the Q-values based on the greedy policy(c)Assign the Reward.(d)Calculate the Loss function as follows: max value) − policy Q-value).Update the weights of the policy DNN based on the SGD.For each tuple in the random batch do the following:T = 102 steps, copy the weights of the policy DNN to the Target DNN.Every Activation functions used in LSTM layers are (sigmoid and tanh), while activation functions used at the output layer are (linear or Relu).SGD optimizer is utilized for weight updates.In this section, we can list the detailed workflow for the developed DQN algorithm that is responsible for estimating the channel parameters for each user in the examined NOMA system:N users and K base stations, the computational complexity of the proposed DQN algorithm can be introduced as follows: it is known that the size of the state space is denoted by K + N, and the size of the action space is 2(K + N). Therefore, the amount of the work per iteration can be described as follows It is important to quantify the computational complexity of the proposed algorithm. Overall, deep learning algorithms are mainly dependent on hyperparameters, hence, applying analytical methods to guarantee the convergence of the proposed DQN algorithm usually has some sort of difficulty. Hence, it is a common challenge in literature to prove the optimality and convergence of the algorithm in an analytical way ,27,28. Aollowing ,29, the rding to , the cor [ON2.37 ,30 but aDiscussion for the simulation parameters and settings is described in this section. The simulated downlink NOMA system includes three distinct user devices and one BS. The BS is equipped with a single antenna and each user device in the cell is also equipped with a single antenna. In the simulated NOMA environment, the modulated signal related to each user in the downlink transmission will be superimposed and transmitted by the BS to each user device via independent Rayleigh fading channels, and the path loss is set to 3.5. At the receiver side, we assume that a perfect SIC procedure is applied and AWGN is considered and the noise power density is set to MATLAB simulation tool is employed to realize the following: (1) inspect, characterize, and evaluate the performance of the proposed deep reinforcement learning based DQN algorithm which developed to be utilized as a channel estimator in the examined NOMA system, (2) Diverse performance metrics will be measured to evaluate the efficiency of the proposed DQN algorithm when being utilized in the channel estimation process. Simulations are accomplished with The simulation figures are created based on the assumption that the channel parameters for each user will be estimated based on the simplified DQN algorithm. Therefore, in order to examine the impact of utilizing the proposed DQN approach, the channel estimation technique based on standard minimum mean square error (MMSE) procedure  is also −1, while the achieved BER in the case of DQN is 10−2. Similarly, the improvment in the BER for middle and near user devices is obviously observed when the simplified DQN algorithm is applied compared to the MMSE procedure.Simulation results that describe the comparison between the proposed DRL based DQN algorithm and the MMSE procedure when both being utilized to estimate the channel parameters for each device are shown in In terms of the outage probability against applied power, In Simulation results for the sum rate performance metric against different numbers of users in the examined NOMA cell are also illustrated in Simulation results in terms of BER against the applied power are also shown in In this paper, the impact of utilizing a simplified deep reinforcement learning based DQN algorithm to specifically estimate the channel parameters for each user device in the NOMA system is discussed. In the proposed algorithm, the DQN model is initialized based on generating a random channel parameters then the weights of the simplified DQN model are updated based on the interaction between the agent and the environment in order to maximize the received downlink sum rates and at the same time minimize the loss function. The reliability of the developed DQN structure to estimate the channel parameters is examined by comparing the performance of the proposed DQN algorithm with a diverse benchmark schemes. A selective benchmark schemes were simulated, such as MMSE procedure for channel estimation, DNN based LSTM for channel estimation, and RL based Q algorithm for channel estimation. Simulation outcomes have proven that the simplified DQN algorithm can provide a noticeable enhancement in terms of the system performance compared to the simulated benchmark schemes. Furthermore, various performance metrics have been examined, and the simulation results also verified the superiority of the simplified DQN structure even when the cell capacity is increased.


A novel continuous energy scan routine has been implemented at the BioMAX beamline at MAX IV Laboratory. It is about five times faster than the conventional step scanning routine and facilitates user experiments utilizing the single-wavelength anomalous dispersion and multi-wavelength anomalous dispersion techniques. In X-ray macromolecular crystallography (MX), single-wavelength anomalous dispersion (SAD) and multi-wavelength anomalous dispersion (MAD) techniques are commonly used for obtaining experimental phases. For an MX synchrotron beamline to support SAD and MAD techniques it is a prerequisite to have a reliable, fast and well automated energy scan routine. This work reports on a continuous energy scan procedure newly implemented at the BioMAX MX beamline at MAX IV Laboratory. The continuous energy scan is fully automated, capable of measuring accurate fluorescence counts over the absorption edge of interest while minimizing the sample exposure to X-rays, and is about a factor of five faster compared with a conventional step scan previously operational at BioMAX. The implementation of the continuous energy scan facilitates the prompt access to the anomalous scattering data, required for the SAD and MAD experiments. The measurement and analysis of the fluorescence counts allow the identification of the energies at which the real and imaginary components of the anomalous scattering factor et al., 2014et al., 2016et al.  based on the technology by Yamamoto  al. 1992 that all−4. Downstream of HDCM is located a NanoBPM   that utilizes two symmetrically cut Si (111) crystals, and allows the selection of the outgoing photon beam energy with a relative bandwidth of 2 × 10−1 and a dead-time of around 80 ns. The device is able to measure the X-ray fluorescence in the energy range 0–40950 eV. It is also possible to specify a region of interest (RoI) in order to measure the counts only from a specific energy range. The data acquisition and exposure time can be controlled by an external signal using the External Gate mode of the device.Data acquisition from the fluorescence detector is performed by an Xspress 3 Mini unit  that has a count rate of up to 4 Mcounts set al., 2017BioMAX utilizes a PandABox  can take from several seconds up to a couple of minutes. The longest energy changes involve translation of the KB mirrors to use a different coated stripe.The energy of the beamline is controlled by a pseudomotor with a complex logic that simultaneously moves various motors to predefined positions corresponding to the set energy value. Besides the Bragg angle of the HDCM and the undulator gap, other motors involved in automated energy changes are the perpendicular distance and pitch of the HDCM second crystal and the KB mirror coating-selecting translation (only for work at the low- or high-energy regions of the beamline). The routine energy changes do not control the motion synchronization of the motors and require a settling time to ensure that all the individual motors have reached their final positions. As the motors do not move synchronously, the beam alignment is affected during the energy change, which is subsequently corrected by the two feedback loops described in Section 2.1A typical range of an energy scan is 100 eV, and for such a small energy change the perpendicular translation and pitch motors of the HDCM second crystal do not move, while the translation of the KB mirrors can be avoided during the scan procedure. As a result, only the motion of the Bragg angle and the undulator gap motors needs to be considered for the particular application of an energy scan.The values of the Bragg angle and the undulator gap for different energies are shown in Fig. 3Although the energy dependence is non-linear for both motors, as we will discuss in Section 4.23.MXCuBE3  is used.The energy scan procedure is launched from CHOOCH  and covers an energy range of 100 eV with a total of 100 data acquisitions across the range. The resulting data are then analysed by a routine called 3.1.Kα or Lα) energies for the chosen element. A 100 eV energy range is then defined around the absorption edge to perform the scan from Eedge − 50 eV to Eedge + 50 eV, where Eedge is the absorption edge energy. The program then checks if there is any harmonic jump  that is less than 50 eV away from the jump between the fifth and seveth harmonics (EH5→H7 = 12610 eV): 30 eV < ESe − EH5→H7 < 50 eV; thus in this case the scan is carried out between EH5→H7 + 1 eV and ESe + 50 eV, that is from 12611 eV to 12707.8 eV. Having the emission energy for the chosen element, the preparation routine configures the Xspress 3 Mini, setting its RoI to a range Eem ± 150 eV, where Eem is the emission energy value. Such a RoI excludes signals from elastic scattering and possible emission from other electron shells or elements. This results in a lower background and higher sensitivity of the signal to the scanning energy.During the preparation of the energy scan the fast shutter is kept closed at all times to avoid any unnecessary radiation on the crystal. The first step of the energy scan routine is to retrieve from a lookup table the energy value of the absorption edge and the emission  to have an emission signal similar to the maximum of the energy scan. After the energy move the checkbeam (Section 2.2a)]. The acquisition is done using a TTL gate signal that simultaneously opens the fast shutter to expose the sample to the X-ray beam, and triggers the Xspress 3 Mini acquisition unit. A 7 ms delay is applied to the gate signal of the detector with respect to that of the fast shutter in order to take into account the opening time of the latter and to ensure that the data are acquired while the shutter is fully open. The duration of the gate signal is set to 9 ms which is equivalent to the acquisition during a single step of the energy scan. If the number of counts from the single acquisition (N0) is within the defined limits (1000–5000), the default transmission of 0.5% remains unchanged; otherwise the transmission is multiplied by a factor 2500/N0 to linearly scale it for the desired number of counts of 2500. Such linear scaling is done only up to a maximum value of 10% to avoid excessive exposure of the sample to the X-ray beam. In the situation where N0 = 0, the transmission is not adjusted and a message is sent to the user as this could be caused by a misaligned beam or an incorrect acquisition.The next step is to adjust and optimize the transmission of the X-ray beam. This is done to optimize the signal on the fluorescence detector without exceeding the count rate at which the signal is no longer linear. For this purpose, the X-ray beam energy is moved to a value slightly above the absorption edge  specified above. The only limiting factor is the speed of the physical motors to cover the required motion range within the defined time. The above-mentioned scanning parameters were chosen specifically for the current energy scan application. For 100 eV s−1 energy change the speeds of both undulator gap and Bragg motors are well within their physical limits for the entirety of the beamline energy range.Such motion ensures that both of the motors start their linear movement at the same time from position Eedge value, the PandABox creates a table of consecutive positions of the motor corresponding to 1 eV energy change and uses them to trigger the acquisition of the detector. Having a position-based triggering logic ensures that the program knows the exact energy value for each fluorescence signal acquisition, even if the motor motion is not perfectly linear in energy. The first checkpoint is the Bragg motor position corresponding to Eedge − 50 eV. A pre-trigger is sent to the fast shutter 7 ms before this point to allow enough time for fully opening the shutter. The shutter status is shown in brown in Fig. 6Ts being its opening/closing time. When the motor reaches the first position, the PandABox sends the first acquisition trigger of 9 ms to the Xspress 3 Mini  of the anomalous scattering factors as well as the inflection, peak and remote energy values. An example of a continuous scan around the Cu K-edge is shown in the top part of Fig. 7MXCuBE3 as well as in ISPyB  = θ0 + V0t with θ0 being the Bragg angle at the start of the scan and V0 the constant speed. The solid lines and the crosses in the figure correspond to, respectively, calculated and measured values at different Eedge energies.As mentioned earlier, the photon energy dependence on the Bragg angle is not linear Fig. 3; howeverVθ(t) changes in time, always decreasing towards higher energies  along the scan range. This is why the offsets in Fig. 8Vθ(t) > V0 and start decreasing from about the mid-point on when Vθ(t) < V0. One can see from the figure that the maximum deviation is less than 1 eV and it is smaller at higher energies. The latter can be deduced from Fig. 3When changing the energy with a constant speed, the Bragg angle speed 4.2.−4 from a broader energy spectrum of undulator radiation. This is illustrated in Fig. 9Eedge − 50 eV to Eedge + 50 eV, thus keeping the resulting radiation flux unchanged throughout the scan.As discussed in Section 3.2a), where the four curves correspond to scans at four different energies.As the final photon energy is defined by the Bragg angle and this value is used by the PandABox for energy calculation throughout the scan, any jitter or drift between the HDCM and undulator spectra does not result in uncertainty of the energy values of the scan. Instead, it affects the beam intensity resulting in fewer photons passing through the HDCM if its central energy has an offset from that of the undulator spectrum. For example, the green dashed curves in Fig. 9K-edge). This is explained by the fact that at this energy the undulator gap is very small – about 5.25 mm  demonstrates the energy change per acquisition during the scan for the Bragg and undulator gap motor motion. The values for four different scans [same as in Fig. 10a)] are plotted on top of each other. One can see from the figure that the distribution of the energy change values is well centred around 1 eV for all the steps with a maximum deviation of about ±0.06 eV. This proves that the energy change during the scans is fairly linear and reproducible.The figure shows that the largest energy difference observed from the test measurements is about 4 eV (illustrated by the red curve), which according to Fig. 94.3.Another important consideration during the energy scan is the beam alignment. Ideally, the beam centring at the sample position should not be affected by a small energy change when the undulator and monochromator energies are changed synchronously. However, because of non-perfect synchronization of the undulator gap and Bragg motors Fig. 10 as well K-edge is shown in Fig. 11In order to monitor the beam alignment changes during the scan, test measurements were performed using an XBPM in the BCU  system (Sjöström 5.A continuous energy scan routine has been developed and implemented at the BioMAX beamline for measuring the fluorescence signal near the absorption edges of heavy elements present in macromolecules. The scanning duration is as short as 1 s making it two orders of magnitude faster compared with the conventional step scan. Owing to this continuous scanning as well as other improvements in the preparation and completion phases of the routine, its overall duration is reduced by a factor of four to five. Furthermore, the motion trajectories and the synchronization of the motors as well as the stability of the process were investigated proving that it can be reliably utilized during the user operation. The implementation of the continuous energy scan is an important upgrade of the BioMAX beamline and provides the users with a fast and easy access to anomalous diffraction data from their samples. This, in turn, simplifies the structure reconstruction with experimental phasing using the SAD or MAD techniques. The method used for the continuous energy scan is not specific solely to the BioMAX beamline and can be implemented at other beamlines.


The study aimed to compare the conventional method of electrode marking with a new system, EPlacement, to improve accuracy and reduce the time burden on health care professionals.Ten health care professionals marked mannequin heads and adult volunteers using both methods. Time, accuracy, and usability of each method were analyzed. Three neurophysiological diagnostic tests were performed on mannequin heads: reversal pattern visual evoked potential (three electrodes required); somatosensory evoked potentials from the upper and lower extremities (five electrodes required); and standard intraoperative neurophysiological monitoring for spine surgery (nine electrodes required). Precision scanning of the mannequins with structured light and a printed hull were used to determine the actual locations of the electrodes of the 10/20 system.The new method based on the EPlacement device represents an improvement on conventional tape measure (TM) marking and may be considered within the group of advanced methods such as navigation systems since it leads to improvements of 34% (1.7 mm) for electrode positions in the Nasion‐Inion and Left tragus–Right tragus lines and 77% (12.5 mm) for electrode positions using the approximate method. It reduces the time spent per test by an average of 1 min compared to the TM method. Health care staff survey results show a positive feedback regarding usability of the new method.The study showed that the EPlacement device improves accuracy, reduces time, and is easy to use compared to the conventional method of electrode marking. The EPlacement method can facilitate the complex task of electrode marking and ultimately contribute to improved patient outcomes. It has the potential to be widely accepted and implemented in clinical practice. New method using EPlacement simplifies and improves the accuracy of the marking process, and the time burden from clinical staff. EPlacement does automatic calculations as well as detailed guidance on indicating the electrode positions required for each test. Results suggest that EPlacement could be a valuable tool for improving the accuracy and efficiency of electrophysiological tests.  This marking must be performed accurately so as to avoid erroneous or even counterproductive results and ensure the optimal application of the neurophysiological technique.The number of cranial points to be located depends on the type of test selected. Each point is highlighted with a marker pen , which can lead to calculation errors. Other situations, such as intraoperative neurophysiological monitoring (IONM) , a pressure sensor, and an illumination system with a high density of LEDs. The electronic unit has a navigation menu from where the clinician chooses the test to be performed. For this study, the following tests were programmed: pattern‐reversal visual evoked potential, (PVEP), somatosensory evoked potentials (SEP) . The identification of reference points is performed manually by health care staff, but once these reference points are identified, the calculation is carried out automatically. The health care staff simply needs to press the strip on the reference point , and if the pressure is applied for more than 3 s, the measurements are automatically obtained. The touch sensor used in the system is a linear soft membrane potentiometer. When pressure is applied to the touch sensor, the resistance undergoes linear changes, enabling precise calculation of the relative position on the strip. The system directly measures the length of the head, whereas the microcontroller performs the percentage calculations and illuminates the LED that indicates the point to be marked on the scalp. The length of the touch sensor is designed to cover the majority of adult cranial dimensions, accommodating variations in head size.We designed two different versions of the EPlacement device. The first version comprises a single strip (1S‐EP), whereas the second one comprises two strips that allow relative movement between them (2S‐EP). The navigation menu adapts the procedure to the version of the device being used. Figure Typically, the marking process begins by obtaining the electrode positions relative to the midline of the head. For this purpose, in the case of the two‐strip configuration (2S‐EP), one strip is positioned to cover the tragus reference points, whereas the second strip is placed over the Inion and Nasion reference points. The microprocessor calculates the distances and illuminates midpoints where the strips have to intersect. Once the strips are appropriately positioned, the desired test can be conducted.In the single strip arrangement (1S‐EP), an additional step is required to establish the midline compared to the two‐strip version. The user initiates the process by measuring the LPA–RPA distance. Once this measurement is obtained, the device illuminates a point along the midline that needs to be marked. Subsequently, the user measures the Ns‐In distance, passing through the Ns and the previously marked point, and the device illuminates the accurate Cz position. The midline is determined based on the Ns‐In and Cz points.2.2To conduct this study, authorisation was received from the Ethics Committee of the Pere Virgili Institute for Health Research (IISPV).Participants were 10 health care professionals from the Hospital Universitari Sant Joan de Reus (HUSJR). The study comprised two parts. In the first part, the health care professionals carried out markings on mannequin heads, and the time and accuracy of each marking method were analyzed. In the second part, these clinicians marked the heads of adult volunteers so as to evaluate the usability of EPlacement on actual human heads. In this case, however, on account of the large variability in hair density, hair length, and head shape, neither time nor accuracy was analyzed. The opinions of the clinicians were collected by means of a survey.With regard to the markings on the mannequin heads, three neurophysiological diagnostic tests were analyzed: reversal PVEP (three electrodes required) , double‐strip EPlacement (2S‐EP), and TM.The clinicians performed each electrophysiological test on a different mannequin head . As each test was conducted three times, the first and second markings (using EPlacement) were performed with two markers visible only with ultraviolet light (blue and pink) so as not to influence the third marking (TM), which was performed with a black marker. Each marking process was timed.Note that, in clinical practice, when the TM is used for the CPz, CP3, and CP4 positions, clinicians do not usually place the electrodes according to the international 10/20 system. Instead, they use an approximate method to place the above electrodes 2 cm behind the Cz, C3, and C4 electrodes, which are renamed respectively: Cz′, C3′, and C4′ .Precision scanning of the mannequins with structured light (HP 3D Pro S3) was performed. The resulting surface was imported into Autodesk Fusion 360 software, which was used to determine the actual locations of the electrodes of the 10/20 system. These locations were found using the method proposed by the system , a set of distances were obtained depending on the tool used : PEij. For each method and each electrode, the average (PE¯ij.) and standard deviation of the PE were calculated (sdij). Because some electrodes were used in more than one neurophysiological test, the number of PEs of each electrode (sample size) was not constant. The standard error (sej¯) was calculated by dividing the standard deviation of the sample by the square root of the sample size.PE was measured by obtaining the Euclidean distances between the positions of the template helmet and the positions of the marking procedure. For each electrode, p‐value <.05.A Tukey HSD test was performed to determine whether the averages of the errors obtained with the three tools for the two electrode positioning groups were statistically different. This test performs a multiple comparison between all pairs to detect whether the PE obtained has a statistically significant mean difference with a p‐value below .05 indicates that significant differences in mean times exist among the tools.To compare the differences in the times used to position the electrodes, another Tukey HSD test was performed. In this case, the time differences among the three tools were analyzed. Again, a 33.1Our results are shown in Table These results illustrate the importance of grouping the electrodes according to those that lie on the Ns‐In and LPA–RPA lines (NITT) and those that do not (ACP group). For the NITT electrodes, the average errors were 5.0, 3.1, and 3.5 mm with the TM, 1S‐EP, and 2S‐EP, respectively. For the ACP electrodes, a larger error was observed with the TM (average error = 16.3 mm) while the errors observed with the EPlacement devices were similar to those for the NITT electrodes (PE = 3.8 mm for 1S‐EP and PE = 3.6 mm for 2S‐EP).To evaluate the significance of these differences, Figure 3.2The times taken to perform each neurophysiological test  were measured. Table A time reduction of over 20% (with respect to TM) was achieved for SEP and IONM when the EPlacement devices were used. Note that this time reduction would be greater if the TM system had used all the steps required by the 10/20 system rather than the approximate method (ACP). For PVEP, a time reduction of over 30% was achieved with the new devices. In other words, when EPlacement was used, a time reduction of almost 1 min with respect to the traditional method was achieved for each test.To evaluate the significance of these time differences, Figure For the three tests analyzed , we can see that while no statistical differences appear between 1S‐EP and 2S‐EP, the mean time required for TM is always significantly greater.3.3The survey shows that the clinicians were satisfied with the new method provided by the EPlacement devices. The survey was divided into two sections. In the first section, the clinicians expressed their opinions on the EPlacement device Figure  and in tWe found that 80% of clinicians reported that they were very satisfied or highly satisfied with 1S‐EP and 2S‐EP. As many as 90% of them also reported that if the device were purchased, they would be likely to use it and that EPlacement is clearly better than the TM method (90%). They also reported that they are very likely to recommend EPlacement to their colleagues.The clinicians also reported that if the number of electrodes is less than five, and especially if all electrodes are in the same plane, they prefer version 1S‐EP. However, if the number of electrodes is five or more and the electrodes are in different planes, they prefer version 2S‐EP.4With regard to marking accuracy, we have clearly shown that errors made with the TM are much higher than those made with EPlacement and that errors made with both versions of EPlacement are similar. The errors made with EPlacement are similar to those reported by Xiao et al. , who obtThe results of our study are also similar to those reported in studies that used techniques such as MRI‐based electrode detection and obtained mean error values of 3.5 mm .Our survey results show that EPlacement makes marking easier for health care professionals. This is thanks to the step‐by‐step guidance provided with the device, which enables unskilled staff to perform the complex task of marking.One limitation of the study is the use of mannequins instead of real human heads. Conducting the entire study on real human heads would have introduced confounding factors related to the accuracy of the new positioning device due to variations in individual head morphology, including skull shape and cranial landmark differences. However, the use of mannequins allowed for control over these factors, enabling a focused evaluation of the device's functionality and performance in a controlled setting. Although the part of the study with real human heads did not include quantitative measurements, the collection of subjective feedback from clinicians provided valuable insights into the device's usability in real‐life scenarios. Recognizing the subjective nature of the data collected, future research could address these limitations by incorporating a more quantitative analysis across diverse clinical cases.5Our results show that this new method based on the EPlacement device represents an improvement on conventional TM marking and may be considered within the group of advanced methods such as navigation systems since it leads to improvements of 34% (1.7 mm) for electrode positions in the Ns‐In and LPA–RPA lines (NITT) and 77% (12.5 mm) for electrode positions using the approximate method (ACP). This significant result highlights the current deficiency of marking at positions that are not on the Ns‐In or LPA–RPA lines. As well as improving accuracy, the EPlacement devices reduce the time spent per patient by an average of 1 min per test. Finally, in the survey the clinicians clearly showed that they are willing to use the new device in routine clinical practice.https://publons.com/publon/10.1002/brb3.3187.The peer review history for this article is available at