Antenna 34 driver project
This describes the Antenna 34 driver project. This project evolved from the driver for the 6m antenna.
The images underneath is the class diagram of the antenna 34. It started from the design of the antenna 6m and will evolve in the design for the antenna 34m and suited for the development in python.
Receiving messages from the server
The server sends coordinates in the form of a ServerAntennaCommunicationMessage. After initialisation and starting all the threads of the driver, as a last step, the Humain34mDriverApp creates a server socket that listens to the incoming messages of the driver. Once a message is received a new thread is started with the AntennaMessageReceiverRunner as runnable. This runnable will read the message from the socket, parse the message, request the correct AntennaMessageHandler from the AntennaMessageHandlerFactory and passes the message to the handler. The AntennaMessageHandler returns a AntennaMessageHandlerStream that can be used to return a message to the server over the same socket. If this is done, the socket is closed. At the moment there are two different messages being send by the server: antenna instructions and the antenna stop message.
Handling antenna instructions
The AntennaMessageHandlerFactory needs a handler to handle the antenna instructions. In this case the AntennaInstructionHandler is responsible for handling the antenna instructions. The AntenneInstructionHandler implements the AntennaMessageHandler interface and is added to the AntennaMessageHandlerFactory by the Humain34mDriverApp. The AntennaInstructionHandler will convert the coordinates in useful coordinates for the driver. The coordinates are offered to the InstructionHandlerDBService.
There are two types of coordinates that can be send by the server: parking coordinates and pointing coordinates. before the coordinates are stored, they are filtered. If a parking coordinate is not inside the bounds of the antenna, the coordinates are clipped to the nearest bound. Pointing coordinates that are outside the bounds of the antenna are remove from the list with coordinates. The coordinates that are still in the database and have the same time coverage are overruled. This means that a flag in the database is set. After these operations the coordinates are stored in the database.
Once the coordinates are in the database the InstructionDistributor is warned that new instructions were added to the InstructionHandlerDBService.
Handling stop messages
The AntennaMessageHandlerFactory needs a handler to handle the antenna stop instructions. In this case the AntennaStopHandler is responsible for flagging the coordinates for a particular scenario and subscenario. The AntennaStopHandler implemented the AntennaMessageHandler interface and is added to the AntennaMessageHandlerFactory by the Humain34mDriverApp. The AntennaStopHandler will instruct the InstructionHandlerDBService to stop a scenario. As a result the InstructionHandlerDBService will flag the coordinates belonging to the scenario and subscenario as stopped.
Receiving status and coordinates from the antenna (ant6m way)
The driver needs the status from the antenna. The status contains the position of the two encoders and the status of the switches.
Receiving positions from the antenna
Reading status from the antenna
Operating the antenna
States of the antenna
Creating and sending the operational instructions
Data exchange between hardware controller (hw-ctl) and the driver.
From driver to hw-ctl
- east west between negative max speed to positive max speed zero is stop
- up down between negative max speed to positive max speed zero is stop
From hw-ctl to driver
position of the antenna
status of the motors (speed, on/off)
antenna status error code