Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Arduino Ascom focuser Mark2


tekkydave

Recommended Posts

They are the same libraries I have installed.

Cheers Mick.

I have now uploaded the 2 required libraries to the Files section of the SF site so they are with the other project files https://sourceforge.net/projects/arduinoascomfocuser/files/Mark2/Software/V2.2.0/

Instructions on how to install them via the Arduno IDE are here: http://arduino.cc/en/Guide/Libraries

Just download the zip files, don't unzip them, follow the instructions on the above page under the 'Automatic installation' section.

Then recompile & upload the sketch and you should be good to go.

Link to comment
Share on other sites

Connected our waterproof temperature sensor to our focuser assembly,  I used the other gnd pin, +5v and D6 pins as the wiring diagram, I had been playing around with the sensor on a spare nano looking at different sketches before tekkydave released v2.2.

Crammed into the box it all worked remarkably well, temperature displays in the AAF2 window, I downloaded Focusmax v3.8.0.20 which is the last free version and of course I was able to load the focuser and see the temperature.


Next up APT, I have run APT testing the original focuser assembly this was the first time with the temperature sensor,  APT spotted the sensor while loading,  I was able to connect to the focuser move back and forth as before then surprise to me (embarrassed again) the temperature appeared at the top of the screen and its possible to set the focuser to readjust on temperature change, outstanding – well done Ivo  (you’ve all guessed I am not to familiar with this software).


Well, I am well pleased with this focuser, had been looking at other options for a while,  so big thanks to tekkydave for the work he has put in and to Russell for kicking the ball off with the temperature sensor, along the way I have made a start with Arduino – so long as someone else writes the sketches :grin: .


post-37988-0-48541000-1412432344.jpgpost-37988-0-92528100-1412432359.jpg


  • Like 2
Link to comment
Share on other sites

Awesome guys, I'm in business! Thanks for the help. I remember seeing something about those libraries in my arduino book but it never dawned on me. Guess that's why you shouldn't work on something late at night, lol.

Excellent. One question - why do you want to be Swiss? :grin:

Link to comment
Share on other sites

Having a bit of bother with the driver and Focusmax.

If I select to auto connect the focuser from the "Open -> Options" menu, when Focusmax starts, the focuser connects but defaults to position 0 and I end up with the same issues as before when the focuser started at 0.

I was looking through the driver to see if there is a way to get it to default to a larger number, maybe 5000, but I couldn't figure it out (I'm sat outside imaging, so brains not working that fast!).

Link to comment
Share on other sites

Having a bit of bother with the driver and Focusmax.

If I select to auto connect the focuser from the "Open -> Options" menu, when Focusmax starts, the focuser connects but defaults to position 0 and I end up with the same issues as before when the focuser started at 0.

I was looking through the driver to see if there is a way to get it to default to a larger number, maybe 5000, but I couldn't figure it out (I'm sat outside imaging, so brains not working that fast!).

OK, I seem to have fudged a solution though not sure if it's going to have any undesired effects (haven't noticed any yet). I changed the following line to add "=5000" and that seems to work:

internal static int savedPosition=5000; // tekkydave - to hold position passed from setup dialog or between disconnect / reconnects

I can disconnect and connect within Focusmax and the position is saved. But if I disconnect, close Focusmax and re-open Focusmax, the position resets to 5000.

Link to comment
Share on other sites

Having a bit of bother with the driver and Focusmax.

If I select to auto connect the focuser from the "Open -> Options" menu, when Focusmax starts, the focuser connects but defaults to position 0 and I end up with the same issues as before when the focuser started at 0.

I was looking through the driver to see if there is a way to get it to default to a larger number, maybe 5000, but I couldn't figure it out (I'm sat outside imaging, so brains not working that fast!).

Does it work ok using the manual method. If so you can set the initial position in the chooser dialog. Maybe it is something to do with the way FM is filling in the chooser. When I get some more time Ill do some testing with FM. Are you sure you have the correct driver installed and registered.
Link to comment
Share on other sites

OK, I seem to have fudged a solution though not sure if it's going to have any undesired effects (haven't noticed any yet). I changed the following line to add "=5000" and that seems to work:

internal static int savedPosition=5000; // tekkydave - to hold position passed from setup dialog or between disconnect / reconnects
I can disconnect and connect within Focusmax and the position is saved. But if I disconnect, close Focusmax and re-open Focusmax, the position resets to 5000.
Hmmm. Maybe FM is using that value over the value the focuser initially has. I'll have to look into how these devices/drivers save and use the last position between connects or power down/up. More research :grin:
Link to comment
Share on other sites

When I use the chooser and enter the position, focusmax uses the number I enter. If I don't use the chooser and let it connect automatically then focusmax was using 0.

I think it may be to do with the way the driver starts up. If the chooser is not used. Maybe the arduino is not ready to give a value but that seems unlikely?

Link to comment
Share on other sites

When I use the chooser and enter the position, focusmax uses the number I enter. If I don't use the chooser and let it connect automatically then focusmax was using 0.

I think it may be to do with the way the driver starts up. If the chooser is not used. Maybe the arduino is not ready to give a value but that seems unlikely?

Could be. Both the driver and sketch should default to 1000 but the driver also sends an Innnn# command to the nano to set its initial position to the value you entered in the chooser aswell. SF may be using a different startup path in the driver. Do you get any trace files when using the SF auto start method. If so you will see if there is an Innnn# command in there.
Link to comment
Share on other sites

I started with a fresh install with the latest driver and arduino sketch from Sourceforge and saved the following logs. The first set are from when I use the chooser and set initial starting position (tagged "Chooser"). The second are from when FocusMax loads the focuser on start-up (tagged "Startup").

Each time, before loading FocusMax I powered down the arduino to make sure no values were being saved on the arduino itself.

AAF220141005095726_Chooser.txt

Driver20141005095726_Chooser.txt

AAF220141005095640_Startup.txt

Driver20141005095639_Startup.txt

Link to comment
Share on other sites

It looks like the "savedPosition" isn't working as expected. I changed the code to the follow, restarted the laptop, loaded focusmax with autoconnect enabled and the position was set to 5000. i then moved the focuser to 5050, disconnected and reconnected from within focusmax and the position was saved as 5050. It must be that the focuser variables are lost when the program connected to the focuser is closed.

                    // set initial position to saved position (from setup dialog or previous disconnect)                    if (savedPosition > 0)                    {                        aaf2.setInitialPosition(savedPosition);                    }                    else                    {                        aaf2.setInitialPosition(5000);                    }
Link to comment
Share on other sites

Saw Russell's post earlier so connected to Focusmax v3 and had the same result.

Just played with APT and found I can choose AAF2 and com port using connect focuser under the gear tab, if I then quit APT or make the focuser auto connect at startup I get 0 position (not 1000) when APT is reloaded.

If I shift click 'connect focuser' I get to start the focuser again (not just rerun the last used focuser) I see AAF2 in  chooser (or another focuser) and get the 1000 start position.  Hope this makes sense, its the same glitch.

Back later, mick

Link to comment
Share on other sites

I developed a great interest in this thread, and  from the point of view of the Cooperation and support each participant has

provided throughout. It has been a very interesting read, and I would like to thank all of you.

You are all a credit to SGL, and yourselves. It has been a pleasure following the project through to what will

be without doubt a very successful conclusion.

Well done all, and again, thank you very much for a great read,

:icon_salut: :icon_salut: :icon_salut: :icon_salut: :icon_salut: .

Ron.

  • Like 2
Link to comment
Share on other sites

I developed a great interest in this thread, and  from the point of view of the Cooperation and support each participant has

provided throughout. It has been a very interesting read, and I would like to thank all of you.

You are all a credit to SGL, and yourselves. It has been a pleasure following the project through to what will

be without doubt a very successful conclusion.

Well done all, and again, thank you very much for a great read,

:icon_salut: :icon_salut: :icon_salut: :icon_salut: :icon_salut: .

Ron.

Thanks Ron, it's nice to be appreciated. I must say I get more respect and appreciation on SGL than I get at work these days :grin:

Link to comment
Share on other sites

I save such things in non-volatile RAM in the Arduino.  Sure you're well aware of that though :D

I was aware it was possible but it's not something I had thought of doing. I didn't realise the Ascom model catered for saving the focuser position between connections. I will do a bit of research in the coming days to see what Ascom actually expects and whether the functionality needs to be in the focuser or the driver. Unless someone can point me at the correct documentation. For now I'm happy that I got it working at all and it works fine in a manual mode without saving the position. I'm ok if anyone wants to take my code as a basis for a new project otherwise I wouldn't have made it public. Any code snippets fed back will be appreciated and even stolen borrowed for AAF2 :grin: One thing I have noticed since adding the temperature sensor is that the client programs I have tested it with all seem to request the temperature every second. I think that's a bit too frequent and could even interfere with the other commands if the 1-wire routines are a bit slow - I set my FocusAAF2 utility at 10s which should be fine.

Link to comment
Share on other sites

Saw Russell's post earlier so connected to Focusmax v3 and had the same result.

Just played with APT and found I can choose AAF2 and com port using connect focuser under the gear tab, if I then quit APT or make the focuser auto connect at startup I get 0 position (not 1000) when APT is reloaded.

If I shift click 'connect focuser' I get to start the focuser again (not just rerun the last used focuser) I see AAF2 in  chooser (or another focuser) and get the 1000 start position.  Hope this makes sense, its the same glitch.

Back later, mick

I think what is happening is that the autostart is bypassing the chooser and assuming some other section of the driver will have saved the position from last time. I haven't catered for this anywhere at the moment. Are there any other drivers you know of that work that way I could maybe look at the code and see how it is done (nothing like a bit of plagiarism) :biggrin:

Link to comment
Share on other sites

It looks like the "savedPosition" isn't working as expected. I changed the code to the follow, restarted the laptop, loaded focusmax with autoconnect enabled and the position was set to 5000. i then moved the focuser to 5050, disconnected and reconnected from within focusmax and the position was saved as 5050. It must be that the focuser variables are lost when the program connected to the focuser is closed.

                    // set initial position to saved position (from setup dialog or previous disconnect)                    if (savedPosition > 0)                    {                        aaf2.setInitialPosition(savedPosition);                    }                    else                    {                        aaf2.setInitialPosition(5000);                    }

That makes sense. I have just tested it myself and the position is preserved between disconnect/connect as it should be - the same instance of the driver is still running and the variables preserved. The position will be lost if the client program is restarted or the focuser powered down. This is to be expected as the position isn't persisted into non-volatile storage. The FM auto-connect must assume the focuser looks after it's own stored position and it will always be on the same COM port otherwise it will not be able to successfully connect again without using the chooser. How does FM cope if the focuser moves to a different com port?

Edit: Just tested with FM and when I move the focuser to a different com port (COM5 instead of COM8) it can't connect to the focuser. If I go through the driver setup dialog (System Tab, Disconnect, Setup) and set the new COM port it all works again. It shouldn't be an issue if you have everything connected up the same way all the time e.g. permanent Obsy. Not sure it stricly follows the Ascom model but it will save a few clicks each time you start your imaging session.

I think I need to add some code to the Arduino sketch so the position is stored in non-volatile memory at each driver disconnect.

Gina - any code examples of how to do this?

Edited by tekkydave
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.