Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

brown_rb

Members
  • Posts

    117
  • Joined

  • Last visited

Posts posted by brown_rb

  1. I guess the sawtooth lines represent a resistor.

    There are 4 resistors, 3 at 1.2K ohms and 1 at 1MegOhm

    There are 2 switches (probably has 3 pins, one pin in the center - if there are only 2 pins this is fine) .

    Take the first 1.2k resistor and we will call it R11. Wire one end to the resistor to 5V on the arduino.

    Take the next 1.2k resistor and we will call it R12. Wire one end of the resistor to GND on the arduino.

    Take the next 1.2k resistor and we will call it R13. Wire one end to the spare end of R11. We will call this join R11/R13.

    Take the spare end of R13 and wire it to the spare end of R12. We will call this join R13/R12.

    Solder a wire from the Join R11/R13 to the center pin of switch1 (if switch1 only has 2 pins wire the Join R11/R13 to any pin of Switch1).

    Solder a wire from the Join R13/R12 to the center pin of switch2 (if switch2 only has 2 pins wire the Join R11/R13 to any pin of Switch2).

    Solder the remaining free pin on Switch1 to the remaining free pin on Switch2. We will call this join S1/S2. Take one end of the next resistor 1M-Ohm which we will call R10 and wire one end to this join S1/S2.

    Take the spare end of the R10 resistor and solder it to the GND on the Arduino.

    Solder one end a wire to the Join S1/S2 and the other end of the same wire to A0 (Analog Pin 0) of the Arduino.

     

     

    PushButtons_schem_label.jpg

    PushButtons_schem_label.jpg

  2. 4 hours ago, michaelmorris said:

    Thanks Rob

    I get parts of the diagram, but other bits are a bit of mystery to me.

    There are 3 x 1.2Kohm resistors and a 1Mohm resistor in the circuit and one end of the circuitis  attached to the 0 (Marked RXC) terminal on the Arduino. Is this correct? 

    Do the other ends of the circuit attach to the 5v and one of the GND terminals on the Power section of the Arduino?

    Also, what is the triangle of three lines of diminishing size symbolise?

    Sorry for the numpty questions, but I'm more or less a complete newbie at his.

     

  3. 10 hours ago, calli said:

    I personally would stay away from WLAN. It may work for your place with Routers etc. But as soon as you need to span a network "in the wild" it gets complicated. BT made for point 2 point connections works much more reliable in such environment.

    My 2 cents

    Carsten

    As someone who has done both Bluetooth and Wifi (ESP8266) implementations for a focuser, I think that I have some experience both theoretical and actual to be able to comment.

    Whilst BT may be working at slow speeds or even up to around 57600, the short distances involved with BT are critical, as are bandwidth (other nearby Wifi-BT devices operating nearby). BT is not, by nature, an error free protocol. and error-recovery is limited. BT-4 is not yet widely available which can extend the range to 200m but is expensive and has a much higher overhead. BT is more suited to larger data exchanges rather than the very short messages (packets) that are sent and received by a focuser and its control application (read ascom driver or windows app)

    So hows does Wifi using an ESP8266 stack up against BT. Using TCP/IP as the underlying protocol means error free guarenteed transmission. Retries are automatic, all send data is acknowledge or resent. Range is well, limited by Wifi, but by some smart programming and use of something like DuckDNS you can control the focuser from the other side of the world. What about delays. Yes, if local operated, short, if long distance (through a number of routers) they can increase, but no that much that it becomes detrimental. After all focusers do not operate at blistering speeds and the real factor here is what sort of timeout delay is implemented in the focuser software before it times out or thinks the focuser is not connected.

    I have tested BOTH BT (since Jul 2015) and Wifi (since Feb 2016) options for focuser projects and think there is a place for both. I prefer to use Wifi now due to its error free guarented delivery and can use much higher serial speeds if required than BT which starts to decay once the speed is increased or the local wireless neighourhood bandwidth is becoming saturated (lI have around 19 local wifis in the neighbouthood as reported by Advanced IP Scanner).

    BT can be implemented cheaply if the computer already supports BT. For about $5 and some code time.

    Wifi around $10, and use the local network interface of the computer (does not have to be wifi if the focuser wifi controller is programmed to connect to a network at the focuser end). And if done right, another bonus - OTA (over the air) firmware updating....... error-free

     

    Cheers

    Robert

    • Like 4
  4. I did think about the alignment issue, and yes a flexible coupler would have been best but they don't appear to be available in the correct size as well as being quite large from what I've seen. As for the stress load from inertia, on a 10:1, IMHO I really don't think it will be much of an issue. I stand to be corrected of course. :-)

    I will let you know how they work out when they arrive.

    There is a misconception that driving via the 10 speed reduction is safe. This is not such a good idea, as the mechanics and manufacture of the mechanisms employed mean that they are not robust enough to have that level of force (from stepper motors) consistently applied to them - over time this results in increased wear and tear with more backlash, or if the focuser limits are exceeded, the complete breakdown of the fine focus mechansism - in other words, not a good idea. If you need to drive the fine focus mechanism (FFM) then it would be better using a belt drive to prevent damage in the event of exceeding the focuser limits. 

    Regards

  5. If anyone else is looking to do a direct drive connection to a 10:1 crayford these look perfect.

    http://www.electromorph.co.uk/Pages/Metric-Shaft-Couplers.aspx?lu=m&ld=2.5&ru=m&rd=5

    You should really use flexible couplers - search ebay for "flexible coupler", as these reduce the stress load caused by any inertia jumps of the stepper and misalignment of the two shafts, as well as reduce vibration.

    http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xflexible+coupler&_nkw=flexible+coupler&_sacat=0

  6. It means that once the eeprom limit is reached, the eeprom will not be able to store the data correctly, this may result in incorrect readings of focuser position on power up. Its more than likely once the limit approaches that some bits within the storage location fail first, so that storing something like a position of 1024 might then be read back as 513. In other words, unreliable. What effect this might have on the focuser operation is best answered by the author.

    There are many ways to overcome this issue. For example, only write to eeprom after a move operation, and after a time delayed (so that it is not triggered by autofocusing), and to cycle locations within the eeprom. These approaches I have taken in my own code, such that if one imaged every night of the year, yes, every night of the year, it would take over 9 continous years for the eeprom to reach the limit.  

    Cheers

    Robert

    • Like 1
  7. Actually, the Nano which uses the FTDI chip suffers this issue.

    If you use the Nano powered by the CH340 chip, then there is no issue with the serial port and that Nano can be driven either using Vin or USB power.

    The CH340 drivers are readilly available for Win/Mac/Linux

    Cheers

    Robert

    • Like 4
  8. Suggest the following code snippets for the eeprom

    #include <EEPROM.h>                   // needed for EEPROM
    #include "eepromanything.h"           // needed for EEPROM
    // #define EEPROMSIZE 500              // ATMEGA168 512 EEPROM
    #define EEPROMSIZE 1000               // ATMEGA328P 1024 EEPROM
    // these are stored in EEPROM - all variables in a structure
    struct config_t {
      int validdata;       // if this is 99 then data is valid
      int fposition;       // last focuser position
      int maxstep;         // max steps
    } myfocuser;
    int datasize;      // will hold size of the struct myfocuser - 6 bytes
    int nlocations;    // number of storage locations available in EEPROM
    int currentaddr;   // will be address in eeprom of the data stored
    bool writenow;     // should we update values in eeprom
    bool found;        // did we find any stored values?
    long previousMillis = 0;   // used as a delay whenever the EEPROM settings need to be updated
    long interval = 10000;     // interval in milliseconds to wait after a move before writing settings to EEPROM, 10s
    long numwrites = 0;        // number of eeprom writes this session
    // Default initial positions if not set/overriden by Ascom Driver or Winapp
    int currentPosition = 5000;   // current position
    int targetPosition = 5000;    // target position
    int maxFocuserLimit = 32000;  // arbitary focuser limit
    int maxSteps = 10000;         // maximum position of focuser
    int maxIncrement = 1000;      // maximum number of steps permitted in one move
    int minimumPosition = 0;      // minimum position to avoid focuser damage
    boolean isMoving = false;        // is the motor currently moving
    // Setup
    void setup() {
      // initialize serial for ASCOM
      ...............
      found = false;
      writenow = false;
      datasize = sizeof( myfocuser );    // should be 6
      nlocations = EEPROMSIZE / datasize;  // for AT328P = 1000 / 6 = 166 locations
      numwrites = 0;
      
      for (int lp1 = 0; lp1 < nlocations; lp1++ ) {
        int addr = lp1 * datasize;
        EEPROM_readAnything( addr, myfocuser );
        // check to see if the data is valid
        if ( myfocuser.validdata == 99 ) {
          // data was erased so write some default values
          currentaddr = addr;
          found = true;
        }
      }
      if ( found == true ) {
        // set the focuser back to the previous settings
        // done after this in one hit
        // mark current eeprom address as invalid and use next one
        // each time focuser starts it will read current storage, set it to invalid, goto next location and
        // write values to there and set it to valid - so it doesnt always try to use same locations over and
        // over and destroy the eeprom
        // using it like an array of [0-nlocations], ie 100 storage locations for 1k EEPROM
        EEPROM_readAnything( currentaddr, myfocuser );
        myfocuser.validdata = 0;
        EEPROM_writeAnything(currentaddr, myfocuser);    // update values in EEPROM
        numwrites++;
        
        // goto next free address and write data
        currentaddr += datasize;
        // bound check the eeprom storage and if greater than last index [0-EEPROMSIZE-1] then set to 0
        if ( currentaddr >= (nlocations * datasize) ) currentaddr = 0;
        myfocuser.validdata = 99;
        EEPROM_writeAnything(currentaddr, myfocuser);    // update values in EEPROM
        numwrites++;
      }
      else {
        // set defaults because not found
        myfocuser.validdata = 99;
        myfocuser.maxstep = 10000;
        myfocuser.fposition = 5000;
        // now write the data to EEPROM
        EEPROM_writeAnything(currentaddr, myfocuser);    // update values in EEPROM
        numwrites++;
      }
      // Set focuser defaults from saved values in EEPROM.
      currentPosition = myfocuser.fposition;
      targetPosition = myfocuser.fposition;
      maxSteps = myfocuser.maxstep;
      .......
    }
    // Main Loop
    void loop() {
      // Move the position by a single step if target is different to current position
      if (targetPosition != currentPosition) {
        isMoving = true;
        writenow = true;             // updating of EEPROM ON
        previousMillis = millis();    // keep updating previousMillis whilst focuser is moving
      } 
      else {
        // focuser is NOT moving now, move is completed
        isMoving = false;
        if ( writenow == true ) {    // time to update eeprom
          // decide if we have waited 10s after the last move, if so, update the EEPROM
          unsigned long currentMillis = millis();
          if ( (currentMillis - previousMillis > interval) && (writenow == true) ) {
            previousMillis = currentMillis;    // update the timestamp
            // copy current settings and write the data to EEPROM
            myfocuser.validdata = 99;
            myfocuser.fposition = currentPosition;
            myfocuser.maxstep = maxSteps;
            EEPROM_writeAnything(currentaddr, myfocuser);    // update values in EEPROM
            numwrites++;
            writenow = false;
          }
        }
        clearOutput(); // release the stepper coils to save power
      }
    }
    • Like 1
  9. I had a look at your eeprom code but believe you have some serious issues.

    EEPROM in the controller is somewhat limited to 10,000 writes.

    The way the code is written, this could be very quickly reached?

    As example, put a little counter in that increments each time the eeprom is written, then do an imaging session and at the end of the night just print out/dump how many times it was written (might need another serial command) - then divide 10,000 by that number and what do you get? The number of sessions before the eeprom will likely fail?

    Cheers

    Robert

    • Like 1
  10. Hi Dave

    I ran your installer (Win7 64bit Ultimate) but ASCOM_AAF2Setup.msi only installs the application, it does install the ASCOM focuser driver necessary for the FOCUSAAF2.EXE program to talk to.  Thats on my system.

    Is it possible to post the ascom focuser driver separately instead of part of the .msi 

    I have the arduino code running but cannot seem to install the ,msi file properly so am missing the ascom driver

    Cheers

    robert

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