Date   

Re: Project TinTac - a breadboard setup for testing OnStep code

Howard Dutton
 

On Wed, Jul 29, 2020 at 08:18 AM, <jsalbinson@...> wrote:
Maybe of interest: Bill Earl (https://learn.adafruit.com/multi-tasking-the-arduino-part-1/a-classy-solution)
There's plenty similar code in OnStep except I do the math correctly.

Don't use this form, it will fall down (after several days) due to overflow:

  • if((ledState == HIGH) && (currentMillis - previousMillis >= OnTime))

It should be:

if ((ledState == HIGH) && ((long)(currentMillis - previousMillis) >= OnTime))


Re: Boards and drivers required - help

Khalid Baheyeldin
 

As Markus said: if you get the MKS Gen-L, you don't need the RAMPS board, since the MKS Gen-L has everything that is on RAMPS built in (driver sockets for motors, ...etc.)

Regarding the power, you never run the driver or the motor at the max rated current.
Usually, you start at 40% of the motor (so 0.675A), and then test, tuning it up to say 70% of the 1.68A as a maximum.
You find where the sweet spot in that 40 to 70 range, that gives you fast slewing with no resonance/stalling.

You don't need the TMC5160 for those motors. The TMC2130 should be able to handle them, but make sure you have the heat sinks installed and monitor for excessive warming.


Re: OnStep Configuration Generator lives on ...

Khalid Baheyeldin
 

The OCG now has support for the TMC5160. The compiler will issue a warning that the default for IRUN is 600mA, with the name of the exact parameter. The user then has to go edit that parameter to whatever they want.


Re: Connectors for frontal usage on the MINPCB1

Khalid Baheyeldin
 

On Wed, Jul 29, 2020 at 12:11 PM, andre_moutinho wrote:
Does anyone have the RJs, USB and power connector components models for such assembly and where I could find them? 
The magic term is called: "vertical build".

Check the MiniPCB page, and scroll down to "Special notes for vertical build".


Building the PCBMAX with frontal panel connectors

andre_moutinho
 

The original G11 drivers use a frontal side RJ, power, etc  connectors and I would like to know if anyone here have builded the controller box using such connectors configuration.

Thanks
Andre


Connectors for frontal usage on the MINPCB1

andre_moutinho
 

Hi,

The MINPCB1 PCB for the EM10 has the connectors to be plugged on the board frontal side (not at the side such as 90 degree connectors).

Does anyone have the RJs, USB and power connector components models for such assembly and where I could find them? 

Thanks
Andre


Re: Default limits

Howard Dutton
 

There are horizon and also Axis1 min/max limits in OnStep.

They stop tracking and prevent gotos.


Re: Project TinTac - a breadboard setup for testing OnStep code

Howard Dutton
 
Edited

On Wed, Jul 29, 2020 at 07:36 AM, <jsalbinson@...> wrote:
Still digesting some of the earlier comments, but the tan(theta)/theta function worries me a bit as both tan(theta) and theta go to zero, while the ratio analytically goes to 1, I doubt the computer can cope with zero/zero - it usually falls over. Therefore I found a series expansion for tan(theta), divided it by theta to get a series = 1+ term in theta**2 + term in theta**4 + term in theta**6. USe of a decent spread sheet, but putting in the zero terms by hand, give the result I commented on earlier. I will have another look at the code to see what I am missing. More coffee...
Below is how I see it, at least for a TA drive with a "sliding pivoting arm" i.e. the screw is fixed (at both ends) relative to the axis and the arm travels along it.  I'm no expert on TA's but I also didn't find much design info. online so this is my best understanding.  I kept things simple by using unity for the radius and 100 tpi for the screw.

1. As shown with the arm perpendicular to the screw the ratio is exactly 628:1.
2. To reach a real axis angle of 45° you would need 1" of travel.  Since tan(45) = 1 this checks out (1 * 100 = 100 steps if working at 1 step per rotation of the screw.)
3. To reach a real axis angle of 63.4° you would need 2" of travel.  Since tan(63.4) = 2 this checks out (2 * 100 = 200 steps if working at 1 step per rotation of the screw.)
4. If the TA is at 150 steps and you want to know the axis angle atan(150/100) = 56.30° which in angular steps (as opposed to angular degrees) would be 56.30 * (628/360) = 98.21 steps.




Re: Project TinTac - a breadboard setup for testing OnStep code

Khalid Baheyeldin
 

James,

Looking at the motors (NEMA 34), I think these are the largest I've seen for OnStep over the past 3 years or so.

Can you share what the mount is, and what OTA (or radio?) it will carry?


Re: new FYSETC S6 build

Khalid Baheyeldin
 

In another thread Markus wrote:

I also tried the GPS change to RX3 again without success.

...#define TIME_LOCATION_SOURCE          GPS #define SerialGPS Serial3 #define SerialGPSBaud 9600

 

The GPS TX goes to RX3 PC11 on EXP1 left row second pin from top.

Markus,

Did you refresh your OnStep version from the latest master?
It has a change for not using Serial3 as a command port, and that allows it to work for the GPS.


Re: OnStep Configuration Generator lives on ...

Khalid Baheyeldin
 

On Wed, Jul 29, 2020 at 04:47 AM, Howard Dutton wrote:
OnStep requires no additional values for the the TMC5160 vs. the TMC2130, if you don't specify the current it falls back to 600mA and OnStep provides a warning on compile.

And sure one should specify IRUN, but that's the only other option most need for decent performance.  If they want to mess around with IGOTO and IHOLD they're tuning and compiling/uploading/testing several times probably at that point and who cares then.
The default Config.h has all the I* parameters set to OFF.
If this works, with a compile warning, then I can add the TMC5160 without having to ask for the values for each of the I* values.
Should I?

I didn't look at the OCG and how you set this up... but it should would be nice to grab an Config.h file and turn it into a template then parse the file to insert the values.
That is exactly how I am doing it in this refresh/re-design. The values that will be set by the OCG are tokenized, and the OCG replaces those tokens.

The new format of the Config.h lends itself well to this. I have two Config.h templates, one for 3.16 and another for master.

The only thing I added is the two lines for the GPS serial port and baud rate. Nothing else was changed.

Of course, this is all a point in time thing, and if new variables are introduced I have to merge them (in the master template).


Default limits

Jamie Flinn
 

Hi All…

 

I am setting up  a workaround for the PARK/UNPARK crash in Kstars/EKOS and trying to find a suitable and reliable LIMIT I can set that say, stops tracking or even better auto parks  (since I CAN kill Kstars/EKOS via end of schedule process that is still working)

 

Normally I would just unpark at start of schedule and park at the end then power off in the morning…..

 

Overhead limit I have set to 90 so that EKOS meridian flip can happen – so is there a horizon limit that will trigger a stop in tracking (at all times! – trying to avoind crashing the scope inot the ground)

 

Thanks in advance

J


Re: Project TinTac - a breadboard setup for testing OnStep code

jsalbinson@...
 

Hello Piers,
Yes it's a big project. During the Covid-19 pandemic here I am working in isolation, also partly for personal reasons.
I stand on the shoulders of all who have gone before and I hope to learn from, and apply the lessons, of the past.
There are problems with the current system on this 'scope, and I hope to fix them by the end of the pandemic and the
reopening of the observatory.
Regards, JAmes Albinson


Re: Project TinTac - a breadboard setup for testing OnStep code

jsalbinson@...
 

Hello Howard,
I think I see it now. Essentially you have moved theta onto the numerator on the LHS of the equation; this means that you never have a divide by nearly/equal to zero problem.
Thanks, James Albinson


Re: Project TinTac - a breadboard setup for testing OnStep code

jsalbinson@...
 
Edited

Hello Howard,
Yes that's pretty much it. But you can also predict to the nearest centisecond how long it will take to traverse a given angular distance.
So you can switch from the default track clutch to the slew clutch for a given time, and switch the E or W slew motor for the same period.
*Both MUST have the same time on.*   The N/S slew does not have a clutch - a consequence of the way the 'scope was built many years ago.
This avoids the possibility of a runaway in case you loose the encoder count for whatever reason... And gets you close enough to adjust the last little bit
on the steppers.
I found a class to switch leds on adafruit and realised that leds and relays are the same sort of thing at this level.
The proliferation of arduino switchable SSRs that can handle 2-5A is a godsend. The old system had electromechanical relay logic - robust but slow.
I hope the (rough) example code below gives some idea of my thinking - as always comments welcome.
Regards, JAmes Albinson

Maybe of interest: Bill Earl (https://learn.adafruit.com/multi-tasking-the-arduino-part-1/a-classy-solution)

class SlewMotor
{
    // Class Member Variables
    // These are initialized at startup

  int SlewPin;       //number of the slew pin
  unsigned long OnTime;     // milliseconds of on-time

    // These maintain the current state

  int SlewState;                   // SlewState  used to set the pin
    unsigned long previousMillis;      // will store last time SlewMotor or SlewClutch was updated

  // Constructor - creates a SlewMotor
  // and initializes the member variables and state
  public:
  SlewMotor(int pin, unsigned long on)
  {
    SlewPin = pin;
    pinMode(SlewPin, OUTPUT);    
     
    OnTime = on;
       
    SlewState = LOW;
    previousMillis = 0;
  }

  void DoSlew()
  {
    // check to see if it's time to change the state of the motor or clutch
    unsigned long currentMillis = millis();
    
    if((SlewState == HIGH) && (currentMillis - previousMillis >= OnTime))
    {
        SlewState = LOW;  // Turn it off
      previousMillis = currentMillis;  // Remember the time
      digitalWrite(SlewPin, SlewState);  // Update the actual  motor or clutch
    }
    else if ((SlewState == LOW))
    {
      SlewState = HIGH;  // turn it on
      previousMillis = currentMillis;   // Remember the time
      digitalWrite(SlewPin, SlewState);      // Update the actual motor or clutch
    }
  }
};
// numbers here are examples- tested on an Arduino Uno3 with arduino electromechanical relays and led indicators.
// 1000 would be replaced by OnTime -, calculated in centiseconds ie miliseconds/10, *10 - integer arithmetic rounds down to nearest
// 10 millisec.  Yet to be tested as  such.

SlewMotor SlewN(12, 1000);
SlewMotor SlewS(11, 1000);
SlewMotor SlewE(10, 1000);
SlewMotor SlewW(9, 1000);
SlewMotor SlewC(8, 1000);

void setup()
{
}

void loop()
{
// comment out etc to see leds blink in isolation - too many at once is disturbing...!!

    //SlewN.DoSlew(); delay(1000);
  SlewS.DoSlew(); delay(2000);
  //SlewE.DoSlew(); SlewC.DoSlew(); delay(1500);  // E and W slew MUST have same Clutch time.
  SlewW.DoSlew(); SlewC.DoSlew(); delay(2000);   // E and W slew MUST have same Clutch time.
}


Re: Project TinTac - a breadboard setup for testing OnStep code

jsalbinson@...
 

Hello Howard,
Still digesting some of the earlier comments, but the tan(theta)/theta function worries me a bit as both tan(theta) and theta go to zero, while the ratio analytically goes to 1, I doubt the computer can cope with zero/zero - it usually falls over. Therefore I found a series expansion for tan(theta), divided it by theta to get a series = 1+ term in theta**2 + term in theta**4 + term in theta**6. USe of a decent spread sheet, but putting in the zero terms by hand, give the result I commented on earlier. I will have another look at the code to see what I am missing. More coffee...
Chhers, James Albinson


Re: Boards and drivers required - help

gvpaddy@...
 

Ok.. I will probably then stick to the known MKS gen L and 2130 or 5160 drivers.

Thanks.


Re: Boards and drivers required - help

Markus Kempf
 

no, not the same board.

Markus

Am 29/07/2020 um 14:58 schrieb gvpaddy@...:


Re: OnStep Configuration Generator lives on ...

Markus Kempf
 

for my piece of mind, I immediately changed to TMC5150 and it still works...

I also tried the GPS change to RX3 again without success.

#define SERIAL_A_BAUD_DEFAULT        19200 //   9600, n. Where n=9600,19200,57600,115200 (common baud rates.)                  Infreq
#define SERIAL_B_BAUD_DEFAULT        19200 //   9600, n. See (src/HAL/) for your MCU Serial port # etc.                        Option
#define SERIAL_B_ESP_FLASHING         OFF //    OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
#define SERIAL_C_BAUD_DEFAULT         9600//    OFF, n, ON for ESP32 Bluetooth.                                               Option
#define SERIAL_C_BLUETOOTH_NAME  "OnStep" // "On..", Bluetooth device name for ESP32.                                         Option

// TIME AND LOCATION -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#TLS
#define TIME_LOCATION_SOURCE          GPS //    OFF, DS3231 (I2c,) DS3234 (Spi,) TEENSY (T3.2 internal,) or GPS source.       Option
                                          //         Provides Date/Time, and if available, PPS & Lat/Long also.

#define SerialGPS Serial3
#define SerialGPSBaud 9600


The GPS TX goes to RX3 PC11 on EXP1 left row second pin from top.

Markus


Am 29/07/2020 um 14:04 schrieb Howard Dutton:

On Wed, Jul 29, 2020 at 04:06 AM, Markus Kempf wrote:
Good to know, I had my new 5160 defined as 2130 without any problems but I always used the Spi current settings.
For the TMC5160 you should ALWAYS use one of:
TMC5160, TMC5160_QUIET, TMC5160_VQUIET

The registers are similar but NOT identical to the TMC2130.

Are there any specific options for the 5160? 
None that are exposed to the user.


Re: Boards and drivers required - help

gvpaddy@...