TwiceAsNice  2019-02-18
Classes
mgenautoguider.h File Reference

This is a very simple INDI device for the Lacerta MGen Autoguider. More...

#include "indidevapi.h"
#include "indiccd.h"
Include dependency graph for mgenautoguider.h:
This graph shows which files directly or indirectly include this file:

Classes

class  MGenAutoguider
 
struct  MGenAutoguider::version
 
struct  MGenAutoguider::version::firmware
 
struct  MGenAutoguider::voltage
 
struct  MGenAutoguider::voltage::numbers
 
struct  MGenAutoguider::ui
 
struct  MGenAutoguider::ui::remote
 
struct  MGenAutoguider::ui::framerate
 
struct  MGenAutoguider::ui::buttons
 
struct  MGenAutoguider::heartbeat
 

Detailed Description

This is a very simple INDI device for the Lacerta MGen Autoguider.

Author
TallFurryMan (eric..nosp@m.dejo.nosp@m.uhane.nosp@m.t@gm.nosp@m.ail.c.nosp@m.om)

Summary: this driver attempts to connect to a FTDI device with the VID:PID of the MGen Autoguider on the USB bus. It tries to understand in which mode the device is currently, eventually powers it on and switches it to application mode in order to use its features. It then provides a view on the remote user interface, and enables the end-user to navigate in that interface by clicking buttons.

The Lacerta MGen driver communicates through libftdi1. It would be possible to us the standard VCP driver "ftdi_sio" bundled with the Linux kernel through a TTY standard device, but some operations such as turning the device on or resetting would not be available.

In its current implementation, the INDI driver derives from INDI::CCD in order to forward a view on the remote UI and a way to navigate in that UI. However, none of the features of a CCD is implemented.

The connection algorithm tries to understand in which state the device is, and tries to turn it on if it is in low power. The ability to turn the device on is is especially useful as the default state of the power supplied autoguider is low power. This feature would not possible with the standard ftdi_sio driver.

See also
80-LacertaMgen.rules for an example of udev rules unbinding the MGen device from driver ftdi_sio, leaving it free to communicate with libftdi1 and libusb. The rules detects the serial name "MGS05443" in events from subsystems "usb" and "tty" to request the kernel to unbind the device from driver "ftdi_sio".

The PID:VID identifier is harcoded to the default value for the Lacerta MGen, although it could be entered as a driver property: 0x403:0x6001.

To use the Lacerta MGen in Ekos, connect Ekos to an INDI server executing the driver. Once connected, Ekos will periodically (default is 0.25fps) display the remote user interface in the preview panel of the FITS viewer. You can then navigate using the buttons in the tab "Remote UI". To increase the responsiveness of the remote UI, move the slider in tab "Remote UI" to increase the frame rate value. Warning, a frame rate too high may drop the connection (my tests show that it is the FITS viewer which seems to crack under pressure, crashing Ekos and KStars). To stop frame updates once you don't need them anymore (e.g. when everything is configured and guiding is started), set the frame rate to 0. To improve the communication speed, you may compress the frames and the expense of computing power on the INDI server (this is disabled by default by INDI::CCD, but is recommended).

Todo:
Find a better way to display the remote user interface than a preview panel from non-functional INDI::CCD :)
Todo:
Screen recognition, in order to define navigation scenarii providing additional features (star detection, calibration, guider start/stop, PEC measurement...)
Todo:
A proper client in Ekos providing calibration, guider start/stop and frame fetching.
Todo:
Support BOOT and APPLICATION mode switch, in order to retrieve additional versions and power the device off. No feature updating the firmware is planned (too dangerous).
Todo:
Support Star Drift measurement function. This provides a measurement of the periodic error of the mount.
Todo:
Support Random Displacement function. This allows a sequence of guided captures to be offset randomly, improving the result of stacking the captures. This requires a way to control the shutter of the guided CCD. MGen offers control for open-collector shutter systems such as Canon EOS cameras.
Todo:
Support External Exposure function.
Todo:
Support Filesystem features to read logs and statistics files, and to do housework in the available ~2MB.