Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Keypad coming along nicely


griz11

Recommended Posts

The display I ordered showed up today and I wasted no time hooking it up. As usual there was gnashing of teeth cursing and all that but eventually it came up and talked to everything like its supposed too. Had to modify the code I'd written for the keypad display but not much. Their IDE is pretty awesome. You can program down on the bare metal or go to a totally drag and drop mode. It has a micro sd card you load all the graphical elements and code onto that. Once inserted into the display and rebooted it comes right up. The display is intelligent. Runs on its own has GPIO pins and all that. Even sound. You interact with it via commands and status over a serial interface. So it doesn't load up the host at all.

Keypad-display.jpg

The display is a 4-D systems unit. About 100 bucks. Its a 4.3inch the smaller ones are much less expensive. 3.5in seems to be the sweet spot for price right now. Less than half the cost of this one. They also have a 7 inch. Arduino or PI starter kits. You need to get that or the programming cable or you will fry the beast when you try and flash it. Its 3.3v instead of 5. I decoded the other keypad so now I need to set up a table to translate keypresses to a bit code send that over the 6 wire cable and it should move the mount. I'm going to use bluetooth for the final interface so the pad has no wires.

Griz

Link to comment
Share on other sites

That is possible however uploading the image to the touch screen would be pretty slow. But you could load it in the background so it wouldn't stop everything while it was going on. What I really want to do is divide up a star map of the sky into chunks that the display can handle then reference the RA DEC of the current position and grab the correct segment of the map and display that with marker where you are pointing. You could pre store all those on the SD card so they would be pretty instant to load.

I knew it was going too smoothly. Ran into a problem with the Pi. I have the newest model the B+. The display won't work with it till later in the month. They are having to redo some firmware. So I grabbed the Arduino mega and hooked it up to that. Ran into some power issues the usb port couldn't pump enough juice to both boards. That ended up corrupting the SD which wasn't just a reformat to fix. Eventually I found out how to fix the card so all is well again and now I'm able to talk to it finally. After having it for a few days I'm not sure I"m going to use an Arduino or Pi to power it. No need really. It has GPIO pins and thats all it needs to be a handpad.

Didn't get to work on it any yesterday. My pup had surgery and I was taking care of her all afternoon. I found her in the garage one evening when I was setting up the camera to take some moon shots. 9 weeks old someone had dumped her. She hardly had any hair she had such a bad mite infestation. It was touch and go for a couple of weeks with her. But she is healthy now has all her hair back. She is part Corgi and part Chihuahua totally fearless. A little strange looking her body is way too long. The first night I had her she sat in my lap all evening while I was taking pictures. She still loves to sit by the rig with me. Watches everything like she knows what is going on. Don't think she had much human contact before we found her. No socialization at all. Scumbags dump animals out here all the time. My cat is another dumpee. I'll catch somebody dumping them one of these days. Won't be pretty.

GRZ_9475-sm.jpg

Griz

Link to comment
Share on other sites

  • 2 weeks later...

Its coming right along. Three screens now. Mount control. Environment and dew control and a preliminary focus control panel. Really need to get some hardware to fine tune the focus panel. Needs to be easy to use and accurate.

Mount Control panel

Mount_Control.jpg

Environment and Dew control panel

Env-Dew.jpg

Focus control panel

Focus_Screen.jpg

I have the Arduino talking to the display and the sensor now. Reading the messages from the display so I know all the keys are working. Navigation between screens works using the arrow keys bottom rt corner. I'll use a few pins capable of pulse width modulation to drive the dew strips. Dallas semi 1 wire sensor for the telescope temp. I'll be patching into a JMI motofocus unit for the focus piece. I'm assuming its a stepper but don't know for sure. Either way the Arduino can handle it.

Griz

Link to comment
Share on other sites

There are some pretty complete programs out there for that purpose. One I ran across one that even has the ascom driver and all that. I thought about using that for a base then changing out the stepper code for servo code. But its just too big of a job I don't want to mess with it. The SciTech is a decent price. Probably cheaper than I could have made one.  I have other fish to fry however :) I've made a bit of progress. Its working with the Arduino Mega now. And I have the temp/dew sensor attached to the same board . The screen has been changed up a bit. Now has a power meter for the state of the battery pack and a slider for brightness and some arrow keys to navigate between screens. Two screens now one for the mount one for the weather data and dew control.

screen1.jpg

screen2.jpg

Moving right along good project when the weather is bad. It ruined our Central Tx Star Party. Rained on the BBQ and washed out the observing sessions. Big storm tonight it was dangerous to be on the field when it hit.

This is one of the scopes at the observatory a 16". It was donated refurbed and now works very well I'm told.

EalingScope1.jpg

And this one. There are several smaller ones they use for public events but these are the two scopes in the observatory.

HSmithScope1.jpg

Also donated to the club. The site is at Canyon of the Eagles along the Colorado River. Very dark. Beautiful area with some nice waterfalls and nature trails as well. Lower Colorado River Auth has a little resort there. Some camping and a few cabins. Our area is off by itself so we are not bothered by the other activities. I didn't get up early enough to go to the class so I could operate the observatory solo. Worked on the project too late last night :) Oh well they have them every month. I don't really want to use the scopes that are there but I'd like to set up my stuff in the observatory. That 16" might be good for some imaging. Might cause a riot if I tried to attach a camera :)

Griz

Link to comment
Share on other sites

Its Alive!!! :) Managed to work through all the stuff and made it display data from my sensors today. All downhill now. Really easy to make it work here is the code.

Working_Display.jpg

/**
 * MountExecutive
 *
 * This code controls a dew heater system, provides directional input to the servo controller, reads and reports status
 * of the battery pack, and provides input for the focus motor. More to come these are the initial areas I want to cover.
 *
 * Uses:
 * SHT11, SHT15) sensor.
 * uLCD43PT touch screen
 *
 *
 */
#include <genieArduino.h>
#include <SHT1x.h>

// Set up the 4-D Systems uLCD-43PT for Visi Genie Mode

Genie genie;

// Define line to reset the display

#define RESETLINE 7
// Specify data and clock connections and instantiate SHT1x object
#define dataPin  4
#define clockPin 2
SHT1x sht1x(dataPin, clockPin);
UserEventHandlerPtr myGenieEventHandler;

void setup()
{
   
   
   Serial1.begin(9600);  // Open up serial port for communications to the uLCD-43PT 200K baud
   
   // Instantiate the genie object
   
   genie.Begin(Serial1);
   genie.AttachEventHandler(myGenieEventHandler); // Start up the event handler for uLCD-43
   pinMode(RESETLINE, OUTPUT);  // Set D6 on Arduino to Output
   digitalWrite(RESETLINE, 0);  // Reset the Display via D6
   delay(100);
   digitalWrite(RESETLINE, 1);  // unReset the Display via D6

   delay (3500); //let the display start up after the reset (This is important)

  //Turn the Display on (Contrast) - (Not needed but illustrates how)
   genie.WriteContrast(8); // 1 = Display ON, 0 = Display OFF.
  //For uLCD43, uLCD-70DT, and uLCD-35DT, use 0-15 for Brightness Control, where 0 = Display OFF, though to 15 = Max Brightness ON.

  //Write a string to the Display to show the version of the library used
  //genie.WriteStr(0, GENIE_VERSION);
}

void loop()
{
  float temp_c;
  float temp_f;
  float humidity;
  float k, dew_point;
  static long waitPeriod = millis();
  int AmbDisp = 0; // Leddigits0 object
  int HumDisp = 1; // Leddigits1 object
  int DewDisp = 2; // Leddigits2 object
  int TelDisp = 3; // Leddigits3 object
  int St1 = 4;     // Leddigits4 object
  int St2 = 5;     // Leddigits5 object
  int Temp_F;      
  int Hum_F;
  int Dew_F;
 
  genie.DoEvents();
 
  genie.WriteObject(GENIE_OBJ_USER_LED, 0x00, 1);
 
  // Read values from the sensor
 
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();
 
  //Calculate dewpoint
 
  k = (log10(humidity) - 2) / 0.4343 + (17.62 * temp_c) / (243.12 + temp_c);
  dew_point = 243.12 * k / (17.62 - k);
  // Convert to F
  dew_point = 1.8 * dew_point +32;
  Temp_F = temp_f * 100;
  Hum_F = humidity * 100;
  Dew_F = dew_point * 100;
 
  // Write the values to the uLCD-43 display
 
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, Temp_F);
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x01, Hum_F);
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x02, Dew_F);
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x03, Temp_F);
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x04, Temp_F);
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x05, Temp_F);
 
  delay(500);
}

Of course there is a lot of code backing this up in the libraries. But its not that hard to deal with. The touch screen is very high level. There was a Radio Shack nearby that is closing. Picked up 3 Arduino shields ethernet and sd card, relay, and a proto board for 12 bucks :) Some cables and other stuff too. Everything was at least 50% off. Looks like I might get a clear night tomorrow. Low humidity too. Lots of storms the past few days but at least the smoke is gone now.

Griz

Link to comment
Share on other sites

Keep posting Griz - I'm following with great interest.

That observatory scope reminded me of an idea I've had to put a concrete pillar in the garden that the EQ mount will fit on. For the daytime I could have a removable bird-bath accessory to keep my SO happy ;-)

Link to comment
Share on other sites

I want to put the portable pier in the back at some point. Leave that outside and just move the head outside each night. The club has some nice facilities and equipment. And the dark site is nice with very dark sky :)  I have a sloping yard enough so the adjusters on the pier aren't quite long enough to make it level. I had just dug out some holes for two of the legs but I wanted something better. Put out 3 paving blocks and leveled them. Next time the sky clears I'll get the mount all aligned then mark the spots where the spikes are supposed to be then drill shallow holes for the spikes in the pavers. Then if I'm level I should be very close to aligned as soon as I put the scope outside. And I don't have any holes to step in or wreck the lawn guys lawnmower. Sonotubes make good forms for piers. There is a company that sells the top piece a sonotube and hardware. Not sure what the name is but they shouldn't be too hard to locate. I found the page looking for piers. There is a fault line just behind my house. It does move around some. Makes the house creak when it does. So I expect to see the movement in some images one of these evenings. There is about a 3.5ft drop right now where the fault line runs. Started playing with Mathematica last night. Thinking about using that to do my FWHM calculations for focus. The program is very expensive but they have a subscription deal like Photoshop now. 15 a  month. Its chocked full of stuff for astronomy. Most of the stuff we image is already embedded in the software. You can actually point a telescope with it take the pictures and process them all in Mathematica. Maxim and Focus Max together run almost a grand. And all you really need from them is the FWHM or HFD to base your movements on. If you buy Mathematica for personal use its 250 and it does so much more than provide focus information. I bought the subscription. I can kill it anytime so if it doesn't do what I need no big expense. All you need to do to run any kind of processing on an image is to find the equation for that operation. You don't have to translate it you simply enter it exactly as its printed in the paper. Actually in some versions you can speak the equation and it will translate that. Translating equations into something that will run on a computer is a big pain. Getting them optimized so they don't take all day is also a major pain. So having something that does both those for you is a huge productivity booster. I'm no math whiz I've had up through calculus. So I can't even begin to touch the capabilities of the software but I am proficient enough to do what I need to do and I'll have the software if I decide I need to learn some more math. I first used it in college along with Matlab. We used them for the calculations needed to set-up the accelerator and beam lines. I write magnet control software for that project and used it to do my calculations as well. Once upon a time they were going to build the supercollider right up the road from where I live. I went back to school to get a physics degree so I could work there. The foolish congress cut the project so I ended up building networks instead of smashing atoms. So who knows maybe some of that knowledge will help me with what I want to do now. One of the aspects of imaging and the mount and associated hardware and software is the degree to which I can use all the things I've learned over the years.

Well the display is still working away. Been at it for close to 16 hours now without a hitch. The local Radio Shack store is closing. I picked up some nice Arduino shields super cheap yesterday. One of them is an ethernet and sd card reader shield. Now I have wired connectivity and storage for logging data. Probably won't use the ethernet but I do want some storage. So I picked up that and a relay shield and proto shield for 12 bucks. New cards never opened. They were marked 50% off but they were much lower than that. I looked them up when I got home and they run about 70bucks. Going to take a break from it today and shoot some photos. Hopefully it will clear and I can get some imaging in tonight. Doesn't look good for tonight. Clouds are still thick and low. I sure hope it clears up I really want to image with the 102GT.

Griz

Link to comment
Share on other sites

Griz,

I am absolutely amazed at your work on this project what a fantastic effort.  You also have a most enviable location for astronomy - any chance you want to swap for the grey skies of Scotland?  I could loan you a Westie, Daisy is her name and a wee lovely dog she is too!

Jim

Link to comment
Share on other sites

I would come back to England in a heartbeat. Loved Scotland when I was a kid touring around. We went a couple of times.  Went from Land's End to Inverness one summer. I was almost 8 when we came back to the states for good.  My brother loves everything American and I love everything British. Guess it just depends where you are when you become aware. I'm 2 years older than he is. I still have my British citizenship. And my name is Pollock so guess where I call home :)

Griz

Link to comment
Share on other sites

  • 1 month later...

Last night I finally made the wireless link to the touch pad work. Switched over to a pair of bluesmirf bluetooth modems. For what I want to do they are a much better solution. You config them with a terminal program and then they just hook up with each other and provide a serial link whenever they are turned on. No software to write on either side.

Switched over from the Arduino to a pcduino for the main computer. The duino is a 1ghz A20 dual core processor with a gig of ram. It has HDMI SATA USB Ethernet and WIFi. Runs linux or android. It has enough horsepower and a floating point unit so I can use it to calculate FWHM and such for my attempts at autofocus. I have it set up to be a headless server. You access it via VNC X-windows client or ssh. It also has a serial debugging port you can use to log into it. Much faster than the Pi. There is an 8 core model that has a unique split kernel. 4 A15 cores and 4 A7 cores. Now that I finally have this problem solved the rest of the project will move right along.

I plan on working with the wifi modules and eventually replacing the bluetooth with them. They are just a little flakey. Random resets and serial corruption. The firmware isn't even up to 1.0 yet so I expect those problems will be fixed soon. The modems I bought are class1 so they have a range of 100meters. Now I'm thinking I should set up a piconet and go totally wireless with a little module that plugs into the SciTech controller using a Trinket Pro and a bluetooth modem and one for the focuser. They will all form a piconet. I have the Trinkets I was going to use them in the handpad but no longer need too.

I have the power supply for the handpad done. Its a single 2500mah 3.7v lipoly cell with a small charger/managment board and booster so it puts out 5v as long as the input is over 1.8v. Also has pins to monitor for low battery and critical battery conditions. Its all very small so the case for the handpad can be thin.

The weather continues to be a thorn in my side. Its clear but its been windy. Not just a little wind but fairly heavy gusts. I did get out the other night for a few hours to do some testing on my wedge fixes. That all works easy to get it aligned using the guide scope then putting the WO onboard. With the band around the base of the wedge I was able to get it aligned with the WO onboard as well. Just a lot harder to turn the adjusters. I have some hex head bolts I can put in for those and use a long allen wrench if I need them. The DSLR was really hot though. Didn't take it long to start bumping up against 100degrees and the noise level was horrible. Not going to use the 7DII while its this hot. I just feel like exposing it to those kind of temps for hours at a time can't be good for it. I'll use the 7D until I can get the ccd. I'm working towards having the handpad and all that done and the ccd bought installed and working by fall.

I picked up an 11channel analyzer. It has 2 oscilloscope analog channels as well. Software runs on a PI so I picked up a 3.5in touch screen for the PI and now I have a nice portable analyzer.

Pi-Scope.jpg

This is a pic of it being used to debug a SPI interface. Its accessible over the net via VNC so the PI can function as a pod as well.

SPI-Decder.jpg

Its a really nice piece of kit. 100 bucks open source hardware and software. Has another processor onboard that is set up just to generate signals for you to use to learn how to use the instrument. The daughtercard is a LPC Link2 board that can function as a hardware debugging probe (jtag). It has a 4370 which is an Arm Cortex optimized for signal processing. Faster sample rate and larger bandwidth than similar priced or even 2x over this price equipment. I have some ideas on how to use it on the mount. It has several protocol analyzers and its possible to write them for whatever protocol you want. I was thinking about writing one for guiding so you could analyze whats happening with the motors and the pulse guiding or hardware guiding signals. So it might end up in my little project at some point. I say little its gotten pretty complicated actually. As I find out more about the microcontrollers I keep finding stuff I want to experiment with and incorporate. The little sensor boards etc are so cheap its hard to resist.

Working-Wireless.jpg

The whole system right after the bluetooth came up and started working. Its reading the sensors and sending the readings to the touch screen over the two little red boards. I've been fooling around trying to get this working for a few weeks now so its nice to finally have it beaten into submission :)

Griz

Link to comment
Share on other sites

Hi Griz,

Your setup is awesome! I'm brewing up a scope control setup using AVRs, but it will be a bit less ambitious.

Do you use ASCOM commands? I have been struggling to try and find the commands that ASCOM compatible programs send for things like scope guiding and despite downloading the full ascom developer platform I'm still in the dark...

Link to comment
Share on other sites

Ascom is an interface to Msoft's com objects. Basically a scripting interface. Check out onstep here http://www.stellarjourney.com/index.php?r=site/equipment_onstep Its a complete mount control system with ASCOM driver. All the source is available so it would be a good place to start if you are going to roll your own. He has an ASCOM driver so you should be able to figure it out reading the code. That should be enough to get you going.

Griz

Link to comment
Share on other sites

And after a bit of an explore, the full set of ASCOM serial commands, proiperly documented are here: http://www.stellarjourney.com/index.php?r=site/software_telescope

Congratulations to Howard Dutton, I find it incredible that an  open source project is so good at making it hard to find its standards!

(I stand to be corrected if anyone associated with Ascom can show me where the commands can be located through the Ascom website).

Link to comment
Share on other sites

Yep its a full course on motor control and ASCOM. I'm fooling around with the Indi stuff. I am an old Unix hack so thats what I'd like to use for all my stuff.  After thinking about it I'm going to do a module for the focus and one for the mount. Use the Trinket Pro's I bought for the keypad and some more of the Bluetooth modules. Put the SciTech board inside with the controller so there won't be any wires except for the servo cables. I picked up a nice enclosure flanged at the bottom so easy to get on the mount. Has a fitted perfboard for all the sensors etc and deep enough to double deck the pcduino. 

After looking into all this I can see generic modules using downloaded firmware for everything instead of a specific set of electronics and handcontroller for each mount. Make it accessible via a smartphone. I've been talking to some others on another forum about this approach. One of the reasons I bought the pcduino is it will run android. And that would be a better OS to use if a phone were to be the target controller.

Probably not going to work on it much the next few weeks. My brother is on his way home from the middle east and we are going to play around with a can bus controller hooked up to his car. Reading the packets looking at doing some custom gauges. I bought a shield for this app. Easier to mess with in the car. Just plugs into a Uno. Has its own sd to log the data and a gps port that I have a gps module for. I thought the GPS would be some fun to get hooked up. I was disappointed. All you do is plug it in and it will get hooked up to the sats and start spewing out NEMA strings.

Being an old R/C guy I'm thinking about building an autonomous tracked bot to play with. Found this company the other day that makes pretty much anything you might need to build robots. All kinds of extrusions and custom machined parts. A one stop shop for mounting stuff. Wheels gears all the stuff I don't like to try and fabricate. I have plenty of terrain to test it out on. Huge field besides my house. But I want to get this done first and get my imaging rig the way I want it.

We are getting pounded by the tropical storm tonight. Not sure I'll be able to make it to Houston tomorrow. Most of the heavy rain is falling right in my path. Areas that are soaked already. Didn't do much on the coast but inland it could really cause some problems the next 48 hours.

The touchscreen has been working now for almost 3 days with out a hitch. I've cut the power to the BT modules a few times to make sure they would hook back up and other than that no disconnects or errors. Its running at 115200 which I could never get to work reliably with the wifi modules. I have a replacement for the one that didn't work coming so I'm going to try and get those working as well. The ones I have are good for 100m so thats plenty for what I need. I'm going to go looking for an enclosure for the touchscreen when I get to Houston. I want to actually see them to pick the one I want. Its going to be much thinner than the old one. If I can find the right case. I want to get one for the analyzer as well. I'm afraid I'm going to short it out leaving it bare. There is a store not far from my brothers that has tons of electronics so I should be able to find what I want there. Played around with darlington transistors today getting the dew heaters going. Not much to those. The pcduino is a 3.3v machine so it needs some more oomph to drive the heaters. I hooked up the analyzer to the dew controller I have to get the voltages to apply to the strips. So it was easy to get it going and I didn't roast any of my heaters. Going to start on the focus control next. I'll use the analyzer to figure out that as well. Right now I have some relays hooked up to the controller box to emulate me pressing the buttons. But soon I'll be doing away with the handpad and going to the Trinket Pro. Its a miniature Uno and the Lipo backpack will be good for the focus motor and the Trinket. It goes through batteries pretty quick so putting 2500mah lipo on it will extend that a bunch plus its rechargable. Pretty much down to writing code and testing now finally.

Griz

Link to comment
Share on other sites

  • 1 month later...

Thanks I'll check those out. Finally finished up the clusters so I'm about to get back on this project for a bit. Where is Staffordshire I can't seem to remember is it close to London? I lived in Reading and on 3 bases when I was a kid. Brize Mildenhall and Lakenheath. My mom's side of the family is from Swindon. Building the clusters has been awesome. Forgot how much fun it is to hack on this stuff. My unix admin skills are soooo rusty but they are coming back fairly quickly. Seems like every day I remember another useful command. Its all changed too. A lot. I used BSD before but the Tegras require Linux to flash and cross compile so I've installed that instead. Pixinsight works better for me on it but I suspect its a badly beat up win 7 install that is causing the colors to be all messed up. I brought in some pics onto the Linux side and it was perfect. As much as I beat on the OS with all my experiments I'm surprised it's worked this long. Silverlight has quit working and no matter what I do it won't reinstall. The registry is probably frogged. But no worries I put in a fresh ssd for win 10 so I suspect once that is installed and I reinstall my image processing stuff all will be well. The final piece of the clusters came in today. An enclosure for the disks. Half of each disk is for the Pi's and half for the Tegras they all mount all disks. Makes it easier to distribute parallel code that way. Although I think I'm going to go with docker. Its virtual containers are really slick. Using that I can keep all the nodes to a minimal install just enough to make docker work and send containers with whatever programs I need to run at the time. It bundles up all the dependencies for you so it all in one package. I put Kstars in one and it works fine. Really simplifies admin. Found a climate modeling program that is parallel. Compiled that tonight and tested it on one node. Works fine. So tomorrow hopefully it will finally be running something in parallel using all the nodes. You can simulate climate on earth mars and some exo planets with it. Should be an excellent test of the system. I'll finally get good feeling for the performance.

160872498.XXdZI3rh.jpg

Griz

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.