Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Arduino Ascom focuser Mark2


tekkydave

Recommended Posts

Thanks for considering my project. I think the easydriver uses direction and step pin connections rather than the 4 separate lines my design uses. You will need to amend the clockwise() and anticlockwise() functions in my sketch to work correctly. It might be best to search out a sketch that uses the easydriver and 'borrow' the appropriate sections. If you get it working let me have a copy and I'll add it to the sourceforge project.

hi

I decided to just get the adfruit motor shield as I didn't want to mess around with adapting the easy stepper board too much.

got the project finished. It works a treat on the bench although I had a bit of an issue on the mount as I think the USB hum system is not sufficient to drive the stepper properly. It just does not seem to have enough torque to drive the belt to the Canon 200mm lens. I think I will add a 12v supply to the motor shield board. It's a excellent project and will really help in the critical focusing of this lens

post-11156-0-95713300-1411252314_thumb.j

  • Like 1
Link to comment
Share on other sites

hi

I decided to just get the adfruit motor shield as I didn't want to mess around with adapting the easy stepper board too much.

got the project finished. It works a treat on the bench although I had a bit of an issue on the mount as I think the USB hum system is not sufficient to drive the stepper properly. It just does not seem to have enough torque to drive the belt to the Canon 200mm lens. I think I will add a 12v supply to the motor shield board. It's a excellent project and will really help in the critical focusing of this lens

Nice work. I'll have to go back through the thread and count how many people have built it. Must be 4 or 5 by now plus me of course.

Link to comment
Share on other sites

Nice work. I'll have to go back through the thread and count how many people have built it. Must be 4 or 5 by now plus me of course.

Hi Dave, I tried it out last night and it worked a charm! Had it running with FocusMax and it it did the job, just need to get up to speed with FM as I spent about 3 hours under clear skies messing about with it. To be fair, I was also trying out a new camera and an OAG for the first time, so maybe a bit much to try in one night  :eek:

Would be good to see temperature monitoring implemented, in fact I'm half tempted to do it myself if I find the time, although my coding is nowhere near as elegant as yours! 

  • Like 1
Link to comment
Share on other sites

Most of the bits have arrived, do stepper motors have a standard spindle size ?  I can only find 4mm or 5mm wheels but it seems to be between the two (must get a metric micrometer)  :grin:

Measures just under 20 thou inch.

Dave

Link to comment
Share on other sites

Most of the bits have arrived, do stepper motors have a standard spindle size ?  I can only find 4mm or 5mm wheels but it seems to be between the two (must get a metric micrometer)  :grin:

Measures just under 20 thou inch.

Dave

The one I used from Technobots is 5mm and fitted the motor shaft after a small amount of filing with a needle file.-
  • Like 1
Link to comment
Share on other sites

Dave is it possible to download the ASCOM driver project? I can't see it on the sourceforge site.

You will need to use subversion to checkout the code. You can use a client such as tortoisesvn to check out to local disk or check out the project directly in visual studio. Click on the Browse Code button on the SF summary page and it will give you the svn url to use for a read-only checkout. You can't commit any changes you make back to the site - only I can do that. If you just want to look at the code you can browse the files from this page.

Edited by tekkydave
  • Like 1
Link to comment
Share on other sites

Thanks Dave, got the code last night, took a bit of time to get my head around it but struggled to get it working.

I added the following to the Arduino code to return a default temperature of 21.5 (and the counterpart in the driver code), but get an error in the client program (Focusmax). When I checked the log, it reports that the driver sent the command to the Arduino and the Arduino returned a string, but the sting was only "TT:OK#". Bit of a head scratcher :confused:

  case 'TT': // Get Current Temperature    {      Serial.print("TT21.5:OK#");      break;    }
Link to comment
Share on other sites

Thanks Dave, got the code last night, took a bit of time to get my head around it but struggled to get it working.

I added the following to the Arduino code to return a default temperature of 21.5 (and the counterpart in the driver code), but get an error in the client program (Focusmax). When I checked the log, it reports that the driver sent the command to the Arduino and the Arduino returned a string, but the sting was only "TT:OK#". Bit of a head scratcher :confused:

  case 'TT': // Get Current Temperature    {      Serial.print("TT21.5:OK#");      break;    }

I think this is because you have used 2 chars ('TT') for the command. The switch statements starts with:

switch(command.charAt(0)) {

command.charAt(0) means the first char of the string command. It only detects the first 'T' and interprets it as the 'Set Target Position' command.

It must be interpreting the second 'T' as the position then echoing it back to confirm giving the 'TT:OK#'.

I decided at the outset to use single character commands for simplicity so we just need to pick a different letter. I suggest 'C' for Celcius.

Try this:

  case 'C': // Get Current Temperature

    {

      Serial.print("C21.5:OK#");

      break;

    }

I have tested it on a spare nano and it works ok.

  • Like 1
Link to comment
Share on other sites

Roll of Honour

I have just flicked back through this topic and made a list of all the SGL members who have made a focuser based on my design (or have one on the go).

I hope this is correct. If I have missed anyone let me know.

  • Dave_D
  • Baffa
  • wuthton
  • Mick J
  • russellhq
  • mindburner
  • Davey-T
  • Like 1
Link to comment
Share on other sites

<p>Roll of Honour I have just flicked back through this topic and made a list of all the SGL members who have made a focuser based on my design (or have one on the go). I hope this is correct. If I have missed anyone let me know.

  • Dave_D
  • Baffa
  • wuthton
  • Mick J
  • russellhq
  • mindburner
  • Davey-T
23/09/2014 - add Steve_Max127 Edited by tekkydave
Link to comment
Share on other sites

hi is there any way to get the ascom driver to start at say position 1000 rather than 1 as it basically means that one can only focus one direction, at lest in focusmax, unless the ascom chooser is opened and the position entered manually. 

With the 200mm lens I normally keep it at last focus position (to do flats etc) and don't want to wind the focus in one direction fully.

the focuser is now working a treat with an external 5v driving the stepper, no more stuttering or slipping

  • Like 1
Link to comment
Share on other sites

hi is there any way to get the ascom driver to start at say position 1000 rather than 1 as it basically means that one can only focus one direction, at lest in focusmax, unless the ascom chooser is opened and the position entered manually. 

With the 200mm lens I normally keep it at last focus position (to do flats etc) and don't want to wind the focus in one direction fully.

the focuser is now working a treat with an external 5v driving the stepper, no more stuttering or slipping

It should start at position 1000 with the latest arduino sketch and driver. I also added the option to specify the start position on the chooser dialog. If you don't see the drop-down box when you choose the driver you might be using an earlier release.

Link to comment
Share on other sites

We have temperature sensing!

Here's a screenshot from focusmax:

post-6495-0-66351500-1411509811.png

And an extract from the log file:

23:04:20.042 AAF2                      Constructed23:04:22.079 AAF2.setInitialPosition   Sending: I1000#23:04:22.079 AAF2.CommandString        ------------------ Start -----------------------23:04:22.079 AAF2.CommandString        Command = I1000#23:04:22.079 AAF2.CommandString        Clearing Buffers23:04:22.080 AAF2.CommandString        Transmitting:I1000#23:04:22.330 AAF2.CommandString        Getting Return Message23:04:23.160 AAF2.CommandString        Return Message = I1000:OK#23:04:23.161 AAF2.CommandString        ------------------ Finish ----------------------23:04:23.161 AAF2.setInitialPosition   Received: I1000:OK#23:04:23.161 AAF2.getPosition          Sending: P#23:04:23.161 AAF2.CommandString        ------------------ Start -----------------------23:04:23.161 AAF2.CommandString        Command = P#23:04:23.161 AAF2.CommandString        Clearing Buffers23:04:23.162 AAF2.CommandString        Transmitting:P#23:04:23.412 AAF2.CommandString        Getting Return Message23:04:23.413 AAF2.CommandString        Return Message = P1000:OK#23:04:23.414 AAF2.CommandString        ------------------ Finish ----------------------23:04:23.414 AAF2.getPosition          Received: P1000:OK#23:04:23.414 AAF2.getPosition          Position = 100023:04:23.607 AAF2.getTemperature       Sending: C#23:04:23.607 AAF2.CommandString        ------------------ Start -----------------------23:04:23.607 AAF2.CommandString        Command = C#23:04:23.607 AAF2.CommandString        Clearing Buffers23:04:23.608 AAF2.CommandString        Transmitting:C#23:04:23.858 AAF2.CommandString        Getting Return Message23:04:24.393 AAF2.CommandString        Return Message = C20.2:OK#23:04:24.393 AAF2.CommandString        ------------------ Finish ----------------------23:04:24.393 AAF2.getTemperature       Received: C20.2:OK#23:04:24.393 AAF2.getTemperature       Temperature = 20.223:04:25.408 AAF2.getTemperature       Sending: C#23:04:25.409 AAF2.CommandString        ------------------ Start -----------------------23:04:25.409 AAF2.CommandString        Command = C#23:04:25.409 AAF2.CommandString        Clearing Buffers23:04:25.409 AAF2.CommandString        Transmitting:C#23:04:25.660 AAF2.CommandString        Getting Return Message23:04:26.199 AAF2.CommandString        Return Message = C20.2:OK#23:04:26.199 AAF2.CommandString        ------------------ Finish ----------------------23:04:26.199 AAF2.getTemperature       Received: C20.2:OK#23:04:26.199 AAF2.getTemperature       Temperature = 20.223:04:27.211 AAF2.getTemperature       Sending: C#

Also, I've attached the arduino sketch and driver cs files to the post in a zip file.

AAF2r1.zip

  • Like 1
Link to comment
Share on other sites

We have temperature sensing!

Here's a screenshot from focusmax:

attachicon.gifFM.png

And an extract from the log file:

23:04:20.042 AAF2                      Constructed23:04:22.079 AAF2.setInitialPosition   Sending: I1000#23:04:22.079 AAF2.CommandString        ------------------ Start -----------------------23:04:22.079 AAF2.CommandString        Command = I1000#23:04:22.079 AAF2.CommandString        Clearing Buffers23:04:22.080 AAF2.CommandString        Transmitting:I1000#23:04:22.330 AAF2.CommandString        Getting Return Message23:04:23.160 AAF2.CommandString        Return Message = I1000:OK#23:04:23.161 AAF2.CommandString        ------------------ Finish ----------------------23:04:23.161 AAF2.setInitialPosition   Received: I1000:OK#23:04:23.161 AAF2.getPosition          Sending: P#23:04:23.161 AAF2.CommandString        ------------------ Start -----------------------23:04:23.161 AAF2.CommandString        Command = P#23:04:23.161 AAF2.CommandString        Clearing Buffers23:04:23.162 AAF2.CommandString        Transmitting:P#23:04:23.412 AAF2.CommandString        Getting Return Message23:04:23.413 AAF2.CommandString        Return Message = P1000:OK#23:04:23.414 AAF2.CommandString        ------------------ Finish ----------------------23:04:23.414 AAF2.getPosition          Received: P1000:OK#23:04:23.414 AAF2.getPosition          Position = 100023:04:23.607 AAF2.getTemperature       Sending: C#23:04:23.607 AAF2.CommandString        ------------------ Start -----------------------23:04:23.607 AAF2.CommandString        Command = C#23:04:23.607 AAF2.CommandString        Clearing Buffers23:04:23.608 AAF2.CommandString        Transmitting:C#23:04:23.858 AAF2.CommandString        Getting Return Message23:04:24.393 AAF2.CommandString        Return Message = C20.2:OK#23:04:24.393 AAF2.CommandString        ------------------ Finish ----------------------23:04:24.393 AAF2.getTemperature       Received: C20.2:OK#23:04:24.393 AAF2.getTemperature       Temperature = 20.223:04:25.408 AAF2.getTemperature       Sending: C#23:04:25.409 AAF2.CommandString        ------------------ Start -----------------------23:04:25.409 AAF2.CommandString        Command = C#23:04:25.409 AAF2.CommandString        Clearing Buffers23:04:25.409 AAF2.CommandString        Transmitting:C#23:04:25.660 AAF2.CommandString        Getting Return Message23:04:26.199 AAF2.CommandString        Return Message = C20.2:OK#23:04:26.199 AAF2.CommandString        ------------------ Finish ----------------------23:04:26.199 AAF2.getTemperature       Received: C20.2:OK#23:04:26.199 AAF2.getTemperature       Temperature = 20.223:04:27.211 AAF2.getTemperature       Sending: C#
Also, I've attached the arduino sketch and driver cs files to the post in a zip file.

Thanks for that. Are you ok with me putting that into the project? Can you do a simple circuit diagram showing how the DS1820 is connected to the nano and I'll add that too.

That's brilliant - you've saved me some time working it all out, thanks again.

Link to comment
Share on other sites

No problem adding it to your project, you did all the hard work!

Here's a crude sketch of the layout. Basically what you do is:

  1. Connect outer pins to ground
  2. Connect middle pin to a digital pin (my arduino code uses pin 6)
  3. Connect a pull up resistor of value 4k7ohm between your digital pin and 5v pin

post-6495-0-09974800-1411542532.png

This arrangement is called "parasitic mode", which basically allows you to run 2 wires to the DS18B20 instead of 3. You can find out more about it here:

http://playground.arduino.cc/Learning/OneWire

You will also need to modify the Arduino code I posted to account for the serial number of your own DS18B20. I used the following sketch to find it:

http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

Thinking about it, it's probably a better idea to incorporate the sketch into the focuser sketch!

  • Like 2
Link to comment
Share on other sites

No problem adding it to your project, you did all the hard work!

Here's a crude sketch of the layout. Basically what you do is:

  1. Connect outer pins to ground
  2. Connect middle pin to a digital pin (my arduino code uses pin 6)
  3. Connect a pull up resistor of value 4k7ohm between your digital pin and 5v pin

attachicon.gifDS18B20.png

This arrangement is called "parasitic mode", which basically allows you to run 2 wires to the DS18B20 instead of 3. You can find out more about it here:

http://playground.arduino.cc/Learning/OneWire

You will also need to modify the Arduino code I posted to account for the serial number of your own DS18B20. I used the following sketch to find it:

http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

Thinking about it, it's probably a better idea to incorporate the sketch into the focuser sketch!

Cheers. I'll try to get this built into the project and a new release out at the weekend. It depends what SWMBO has planned for me at the weekend.

I like the idea of getting the sketch to detect the serial number automatically. It will only ever have one DS18B20 attached so it only needs to get one value.

I might be a good idea to have the code detect if the sensor is present and return sensible values to the driver if not. I guess not everyone will want to have the temperature sensor fitted.

  • Like 1
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.