# Pico-Sat to Ground Control: Optimizing Download Link via Laser Communication
## 2 Physical Components and Methods
### FSO Communication--The Ground Station's Side
#### 2.3.2 Accurate Tracking  
The main challenge of accurate satellite tracking is that a minor deviation in the telescope angle is sufficient to lose line of sight with the satellite. This is due to the telescope's narrow viewing angle, which is very narrow and designed for slow tracking. A wide FOV camera, whose function is to capture the satellite when it is out of the telescope's line of sight, enables reorientation.  
To properly track the satellite, the camera should be stably mounted on the telescope and accurately calibrated to the telescope lens, i.e., the center pixel in the image of the wide FOV camera should be the same as the center of the telescope lens. This way, when the satellite appears in the center of the camera, it also appears in the telescope lens.  
The tracking process is carried out automatically via the main processing unit that is connected to both the camera and the telescope. This processing unit has an image processing program that tracks the satellite movement in the image and reorients the telescope accordingly. This model relies on the unique design of the satellite with light-emitting diode (LED) that can be seen from Earth. The LED will turn on when passing a ground station in order to be seen from Earth. When the satellite appears in the frame, it resembles a twinkling star. The accurate tracking phase comprises three repetitive steps:  
* Detect the satellite in the image.
* Compute deviation from the image's center.
* Reorient the telescope so that the satellite appears in the lens.  
This process, if performed at a rapid rate, can ensure that the telescope is linked with the satellite throughout its pass.  
**Satellite detection:** The satellite detection in the image of the wide FOV camera image is performed in two steps: (i) edge detection in the image and (ii) satellite classification.  
The edge detection process can be performed using the Canny edge detection algorithm [25], which is a five-stage algorithm for finding edges in an image. The algorithm steps are as follows: apply a Gaussian filter, find the intensity gradients, apply a gradient magnitude threshold, apply a double threshold, and remove all weak and unconnected edges. This algorithm provides smooth edges by using noise reduction and accurate edgesby applying a double threshold on the image gradient. This is a common method for accurate edge detection and is implemented in almost every image processing library. In our study, we apply the Canny function implementation from the Python OpenCV library [26].  
The satellite classification step determines which object is being detected. A common night-sky image may consist of many objects that can appear similar to the satellite (e.g., stars, light pollution). The distinction method relies on the fact that the satellite continuously changes its position. Using image processing on a video instead of on an image can detect the satellite's movement by comparing the images in the video and observing the differences.  
Figure 6 demonstrates the satellite detection process by simulating the tracking of the ISS. The ISS passes through the night sky in a visible route (the sunlight is reflected on the ISS) once in two days on average. Knowing its predicted position (that can be learned from [27]), we were able to video its passing using our wide FOV camera. After doing so, we used the image processing algorithm to detect the station in the image.  
**Deviation Computation:** To compute the new angles for the telescope aiming, we calculate the pixel deviation of the satellite from the image center (which is calibrated with the telescope lens) and convert these pixels to angles. Since the camera is calibrated to the telescope and perpendicular to the ground, the x-axis can be converted to \(Az\) angle and the y-axis to \(Elv\) angles.  
**Telescope reorientation:** Assuming that the telescope is calibrated and stable, then by obtaining the computed angles \((Az,Elv)\) as input, the telescope can perform the reorientation.