×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Moonlite focuser protocol

  • Posts: 79
  • Thank you received: 13
I had the same problem. I have the Arduino version working well on a Nano using the Indi Ekos system. I have also tested it using the serial monitor of the Arduino IDE. All works fine.
However it will not work with the Moonlite standalone app. In fact it will not even recognise the device. I know for the Arduino Nano has had issues with switching drivers over the years and I can only assume that the official app has a built in driver and expects a specific board. The original author of the software I used said it worked using an Arduino UNO. I have not tested it, I am happy that Indi works with my focuser and does what I need.
Max
5 years 7 months ago #29000

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 4

Replied by anofeles on topic Moonlite focuser protocol

Hello, Max.
I hope you had a good holiday. I was wondering, as we talked about a few weeks ago, if you'd be so kind as to upload the schematic of the electronic connections of your version of Hansastro's montage. It seems that you have changed the pin of some connection and removed one of the resistors... Let's see if I can get the LM335 sensor working properly...
Thank you in advance
5 years 6 months ago #29220

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 13
I will see what I can do to draw up some sort of diagram. However most of the connections are the same as the original schematic.
the only physical changes I made were:
-Changed temp sensor to pin A0, in the original code it was pin 3,
-left off the potetiometer completely , adjustments made in software
-connected a I2C display to : A4 (SDA) and A5 (SCL) which is used in the original code but not shown in the schematic
Max.
5 years 6 months ago #29261

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 13
Attached is my schematic of the Arduino MoonLite Focuser Schematic derived from Hansastro Focuser. See explanations earlier in the thread. My code at github.com/mdobres/MaxFocuser is a slight variation of the original Hanastro Focuser at github.com/Hansastro/Focuser. The Arduino code also contains a list of Pin Assignments.
My version no longer has a Pot to calibrate the temperature, I do it in the Arduino code using a constant as follows:
tempcorrect= 178;

You change that number adjust the temperature just once when you set it up.

Max
The following user(s) said Thank You: Jasem Mutlaq, anofeles
Last edit: 5 years 6 months ago by Max Dobres. Reason: missed a bit
5 years 6 months ago #29450
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 4

Replied by anofeles on topic Moonlite focuser protocol

Thank you very much for the work you have taken to make the diagram. It has been a great detail.
Just one more question. On what basis did you enter the number 178 as "tempcorrect"?
Thank you in advance.
5 years 6 months ago #29451

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 13
I had the real temp from an accurate source and just varied the number by trial and error. Its a simple addition/subtraction
5 years 6 months ago #29455

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 1
Hello,

I'm new to Arduino programming and Max Focuser project but I like it and planning to use for my telescope setup.
Tons of thx for all contributors of this great project !

Would you be able to tell me if it's possible to add to existing focuser code handling of a simple hand controller?
Just a small box , cable connected with 2 buttons UP and DOWN allowing user to set focus during observations where software control and temp compensation is not needed? Such enhancement would allow using smaller stepper motors models (like: MOONS PG22L71). The ones where shaft is locked (doesn't spin freely) when motor is not powered up. I don't know yet how realistic is this what I'm asking but I'm just thinking , that focuser code could modified to switch into manual control automatically when no data is received over USB/serial port.

Please share your thoughts. I would also appreciate any code examples.
4 years 6 months ago #42829

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 13
Yes its very possible to add a control box to this Hansastro Moonlite protocol focuser. however the fact that you are asking the question may mean that its not so easy for you. I say this because from the code it is self evident that such an enhancement is possible if you have Arduino coding experience. If you do not then this is a good time to learn.

I am assuming you want to add this control box to a system that is connected to Indi/EKOS.
Moonlite protocol commands are defined in this Moonlite Guide :
The code in the Hansastro version loops round waiting for a command from the serial port in the form :command# such as :SN0200# which sets the new position at 0200 (hex).
To modify the code you would need to include within the loop some code that checked if the the switch (either in or out) was being pressed and if so issue the appropriate command set.
Things like writing code loops testing for a switch to be open or closed, are standard Arduino techniques and you should master them first on a simple system, rather than try and modify the code. So for example write a simple system that lights a blue led if one switch is pressed or a red one if another is pressed.
Alternatively you will see that within the focus module you can just press a software button for in or out.

If however you just want a stand alone manual/electric focuser then you should just write a "simple stepper motor control program in Arduino" a search for the text in quotes will give you lots of examples.
On the the motor front, beware of lightweight stepper motors, they will not hold focus. The Nema17 is rock solid when under power or not.

Best of luck
Max
The following user(s) said Thank You: euklides69
4 years 6 months ago #42907

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 1
Can you tell me please if Max or HansFocuser arduino code should work with Ascom platform ?
Did anybody experiment with it?
If yes - what Ascom focuser driver I should use for successful config ?

Btw :

So far I was able to successfully check connectivity between Arduino Nano, Uno boards and Moonlite (non Ascom) stand alone software.
I used Sunfounder/Sansmart Arduino clone boards with FTDI232R chip. Moonlite application works way more stable with newest FTDI dirivers (2.12.28).
Just sharing my observations.


edit/update:

I think I found the answer to my own question :)
It was in comments of Nano_Moonlite_Focuser.ino project .
100uF capacitor between RESET and GND resloved the problem of detection Arduino board with MaxFocuser code by Ascom [Moonlite DRO Focuser Driver].
Last edit: 4 years 6 months ago by euklides69.
4 years 6 months ago #43076

Please Log in or Create an account to join the conversation.

  • Posts: 554
  • Thank you received: 138
I wrote the MoonLite ASCOM drivers for MoonLite.

What's happening is that the Arduino is designed so it runs the boot code on reset, this takes about a second before it drops into the user code.

The circuit is designed so that a reset is done when the serial port is connected.

Drivers using an Arduino need to wait after the serial port connection before starting to communicate, I use a two second delay. The real MoonLite focuser controller doesn't use an Arduino so doesn't need to do this.
The 100uF capacitor to the reset pin disables the short reset when the serial port connects so avoids the boot phase. Not sure how you reprogram the Arduino after that.
4 years 6 months ago #43087

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 1
Chris

Does Nano clone with CH340C USB chip on board has any chance to work with Moonlite (non Ascom) stand alone app or its Ascom driver?

I tried already to connect Maxfocuser preloaded CH340C Nano board with DTR pin mod (no reset during serial initi., no bootloader)
Board is communicating with Arduino IDE w/o any problem. Regardless of modification this board is NOT recognized by any Moonlite factory software or driver .
What prevents it from connecting - any ideas ?
Last edit: 4 years 6 months ago by euklides69.
4 years 6 months ago #43283

Please Log in or Create an account to join the conversation.

  • Posts: 554
  • Thank you received: 138

I'm not going to go and buy this hardware in order to help you with this.

It's one of the problems with trying to leech off existing drivers, you have to ensure that your hardware is compatible.
4 years 6 months ago #43329

Please Log in or Create an account to join the conversation.

Time to create page: 0.927 seconds