Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Gina's Observatory Roll-Off-Roof Automation


Gina

Recommended Posts

On closing the roof after last night's imaging run one of the chain joining links came undone a bit and jammed in the large pulley housing.  Unjammed it with brute force (because I needed the roof closed).  Just ordered a couple of links (one replacement and one spare).  I think I shall have to design and print a new large pulley wheel cover with more clearance.

Link to comment
Share on other sites

Took the observatory apart again - well, some of it and took out large pulley with fixing bolt and cover.  Now have it indoors ready to design and print a new cover.  Stuffed a lump of polystyrene packaging in the gap the keep the rain out until I get the new parts installed.

Link to comment
Share on other sites

The motor control system is pretty much complete so the firmware is next.  The Arduino sketch is simple - just a loop watching for the various data input conditions.  The RPi firmware will be a modified Astroberry Board INDI driver.  The GUI panel shown in Ekos will have 3 buttons for Open, Close and Stop.  Lights associated with the Open and Close buttons will indicate the progress of the movement - off, moving, finished and fault represented by colours - grey, yellow, green and red.  The Stop button light would normally be grey (off) and green for Stopped.

Link to comment
Share on other sites

These are the Arduino inputs :-

  1. OPEN - Push button
  2. CLOSE - Push button
  3. STOP - Push button
  4. Rain Sensor (relay)
  5. OPEN limit switch
  6. CLOSED limit switch
  7. RPi Open
  8. RPi Close
  9. RPi Stop
  10. Motor current

I think I should include a timer too, to turn off the motor if the appropriate limit switch is not activated in a reasonable time.  This would also signal a Fault to the RPi, same as the motor drawing too much current.  The cause could be a broken drive chain or connection.

Edited by Gina
Link to comment
Share on other sites

Printing the new large pulley cover.   Here are screenshots of the CAD model and the arrangement for printing in Slic3r.  The Cad model shows the true orientation in use.

423177707_Screenshotfrom2019-09-2621-50-07.png.d3581670160eb753d5beffc17fcc9238.png

364144876_Screenshotfrom2019-09-2621-51-32.png.adc2df96498d88c52c9a85bef1ccd86e.png

Link to comment
Share on other sites

Eventually printed the back after tweaking my printer but found I'd printed the front wrongly - used mirror instead of rotate 180° so came out back-to-front - DOH!!

  • Sad 1
Link to comment
Share on other sites

Tried all sorts to get white PLA to print properly but no joy.  Changed to blue and printing fine!!  Go figure.  3D printers are as much black magic as computers!!

Edited by Gina
Link to comment
Share on other sites

12 hours ago, Gina said:

Tried all sorts to get white PLA to print properly but no joy.  Changed to blue and printing fine!!  Go figure.  3D printers are as much black magic as computers!!

I think you mean blue magic. :wink2:

  • Haha 1
Link to comment
Share on other sites

The print of the front in blue PLA came out fine - virtually perfect.  A gap in the rain enabled me to get out to the observatory and try the new cover parts.  They fit perfectly :hello2:

Link to comment
Share on other sites

Another fine spell has enabled me to connect the drive chain parts with a new link, thread it through the gap between large pulley and casing, through the motor unit, round the small pulley and hook up onto the spring and tension adjuster.  Then tighten the tensioner eyebolt.  Chain drive now ready for using the motor - chain runs very smoothly.  So next job is the programming then I can install all the parts in the box and attach it to the wall.

Link to comment
Share on other sites

Here are screenshots of the CAD models of the back and front of the large pulley cover.  About half the cover is outside the observatory when the roof is closed.  The photo shows the old green cover - I have yet to photo the new one.

925947212_Screenshotfrom2019-09-2917-39-31.png.d7fdd3595e3fcc0aeb0afc20ac1401ac.png881588836_Screenshotfrom2019-09-2917-42-03.png.07ed8880dbce9e30b52d89444ca53d1f.png

757484253_ChainSpringAttachment03.JPG.9b7f5852781a90d77e27dd054db6bf09.JPG

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Here is a first go at the Arduino sketch.  There are a few refinements to add but I think this is the bulk of it.  I want to add a timeout to turn the power off if the roof takes too long to open or close.   I think the main loop should take only milliseconds in which case I could add in a delay of 0.1 secs and then count in tenths of a second which would be quite adequate for checking timeout.

I've kept the code modular for clarity and ease of diagnosis if it doesn't work as expected.

// Filename :- ROR_Control_2019-11-20
//
bool roofOpen = false; 
bool roofOpening = false; 
bool roofClosing = false;
bool timerRunning = false;
//
int Threshold = 400;     // 2v analog to digital threshold - 1023 = 5v
int currentLimit = 115;  // Motor current sense output gives 140mv per Amp  4A = 140x1024x4/5000 = 115 (100 corresponds to 3.5A)
int timoutCount = 180;   //  Timout in seconds - amount of time alloweed to open or close roof

int pbClosePin = 3;  // Close Push Button
int pbStopPin = 4;   // Stop Push Button
int pbOpenPin = 5;   // Open Push Button
int detRainPin = 6;  // Rain detector
//
int MotorInAPin = 7;  // Motor In A
int MotorInBPin = 8;  // Motor In B
//
int MotorCSPin = A2;  // Motor Current Sense
//
int rpiClosePin = A3; // Remote Close
int rpiStopPin = A4;  // Remote Stop
int rpiOpenPin = A5;  // Remote Open
//
int limClosedPin = A6; // Closed Limit Switch
int limOpenPin = A7;   // Open Limit Switch
//
int rpiFaultPin = 13;  // Remote Fault Sense
//
//
void setup() {
  pinMode(pbClosePin,INPUT_PULLUP);   //  Close Push Button
  pinMode(pbStopPin,INPUT_PULLUP);    //  Stop Push Button
  pinMode(pbOpenPin,INPUT_PULLUP);    //  Open Push Button
  pinMode(detRainPin,INPUT_PULLUP);   //  Rain detector
//  
  pinMode(MotorInAPin, OUTPUT);
  pinMode(MotorInBPin, OUTPUT);
  pinMode(rpiFaultPin, OUTPUT);
 }
//
//
void OpenRoof() {
  MotorInAPin = HIGH;
  
  }
//
void CloseRoof() {
  MotorInBPin = HIGH;
  }
//  
void StopMotor() {
  MotorInAPin = LOW;
  MotorInBPin = LOW;

  }
//
void LimitReached() {
  StopMotor;
  }
//
void MotorStalled() {
  StopMotor;
  rpiFaultPin = HIGH;
  }
//
//
// Test all buttons, inputs and rain detector for change
//
void loop(){
  if (digitalRead(pbOpenPin) == LOW) { OpenRoof; };
  if (digitalRead(pbClosePin) == LOW) { CloseRoof; };
  if (digitalRead(pbStopPin) == LOW) { StopMotor; };
  if (digitalRead(detRainPin) == LOW) { CloseRoof; };
//  
  if ((analogRead(rpiOpenPin) > Threshold)) { OpenRoof; };
  if ((analogRead(rpiClosePin) > Threshold)) { CloseRoof; };
  if ((analogRead(rpiStopPin) > Threshold)) { StopMotor; };
//
  if ((analogRead(limClosedPin) > Threshold)) { LimitReached; };
  if ((analogRead(limOpenPin) > Threshold)) { LimitReached; };
  
//
  if ((analogRead(MotorCSPin) > currentLimit)) { MotorStalled; };
}
// End
Edited by Gina
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.