×

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

Bi-monthly release with minor bug fixes and improvements

Moonlite focuser protocol

  • Posts: 23
  • Thank you received: 9
It works. Thank you.
7 years 9 months ago #9047

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

  • Posts: 1
  • Thank you received: 0
Silly question, but how do you access the article?

Cheers

Lance
7 years 6 months ago #10464

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

It's in the main website
7 years 6 months ago #10465

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

  • Posts: 3
  • Thank you received: 0
Hi Folks,

Im building this at the moment and want to add a temp sensor (DS18B20). I get get the sensor to output the temp in Celsius but dont know how to convert it to work with the moonlight protocol, there is also the temp coefficient again what do I do with this?
Any help would be great!

Craig
6 years 6 months ago #18908

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Moonlite focuser protocol

Hi Craig,

I am not sure if useful, I followed those instructions when "rebuilding" the moonlite focuser - see this link:

github.com/Hansastro/Focuser

In the library for the LM335 (lm335-cpp), which is used here as sensor, the following formula is applied (to the end of the lib), maybe you can leverage:

return (500.0*analogRead(this->aquisitionPin)/1024.0) - 273.15;
6 years 6 months ago #18914

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

  • Posts: 3
  • Thank you received: 0
Yep, thanks for that. I eventually figured it out
6 years 6 months ago #19026

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

  • Posts: 3
  • Thank you received: 0
Hi,

Me again! Turns out I did not 'figure it out' - the hex number for the temperature needs to be a signed hex number - I have no idea how to convert a standard number say 20.5 celsius into a signed hex number! Has anybody got any idea?
6 years 6 months ago #19221

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

  • Posts: 9
  • Thank you received: 1

Be careful with the formula. I remarked that the temperature is not quite right. I think the factor 500 come from some try and error process. It is something in my list of things to improve. (I am the author of the library)

The conversion from Celsius to Hex is not very difficult. You can find it in the github repository in the Moonlite.cpp file. At the end. For the temperature the function "convertLongToChar" is what you are looking for probably.

What happened with negative value... I am not sure of that... Check the function before using it. I have to verify that. I don't remember well.

For your question about how to code 20.5 in signed hex. There is a trick. In the protocol such values are not transfered as they are but they are multiplied by 2. Then you don't have to transfer a floating point value. That explain why the display is always with round or .5 values and nothing in between. (See the file Focuser.ino line 106)

The compensation is not used to calculate the temperature. This value is used to readjust the focus when the temperature changes. You focus, note the temperature and the number of steps of the focuser. You wait some times until the temperature is not the same. You refocus and note again the temperature and the number of steps. You know the differences for the temperature and the position between the two measures and you can calculate a step/degree value. This is the compensation value.

Jean-Phi
The following user(s) said Thank You: Eric
Last edit: 6 years 6 months ago by Jean-Philippe.
6 years 6 months ago #19325

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

  • Posts: 79
  • Thank you received: 13
Hi,
I'm new to INDI and also trying to build a focuser that can use the Moonlite protocol.
I would value some pointers as to the best code base to use. I have experience building Arduino apps and I have assembled all the bits.Stepper motor, Arduino, A4899 driver board etc
So far I tried to replicate the code from :
github.com/Hansastro/Focuser
I cannot seem to get it to work. The code comes with a test routine that does work with my Stepper motor, but the main code only responds to a few basic commands when entered through the serial monitor.
I would really appreciate any pointers on a better starting base.
Max
5 years 9 months ago #26474

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

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Re:Moonlite focuser protocol

I designed and 3d-printed mine for an Orion ED80T using an Arduino Nano and a 28BYJ-48 stepper. I realize I did not push the code to github (but I pushed the .scad file), I could do that if it is of any help. It is based on a firmware from Sourceforge, which I, er, fixed for my own purposes. It is supposed to also control my dust cap when its .scad will be done. The protocol is really not a problem. Getting the timings consistent and the backlash of the crappy steppers under control is another story...

-Eric
5 years 9 months ago #26475

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Re:Moonlite focuser protocol

Hi Max,

Some time ago a build the focuser, which worked well in principle. What can be critical is the persistent port mapping that might be required if other serial devices are used.

www.indilib.org/support/tutorials.html

Meanwhile I am using the astroberry-diy focuser, with the a4988 driver. If of interest, can share more details.

Best, Helge
5 years 9 months ago #26477

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

  • Posts: 79
  • Thank you received: 13
Managed to get the Arduino based focuser at github.com/Hansastro/Focuser working well on an Arduino Nano. Had to tweak the code to move the screed connections for the I2C display and correct a small error, but basically the code works well and I have it all connected and driven by the EKOS focus module. I can run the autofocus routine to achieve a much better focus result and for a fraction of the price of a proprietary product.
Below are a few pictures They show:
The focuser in its final project box. The three cables are: USB to RPI; 12v power in for motor; cable to stepper motor. Breadboard version before boxing; stepper connection to telescope using metal collar and flexible coupler
The following user(s) said Thank You: Hellriegel, euklides69
5 years 8 months ago #27332
Attachments:

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

Time to create page: 1.936 seconds