Jump to content

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

  • Replies 490
  • Created
  • Last Reply

Just a quick FYI on the new layout, in/out/move work in either absolute or relative mode, they wil use the keypad value to move the foucser appropriately.

the 'Set' buttons also use the current keypad value to change the respective setting.

The top row of presets is for absolute positions, at the moment it only works in absolute mode, right click to save either the current position or the keypad value to the preset. To use the preset, simply click the button and it will move the focuser to that position.

the 2nd row of presets are for Move In/Move Out increment presets, right click on any button and it will allow you to save the current keypad value to whichever preset you choose.

At the moment, the buttons aren't displaying the preset values correctly (they will after you change the value but only for that session), this will be fixed soon!!

Set In/Set Out Backlash buttons, when the code is written into the firmware, these buttons will allow you to set an offset that will be applied to move in/out to counter any backlash in your setup. The buttons do work and send out data but the offsets will not be applied because the firmware does not have the backlash code in it yet.

Last of the additions, Just below the Comm Port box on the right hand side, there is an empty box, this will contain a temperature reading from a DS18B20 digital temperature sensor that any ascom based focuser software can access, they're incredibly cheap and will be useful for software based temperature compensation routines. This will be implemented as soon as I can work out why it's making maxim hang (it looks like it's closed but it's still present in task manager).

Link to comment
Share on other sites

Reggie i have just been testing and it seems to be serialport1 related. If you dont open the serial port it doesnt hang.

Just rewriting the serial port to try another method then going to try .net 4 as well. I understand serialport in .net 3.5 can be iffy?

Link to comment
Share on other sites

Don´t worry you were right it was your damn thread sleep code confusing me!

New Beta version podted on the SGL group under focuser software Beta version folder:-

http://tech.groups.yahoo.com/group/sgl_observatory_automation/files/SGL%20Software/Focuser/Beta%20Version/

- Euan have a play and let us know your comments or any errors you find (we´ve improved a lot of the code.)

Thanks

Link to comment
Share on other sites

Indeed John, and to top it all, it's now fixed, I'm annoyed (with myself) because the fix was exactly what I thought it was and had tried the other day, for some reason, it didn't show as a fix at the time (although in my defence, I hadn't used VB ever up until about a week or so ago).

Link to comment
Share on other sites

Hi George, yes it is, in fact, the slightly older unfixed version would've worked for everyone too. The bug only appears when my temperature sensor code is switched on, I made it non-blocking so that the app. wouldn't look like it had hung while it waited for a temperature reading, it uses a method that puts the thread to sleep but still continues with the rest of the app, it just needed a flag from the main form to drop out of the sleep loop when the app. is closing.

Link to comment
Share on other sites

That's a Reg question really, if the melexis is the sensor for the cloud detector, then that would entirely depend on where the sensor was placed, I have zero experience of the cloud sensor or how it's setup, so if you could explain where the sensors go then I could tell you definitively.

The sensor I used for temperature is incredibly cheap though George, Dallas DS18B20, about £2 each on ebay for a digital sensor that does down to -40 I believe and only needs a single resistor and 3 wires to make it go :icon_salut:

Link to comment
Share on other sites

The sensor I used for temperature is incredibly cheap though George, Dallas DS18B20, about £2 each on ebay for a digital sensor that does down to -40 I believe and only needs a single resistor and 3 wires to make it go :icon_salut:

Might give that a go then Reggie, I just thought as myself and Neil had the sensor already running (mines sited around 15 feet from the scope) and Neil was familiar with the code (he wrote it :) ) we could kill 2 birds with 1 stone :)

Link to comment
Share on other sites

Oh sure I apprecaite that Neil wrote that code but he hasn't had any input on the temperature code for the focuser, that was me, for what it's worth. As far as I know the sensor needs to be attached to the scope rather than in free air.

How are you using your cloud sensor George? Is it connected to your focuser or a standalone unit?

As said, I'm not familiar with the cloud detector and if I'm honest, I don't seem to recall there being any 'cloud' code in the beta, then again, this beta is purely for the ascom driver, standardising the gui and augmenting the focuser driver with extra functions that are beyond the ascom interface remit. So it's quite possible that we will have to look over that over the next week or so and see what needs looking at, shouldn't be much, I think I had a little look at the code, so we should really be able to drop the code into whatever we've got that's current.

I also need to get my automatic dew heater code sorted too, depending on how we handle things we may well be able to mix and match between focuser, dew heater and cloud detector but it will require a stricter pin usage regime than the one we currently have.

I think the biggest issue right now is making it all work with ascom. As far as I know there isn't much (anything) in the way of a hardware defnition for the dew heater and the cloud sensor in ascom, we can code whatever we like into an ascom driver interface, that's not an issue, you only have to look at EQMod for a good example of what you can do despite ascom and when I say despite ascom I'm not criticising it, it's evolving and just needs to do it some more IMHO. Which is also something the ascom guys are addressing at the moment with a very robust discussion about a framework for a sensor/switch interface.

Link to comment
Share on other sites

You'd be better off chatting to Neil Reggie as coding and how the software works is beyond my feeble mind :icon_salut:

The cloud detector is connected via the Arduino which is why I thought pulling the temperature data would be fairly easy as the focuser uses the same PLC.

Link to comment
Share on other sites

S'ok George, I wasn't looking for input in that sense, more putting what the position is currently for us :)

Not being too flippant, getting the sensor data is never really going to be a problem, it's pretty simple stuff, so it's really a question of what the cloud sensor actually does? I realise that it's an IR sensor, does it also have a temperature sensor built into it? I realise that might sound like an odd question seeing as it's an IR temperature sensor :icon_salut: What I mean is is a seperate sensor in the unit that isn't IR based?

Link to comment
Share on other sites

The Melexis sensor has 2 temperatures, object temperature (the IR temperature sensor value, we use that to measure sky temperature) and ambient temperature (i.e the temperature of the sensor itself.

So together with a humidity sensor it could be used to calculate the dew point. But it would be the dew point of the area where the Melexis sensor is. If that's good enough an approximation, then you can use it to control the heater (switch on heating when you approach the dew point). If you want it more exact, you would have a temperature sensor for each dew heater individually calculating the local dew point (though I would find that exaggerated).

However, the cloud sensor and the focuser / dew heater controller do not run on the same Arduino (they are separate Arduino programs), so you would have the dew heater Arduino request the temperature from the cloud sensor Arduino. Much easier to have (at least one) separate temperature sensor for the heater controller.

Link to comment
Share on other sites

Actually not true yesyes, the arduino can run the focuser and dew heater code together, I know because I wrote it to do it. Only it never got released, I got ill unfortunately :icon_salut:

The dew heater code is is already written, it has an ambient sensor for measuring ambient temp and relative humidty and seperate sensors for each heater tape that you want to use, it all runs automatically and the only user interaction after initial setting of trigger levels is to plug everything in. Focuser temperature compensation will be reliant on the temperature of the scope not ambient off-site temp :)

Link to comment
Share on other sites

Cor...dont you lot go on!

Reggie my cloud sensor is infinately more complicated than your temperature sensor. I have comms and everything! And you knicked the TMP command i was using for the cloud sensor over the comms damn you.

Your code will be no different to mine...except mine will be much better with no comments!(is that enough digging?)

Yesyes

There is an old version on the sgl group which is running the cloud sensor and focuser.

Our cloud temperature is no good for focuser temperature compensation as it would be based on focuser temp.

I've got lost now...this phone doesnt show the previous posts whilst writing..

Link to comment
Share on other sites

Cor...dont you lot go on!

Reggie my cloud sensor is infinately more complicated than your temperature sensor. I have comms and everything! And you knicked the TMP command i was using for the cloud sensor over the comms damn you.

Your code will be no different to mine...except mine will be much better with no comments!(is that enough digging?)

Yesyes

There is an old version on the sgl group which is running the cloud sensor and focuser.

Our cloud temperature is no good for focuser temperature compensation as it would be based on focuser temp.

I've got lost now...this phone doesnt show the previous posts whilst writing..

I was winging it waiting for you to turn up.

Funnily enough I've been thinking about #TMP: today, I looked at your focuser/cloud sensor pde last night, so I was trying to come up with 3 different chars for my temp. sensor command. #WTF: is all I have so far....

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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