×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Moonlite focuser protocol

  • Posts: 23
  • Thank you received: 9
Yes, I'm planing to do so this week. How can I make an article?
7 years 9 months ago #9039

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

Click here to create an article, or you can email it to me directly and I'll add it.
7 years 9 months ago #9043

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

  • Posts: 23
  • Thank you received: 9
"You are not authorised to view this resource." I'll write it trough the CMS if you give me access.
7 years 9 months ago #9045

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

Can you please try again?
7 years 9 months ago #9046

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

  • 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 7 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 7 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 7 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 7 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 7 months ago by Jean-Philippe.
6 years 7 months ago #19325

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

Time to create page: 0.887 seconds