Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Basler ASCOM Driver - Available (ish)


VaguelyAmused

Recommended Posts

Hi all,

I am fortunate enough to have access to Basler imaging cameras in my line of work and thought one could work quite well as a guide camera, but although I managed to find an ASCOM driver done by Genika Astro it didn't seem to work for my application. The result is I've written my own.

It has been created using the samples provided in the Pylon SDK, it isn't pretty or feature rich but it does allow me to use a USB 3.0 Basler Aca1920-40uc with PHD2 which was all I wanted it to be able to do. You can adjust the gain via the properties/setup box, but that's all you can do! Binning is not implemented as I only have access to the colour version. 

Exposure through PHD2 works up to 10 seconds (the limit of the exposure in the camera SDK). The camera is forced into mono8 mode so it should work equally with colour and mono versions. I've uploaded the ASCOM installer exe and the visual studio solution to my onedrive here if anyone would like it:

https://drive.google.com/drive/folders/1SpvQP4FqsVTZRPceZ1I1WNCclCdsiXyx?usp=sharing

I am successfully using it with ASCOM 6.5 SP1 and PHD2 v2.6.9dev1 HOWEVER note that PHD2 v2.6.9dev2 does not work - I don't know if its my code (most likely) or PHD2 but I haven't cared to investigate too far yet and just stick with the dev1 build.

As I say its hacked and hard coded in places: if you have a 1920x1200 Basler camera then you can probably just use the exe installer otherwise you will need to use the source and the freely available VS2019 community edition to make some minor edits to the code and rebuild. If there is demand and enough owners of Basler cameras out there I may make that more dynamic so the installer is more universal.

If anyone does want to take the source and rebuild, you will need to change lines 303, 304 and 305 in Driver.cs to match your camera (pixel h, w and size) but that should be it. You will also need the Pylon SDK downloaded and installed from the Basler website.

I don't plan to offer any support of it, but it seems effort worth sharing for anyone else that may have a Basler that they'd like to use for guiding and if you do give it a go and run into problems respond on here and I may be able to help.

Thanks, and Clear Skies
Chris

Link to comment
Share on other sites

It's not the easiest interface to a camera to use, is it? :)

I've just attempted to add support for Basler cameras using Pylon into oacapture and it's been a bit fraught as I worked through issues like being told the gain control wasn't available only to find out later that it was (because by that time I'd turned off auto gain).  I possibly also made things worse by switching between the Pylon interface and the Genicam one where it was easier to use one than the other.  Still, done now...

James

Link to comment
Share on other sites

Well done! :)

My biggest "fight" was formatting the cameraImageArray in the ASCOM driver so PHD2 showed something sensible. I wrote (hacked together) an ASCOM driver for a Sentech camera years ago and I am sure I remember falling down the same trap. The default ASCOM template creates a 2D array for cameraImageArray, which makes sense but after a few hours fighting with the order I populated the 2D array with pixel data, I gave up and just tried dumping it into a flat 1D array and PHD2 was perfectly happy with that (other applications may not be so leniant).

The Pylon samples are good, but provide many options (aka rabbit holes) to choose - I'm going to treat it like a house of cards and now it is working leave it well alone! I don't claim to know what I am doing, which makes it all the more joyful when you start seeing recognisable images coming out of PHD2 :D

All the best
Chris

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.