Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_terminator_challenge.thumb.jpg.b7f10f594317507d0f40662231b0d9a8.jpg

theropod

New Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

32 Excellent

About theropod

  • Rank
    Nebula

Profile Information

  • Gender
    Male
  • Interests
    Paleontology, meteors, renewable energy
  • Location
    Arkansas, USA
  1. theropod

    Correct control of stepper motors

    Maybe add in encoders so the processor “knows” where the scope is pointing at all times, and write a set of arrays to store these data sets the processor can then use to calculate ramp up-down slewing speeds?
  2. theropod

    Junk Alt Az

    Well, after much consternation I have sifted my code to streamline the processes and implement timing based pulse trains for the stepper motors. This runs so much more smoothly than any previous iteration it isn’t funny. Also, the little device appears to now be able to drive both steppers at the same time. Should anyone build this device and use this code be aware that the delay spectrums set in the mapping variable will need to be tuned to fit. Enjoy, or ignore, at your pleasure since your cost is minimal. ******** /* Written by R. A. Stephenson for prototype Pan/Tilt Alt/Az small telescope or binocular set pointer application. Significant advice, and editorial guidance, supplied by Brian Schmalz (designer of the Easy Driver® bipolar stepper motor driver board). Test equipment: Arduino® Nano, 2 - Easy Driver® bipolar stepper motor driver boards, analog 2 axis joystick and salvage bipolar stepper motors, which are both 1.8 degree per full step, being driven at 1/8 microstepping (Easy Driver default), which equates to 200 full steps multiplied by 8 = 1600 pulses for one complete revolution of the motor left right gearing provided by windshield wiper worm and wheel gears (ratio TBD) up and down gearing provided by paper shredder square cut reduction set (ratio TBD) project origin; July, 2018, this edit, Version 5.1, began Jan. 2019 last modified: Jan. 23, 2019 */ //define Arduino pin assignments // #define step_pinx 2 // Arduino Digital output pin #2 is step signal pin for X axis L/R #define dir_pinx 3 // Arduino Digital output pin #3 is direction control pin for X axis L/R #define x_pin A0 // Arduino analog input from joystick for X axis L/R #define y_pin A1 // Arduino analog input from joystick for Y axis U/D #define step_piny 5 // Arduino Digital output pin #5 is step speed select signal pin for Y axis U/D #define dir_piny 4 // Arduino Digital output pin #4 is direction control pin for Y axis U/D // //declare global variable // int xaxisState = LOW; //state of x axis stepper pulse set to ON int yaxisState = LOW; //state of y axis stepper pulse set to ON // int XStepDelay; int YStepDelay; // // const long xhigh = 180; //interval to pulse X axis at slowest speed, change to fit application const long xlow = 1; //interval to pulse X axis at highest speed, change to fit application // const long yhigh = 180; //interval to pulse Y axis at slowest speed, change to fit application const long ylow = 2; //interval to pulse Y axis at highest speed, change to fit application // // unsigned long previousMillisX = 0; // unsigned long previousMillisY = 0; // // // // void setup() { // delay(1000); //1 second delay to allow easy drivers to power up // pinMode(dir_pinx, OUTPUT); pinMode(step_pinx, OUTPUT); pinMode(dir_piny, OUTPUT); pinMode(step_piny, OUTPUT); digitalWrite(step_pinx, xaxisState) ; //used in state machine switching for the stepper logic final drive (on or off setting) digitalWrite(step_piny, yaxisState) ; //used in state machine switching for the stepper logic final drive (on or off setting) // } // void loop() { // unsigned long currentMillisX = millis(); // unsigned long currentMillisY = millis(); // // // int xValue = analogRead(A0); // x axis variable for joystick inputs controlling r/l PIN DEPENDENT! int yValue = analogRead(A1); // y axis variable for joystick inputs controlling u/d PIN DEPENDENT! // // if (xValue > 520) { //if joystick moved RIGHT out of "null zone" to limit jitter digitalWrite(dir_pinx, HIGH); // motor direction signal sent to Easy Driver X axis DIR pin (ON) XStepDelay = map(xValue, 520, 1023, xhigh, xlow); } else if (xValue < 480) { //if joystick moved LEFT out of null zone to limit jitter digitalWrite(dir_pinx, LOW); // motor direction signal sent to Easy Driver X axis DIR pin (OFF) XStepDelay = map(xValue, 0, 480, xlow, xhigh); } else if (yValue > 520) { // if joystick moved DOWN out of null zone to limit jitter digitalWrite(dir_piny, HIGH); //motor direction signal to Y axis Easy Driver DIR pin (ON) YStepDelay = map(yValue, 520, 1023, yhigh, ylow); // } else if (yValue < 480) { //if joystick moved UP out of null zone to limit jitter digitalWrite(dir_piny, LOW); //motor direction signal to Y axis Easy Driver DIR pin (OFF) YStepDelay = map(yValue, 0, 480, ylow, yhigh); // } else { digitalWrite(dir_piny, LOW); //motor direction signal to Y axis Easy Driver DIR pin (OFF) digitalWrite(dir_pinx, LOW); // motor direction signal sent to Easy Driver X axis DIR pin (OFF) // Setting LOW saves a bit of power //could include signal to set Easy Driver(s) in "sleep" mode for geared drivetrains } //_____________ // If X axis (L/R) (Azimuth) motor needs to take a step, give it a step for the correct length of time, //when that time has expired end the pulse signal if ((xValue >= 520 || xValue <= 480) && ((unsigned long)(currentMillisX - previousMillisX) >= XStepDelay)) { //if the joystick X axis values goes outside the null zone calculate //how long it's been against those joystick values and control step pulse length xaxisState = !xaxisState; // logic switch between states of step pulse pin on/off digitalWrite (step_pinx, xaxisState); //control signal for step pin //if the motor pulse is off, turn it on, and if the pulse is on, turn it off previousMillisX = currentMillisX; //save the last x channel/axis pulse time on or off } else if (xValue <= 520 || xValue >= 480){ //if the joystick input isn't out of the null zone digitalWrite(step_pinx, LOW); //turn off the step pulse } //________________ // If Y axis (U/D) (Altitude) motor needs to take a step, give it a step over the correct length of time, //after that time has expired end the pulse signal if ((yValue >= 520 || yValue <= 480) && ((unsigned long)(currentMillisY - previousMillisY) >= YStepDelay)){ //if the joystick Y axis values goes outside the null zone calculate //how long it's been against those joystick values and control step pulse length yaxisState = !yaxisState; // logic switch between states of step pulse pin on/off digitalWrite (step_piny, yaxisState); //control signal for step pin //if the motor pulse is off, turn it on, and if the pulse is on, turn it off previousMillisY = currentMillisY; //save the last y channel/axis pulse time } else if (yValue <= 520 || yValue >= 480){ //if the joystick input isn't out of the null zone digitalWrite(step_piny, LOW); //turn off the step pulse // //restart loop } }
  3. theropod

    Junk Alt Az

    Update: Sketch improvements: After messing around with the Arduino code, and applying a few things I’ve figured out I came up with the following. The previous code acted like four binary swithches instead a joystick where motor speed increases with more exteeme joystick input. This version allows for breaking down the values of the delay statements based on variables instead of analogRead statements over and over. My next goal is to replace the delay statements with millis() timing to further smooth out input. ++++++ //Written by R. A. Stephenson for a prototype Pan/Tilt Alt/Az pointer application //Significant advice, and editorial guidance, supplied by Brian Schmalz //(designer of the Easy Driver® bipolar stepper motor driver board) // //Arduino Nano, Easy Driver X2, analog 2 axis joystick and salvage bipolar stepper motors //left /right gearing provided by windshield wiper worm and wheel gears //up / down gearing provided by paper shredder square cut reduction set //project origin; July, 2018, this edit, Version 3.0, began Jan. 2019 // //define which Arduino pins do what #define step_pinx 2 // Digital output pin #2 is step signal pin for X axis L/R #define dir_pinx 3 // Digital output pin #3 is direction control pin for X axis L/R #define x_pin A0 // analog input from joystick for X axis L/R #define y_pin A1 // analog input from joystick for Y axis U/D //#define joy_switch 6 // joystick switch INPUT PULLUP (not used in this version) #define step_piny 5 // Digital output pin #5 is step speed select signal pin for Y axis U/D #define dir_piny 4 // Digital output pin #4 is direction control pin for Y axis U/D // //declare global variables // int min_x_axisStepDly = 1; // Trail and error, or precise math, int XMIN = min_x_axisStepDly; // int max_x_axisStepdly = 8; //used to set pulse duration baseline... int XMAX = max_x_axisStepdly; int min_y_axisStepDly = 1; //These numbers will have to be adjusted for... int YMIN = min_y_axisStepDly; // int max_y_axisStepDly = 8; //each individual motor/gearing arrangement... int YMAX = max_y_axisStepDly; // void setup() { // delay(1000); // 1 second delay to allow easy drivers to power up // //pinMode(joy_switch, INPUT_PULLUP); //protects Nano (not used in this version) // pinMode(dir_pinx, OUTPUT); pinMode(step_pinx, OUTPUT); pinMode(dir_piny, OUTPUT); pinMode(step_piny, OUTPUT); } void loop() { int xValue = analogRead(A0); // x axis variable for joystick inputs r/l int yValue = analogRead(A1); // y axis variable for joystick inputs u/d // if (xValue > 520) { //if joystick moved RIGHT //out of null zone to limit jitter digitalWrite(dir_pinx, HIGH); // motor direction signal sent to Easy Driver X axis DIR pin (ON) XMIN = map(xValue, 520, 1023, 20, 2); digitalWrite(step_pinx, HIGH); //send step signal to Easy Driver X axis STEP pin (ON) delay(XMIN); // delay set by joystick mapped value digitalWrite(step_pinx, LOW); //end step signal X axis Easy Driver STEP pin (OFF) delay(XMIN); // set above } else if (xValue < 480) { //if joystick moved LEFT //out of null zone to limit jitter digitalWrite(dir_pinx, LOW); // motor direction signal sent to Easy Driver X axis DIR pin (OFF) XMAX = map(xValue, 0, 480, 2, 20); digitalWrite(step_pinx, HIGH); //send step signal to Easy Driver X axis STEP pin (ON) delay(XMAX); // delay set by joystick mapped value digitalWrite(step_pinx, LOW); //end step signal X axis Easy Driver STEP pin (OFF) delay(XMAX); // set above by } else if (yValue > 520) { // if joystick moved DOWN //out of null zone to limit jitter digitalWrite(dir_piny, HIGH); //motor direction signal to Y axis Easy Driver DIR pin (ON) YMAX = map(yValue, 520, 1023, 20, 1); // digitalWrite(step_piny, HIGH); //send step signal Y axis Easy Driver STEP pin (ON) delay(YMAX); // delay set by joystick mapped value digitalWrite(step_piny, LOW); //end step signal X axis Easy Driver STEP pin (OFF) delay(YMAX); // set above } // else if (yValue < 480) { //if joystick moved UP //out of null zone to limit jitter digitalWrite(dir_piny, LOW); //motor direction signal to Y axis Easy Driver DIR pin (OFF) YMIN = map(yValue, 0, 480, 1, 20); // digitalWrite(step_piny, HIGH); delay(YMIN); // delay set by joystick mapped value digitalWrite(step_piny, LOW); //end step signal X axis Easy Driver STEP pin (OFF) delay(YMIN); // set above } else { digitalWrite(dir_piny, LOW); //motor direction signal to Y axis Easy Driver DIR pin (OFF) digitalWrite(dir_pinx, LOW); // motor direction signal sent to Easy Driver X axis DIR pin (OFF) // Setting LOW saves a bit of power //could include signal to set Easy Driver(s) in "sleep" mode for geared drivetrains //use "for" loop to check for joystick input/change every second? } }
  4. theropod

    My low-cost DIY RA drive for EQ5 mount

    I think you should look into using “unsigned long millis” to control/eliminate your sktech halting delay statements. I am currently rewriting my code for the DIY alt/az I built employing not only this feature but also employing proportional motor speed based on joystick mapping. Since I am not a C expert by any means this is a steep learning curve for me, but the Arduino is capable of great precision if the code is written tightly. Even you simply change your current delay statements to delayMicroseconds you can achieve far greater timing control. Yeah, the same desire to mess with things is part of my makeup too.
  5. theropod

    Junk Alt Az

    After testing my code I found a few bugs and have simplified the flow under which the Arduino and drivers work. Below the dashed line is my latest effort. I have included the Accel Library but have not fully implemented them. Much work remains, such as driving the steppers proportionally to joystick movement, but this code drives my motors very well using the 3 options of the joystick switch. ————- // sketch for driving DIY alt-az // ADAPTED BY R. A. Stephenson for hardware specific application //Arduino Nano, Easy Driver X2, salvage bipolar stepper motors // July, 2018 #include <AccelStepper.h> // create instances from Accel Library AccelStepper stepper1(AccelStepper::FULL2WIRE, 2,3); AccelStepper stepper2(AccelStepper::FULL2WIRE, 4,5); //end Aceel Library define steppers // define which Arduino pins do what #define step_pinx 2 // D2 is step signal pin for X axis L/R #define dir_pinx 3 // D3 is direction control pin for X axis L/R #define x_pin A0 // analog input from joystick for X axis L/R #define y_pin A1 // analog input from joystick for Y axis U/D #define joy_switch 6 // joystick switch INPUT PULLUP #define step_piny 5 // D5 is step signal pin for Y axis U/D #define dir_piny 4 // D4 is direction control pin for Y axis U/D int step_speed = 3; // stepper speed higher is slower void setup() { delay(1000); // 1 second delay to allow easy drivers to power up pinMode(joy_switch, INPUT_PULLUP); pinMode(dir_pinx, OUTPUT); pinMode(step_pinx, OUTPUT); pinMode(dir_piny, OUTPUT); pinMode(step_piny, OUTPUT); } void loop() { // Accel not implemented this code if (!digitalRead(joy_switch)){ // if joystick switch is clicked delay(400); // debounce delay switch(step_speed) { // check speed value and change case 1: step_speed=3; // slow break; case 2: step_speed=.1; // fast speed break; case 3: step_speed=1; // medium speed break; } } if(analogRead(x_pin)>712){ //if joystick moved right digitalWrite(dir_pinx, LOW); // move motor right digitalWrite(step_pinx, HIGH); //send step signal X axis delay(step_speed); // delay set by joystick switch case above digitalWrite(step_pinx, LOW); // stop step signal X axis delay(step_speed); // set above //ENDJOYREAD/DRIVE RIGHT } if(analogRead(x_pin)<312){ //if joystick moved left digitalWrite(dir_pinx, HIGH); // move motor left digitalWrite(step_pinx, HIGH); //send step signal X axis delay(step_speed); // delay set by joystick switch case above digitalWrite(step_pinx, LOW); // stop step signal X axis delay(step_speed); // set above //ENDJOYREAD/DRIVE LEFT } if(analogRead(y_pin)>712){ //if joystick moved UP digitalWrite(dir_piny, HIGH); // move motor UP digitalWrite(step_piny, HIGH); //send step signal Y axis delay(step_speed); // delay set by joystick switch case above digitalWrite(step_piny, LOW); // stop step signal Y axis delay(step_speed); // set above //ENDJOYREAD/DRIVE UP } if(analogRead(y_pin)<312){ //if joystick moved DOWN digitalWrite(dir_piny, LOW); // move motor DOWN digitalWrite(step_piny, HIGH); //send step signal Y axis delay(step_speed); // delay set by joystick switch case above digitalWrite(step_piny, LOW); // stop step signal Y axis delay(step_speed); // set above //ENDJOYREAD/DRIVE DOWN } }
  6. theropod

    Junk Alt Az

    I just finished writing the first draft of the Arduino code. This works pretty well with small bipolar test motors (not the ones mounted to my rig). Instead of driving the Motor Speed inputs on the Easy Drivers I used “case” and “break” instances using the joystick switch, which work like a charm. I may just write in more instances with greater differences. This is a combination of sketches from several sources, and the only real originality is my pin assignments. I don’t think I need to use the accel libray as both motors can be driven simultaneously. Below is my quick and dirty code. Feel free to copy and use as you like. I claim no ownership. Edit to add: I left the LED indicator in the setup, but doubt I ever use it, and has no bearing on functionality. It is not included/used in the void loop.
  7. theropod

    Junk Alt Az

    If this method proves to be wobbly in use I am going to find a sloid hunk of aluminum to act as a spacer between the scope and plate. A one inch by two inch by one inch piece should suffice. I could then eliminate the two upper nuts. I doubt this will be needed with this light scope.
  8. theropod

    Junk Alt Az

    The C90 has 2 - 1/4” X 20 threaded holes in the dovetail bar. I threaded two chunks of all thread into those. On my mount the cross bar from the shredder is an 11mm diameter hex rod. I drilled two holes through the bar and mounted a small 1/4” plate, and countersunk the screw heads for a flat surface on this plate. I drilled two 5/16” holes in that plate to accommodate the 1/4” all thread rods, which are about 1.25” long. One is slightly longer, but I don’t think that part is critical. These slightly oversized holes allow for my lack of accuracy in placing the holes perfectly. I don’t own a drill press. I spun a nut onto the all thread rods on the scope side equidistant away from the scope dovetail/base. On the under side of the plate I put split ring lock washers and two more nuts to secure the scope to this plate. Very solid! Attached is a closeup of my solution.
  9. theropod

    Junk Alt Az

    I may add those features, but right now I just want the junkpile to turn and tilt on command. I have been suffering the vulgarity of trying to use a ball head to point the scope, and this has been a study in massive frustration. My ball head is an iOptron I bought via eBay that was apparently a factory reject as it doesn’t want to lock into position no matter how tight I screw down the clamps. The seller wouldn’t honor a return for defect and eBay awarded a full refund. It holds my phone for meteor hunting, but creeps with the scope attached. I have been fighting this a year, and this is my low budget solution. I wasn’t aware of the fair superior solutions to my quest of astronomy when i started out doing this stuff, and have suffered many a long dark hour in a half crazy angry half freaked out state trying to figure out what I was doing wrong. Buying a ball head and expecting it to fit my needs was the result, and getting a defective unit didn’t help. Being retired and on a fixed income has forced me to find a solution. I know some work remains but as I said I think the hard part is behind me. When I get it working as planned, and mounted to my barn door I will have a 3 axis eq. Goto would be great, but I am mainly going to be working solar system objects with this setup. I will post the finished code after testing. I am still very interested in the iOptron CEM25P or Celestron AVX mount and a deep sky scope, but that will require some piggy bank planning. My whole point with this project was to prove to myself that my McGyver skills are not dead. Maybe I can inspire others similarly financially challenged. Lol
  10. theropod

    Junk Alt Az

    Here is some serious DIY stuff on a shoestring buget! This is a semi automated altaz I built from junk, literally. The eat/west axis drive is based on the worm gear set from an 80’s Ford pickup windshield wiper motor that had a locked up motor. I chopped off the motor part with my angle grinder, fit a 3/8” socket to the remaining 11mm shaft with JB Weld and ground a pre-mounted timing belt pulley on a small bipolar stepper motor to loosely fit the drive end of the socket. That is mounted to some diamond plate aluminum. The up/down segment is the guts from an old dead paper shredder. The original motor had burned out, but the mounting bracket fit the bolt pattern to another bipolar stepper I had. To couple the worm gear shaft, I again chopped the motor off and cut the remaing worm gear shaft to length, and then coupled that to the stepper shaft. I used some fairly rigid rubber fuel hose slightly smaller than the stepper shaft, which was slightly smaller than the worm gear shaft. I can detect no slipping with my C90 mounted so it seems to work. If I do get slipping a small hose clamp will be employed. I bought two high quality bearings locally for $15 to cradle the cross bar that actuates the final drive, and JB Welded those to the scrap aluminum plate left over from a barn door tracker I built last summer. I am going to use the Arduino Nano to send signals to two Easy Driver bipolar stepper motors for the two axis of movement. I bought two of those analog joysticks via eBay for $6. I have yet to write the code, but with web references I have a pretty good grip on that issue. I bought the Nano and Easy Driver clones from eBay for under $5 each, and got 6 each for WHEN I blow some up. I plan on using old phone coiled cable from the screw terminals, which are salvaged from an obsolete multi-line phone, to the steppers. This should give me plenty of slack and still carry the signals. A small plastic box will house the drive electronics. I have plans to switch the setup off when not actively pointing to both save power and keep the drivers/motors from building heat. As you can see the steppers and gear train hold my scope in position without power. This was actually the test undertaken for the photo. I plan on using the joystick switch to shift the Easy Drivers from full stepping down to 1/8 stepping, and hope to be able to slew quickly and then accurately center my target(s) with very fine movements. The windshield wiper gear ratio seems to be 58.6 to 1, while the paper shredder seems to be 45 to 1. I plan on powering the setup with a sealed lead/acid 12 volt battery I currently use to drive my barn door tracker. Eventually I plan on mounting this to the barn door (separate Ardunio Nano and Easy Driver) and use the battery for both. Besides writing and testing the code I still need to disassemble the gear drives, clean them well and lube them well with a synthetic grease. I may build a cover for the paper shredder gear train, but that isn’t high on the list. I am jazzed to get this finalized and working, and I am pretty confident the hard part is behind me.
  11. From dusk until about 2 am the skies in north Arkansas, USA were nearly perfect, and the meteors were frequent. I managed to capture a dozen with my iPhone using both my barn door tracker and my iOptron SkyTracker Pro for long exposure shots. One 10 minute frame on the iOptron gave me 5 individual meteors. The radiant was clearly defined! The things that stand out about the Geminids is how much slower they are than the Perseids, and the brilliance. The Perseids seem to have a golden hue whereas the Geminids seem far more white. For a meteor chaser last night was awesome even if the prime hours were wasted with clouds. I must have seen 200 meteors and some fantastic fireballs. One particular beauty to the south dove almost to the horizon and finished with a brilliant blue flash.
  12. theropod

    Fed up

    Don't get too depressed about it. My thing is meteors, and this August during the Perseids it was cloudy for 13 days straight. This is so not typical for Arkansas, USA it isn't funny. I didn't capture a single one. This Saturday is the peak of the Orinids, and it is going to be cloudy again. Maybe I will just move to the Atacama desert and enjoy clear skies every night, or just accept it is what it is.
  13. It seems this time of year is a limited when it comes to meteors. Our Perseid event was ruined by 12 days and nights of clouds and rain, and for those of us that chase these streaks in the sky it was depressing. Being too stubborn to accept that the best occurrence of the year slipped by I have kept at it. This past Friday night there was a marked uptick in activity with at least 8 per hour. This was more action than I witnessed in the proceeding 2 weeks combined! Naturally most of these were out of the frame of my iPhone camera, but attached is a bright if brief one I did manage to capture. I grabbed three others, but were mere elongated sparks by comparison to this. One I didn't get was a bright red fireball that entered from the west and covered over half the sky, and broke into two pieces before turning to ash. This image is a 20 minute tracked exposures using my iOptron SkyTracker Pro, iPhone 6 plus, NightCap low light app, ISO 1,000, white balance ~3,000 with apature setting of 1/2 (f2.2). The bright star to the left is Altair and the bright star on the top right is Vega. Eastern Stone county, Arkansas, USA approximately 11:00 pm CST.
  14. theropod

    Dew Shield for C90 MAK

    Not really. I just held the pipe over our gas cooking stove and gradually warmed it until well soft and it just slipped on. I did use the "swelled" end where another pipe is supposed to fit, and wobbled the warmed pipe as it cooled so it didn't "mate" with the scope permanently. After it cooled in place I took it off the scope and cut 4 short slits down the swelled portion about 1" long so it doesn't require much force to install or remove, but there remains plenty of clamping action so as to be quite sturdy. I still need to paint it flat black, but it works very well.
×

Important Information

By using this site, you agree to our Terms of Use.