Topics

Meridian flip/NINA and Onstep STM32


helmutliebenau@...
 

Hello, hope anyone can help me at this issue!

During the automatic meridian flip via NINA, the flip not finished in NINA. The mount cross the meridian flip successful, but NINA stops at the step "flipping".
It seams that NINA do not know when Onstep finished the flip and is waiting for an response from Onstep.
Is there any additinional adjuest in the config?

I am using Onstep V 2.22p


Dave Schwartz
 

I think its been fixed since the (old) version of software you are running. Probably upgrading to the latest release version (3.16q https://github.com/hjd1964/OnStep/archive/refs/heads/release-3.16.zip) would be the first step.

On 2021-04-06 11:26 a.m., helmutliebenau@web.de wrote:
Hello, hope anyone can help me at this issue!

During the automatic meridian flip via NINA, the flip not finished in NINA. The mount cross the meridian flip successful, but NINA stops at the step "flipping".
It seams that NINA do not know when Onstep finished the flip and is waiting for an response from Onstep.
Is there any additinional adjuest in the config?

I am using Onstep V 2.22p


helmutliebenau@...
 

Hello Dave,

in the past I tought about an upgrade, but I am afraid that all special parameters for the mount, and my other settings will lose after the upgrade.
Can I safe all settings (e.g. config.STM32.h and Globals.h) and use them after the upgrade?
In Globals.h I set "preferredPierSide" from "PPS_WEST" to "PPS_EAST". This is change is important so that the meridian flip in NINA works at all.


Khalid Baheyeldin
 

No.
Do not do it the way you are saying ...

This situation is exactly why you should never edit ANYTHING in OnStep other than the Config.h file ONLY.

This makes upgrades easier, and avoids confusion, as you try to remember what you did.
DO NOT mix files from different versions.

What you can do is rename the OnStep directory to someting like OnStep-custom, then download the 4.x (beta) version.
Then change the Config.h in the new version (do NOT just copy the old file) to match the changes.

Then test it out and see if you still need the preferred Pier Side changed. If it does, then change ONLY that value.
Keep a note on what file you changed and what exactly was changed. You may need it in a year or two.


helmutliebenau@...
 

Ok, I will try the update 3.16q or 4.x (beta). All the settings in the current config.STM32.h I will put it manually in the config.h from the new version.
Maybe the behavior in NINA for the flip will be solved.


Khalid Baheyeldin
 

On Tue, Apr 6, 2021 at 04:07 PM, <helmutliebenau@...> wrote:
Ok, I will try the update 3.16q or 4.x (beta).
Use 4.x (beta), since it has some added features, and you don't need to update later to it.

All the settings in the current config.STM32.h I will put it manually in the config.h from the new version.
Maybe the behavior in NINA for the flip will be solved.
I don't use pier side stuff myself.
But looking quickly at the code, there is an improvement in 4.x, so you don't need to mess with Globals.h and such, which is not good practice as it impedes upgrades.

Now, in Config.h you just change this to what you want:

#define PIER_SIDE_PREFERRED_DEFAULT  BEST

Set that to EAST, and you should be done.

Let us know that it works as you intended.


Dave Schwartz
 

He has an STM32 - probably the original with 128KB.

3.16 will compile and fit using the existing tools. As Khlid says, do not try to use your current config file verbatim but you should be able to merge the setting fairly easily using side-by-side editor windows. Most of the existing parameters will have the same names but some may have changed (and the meaning will be almost always the same).

For 4.x you will need to change the tools to the STM32 package and omit the USB support from the compilation options in order for it to fit. This is described in the Wiki but is not as straightforward.

I think the whole thing about meridian flips and NINA was hashed out over a year ago. You should be able to find that discussion with a message search on 'NINA flip'.

On 2021-04-06 4:13 p.m., Khalid Baheyeldin wrote:
On Tue, Apr 6, 2021 at 04:07 PM, <helmutliebenau@web.de> wrote:

Ok, I will try the update 3.16q or 4.x (beta).

Use 4.x (beta), since it has some added features, and you don't need to update later to it.

All the settings in the current config.STM32.h I will put it
manually in the config.h from the new version.
Maybe the behavior in NINA for the flip will be solved.

I don't use pier side stuff myself.
But looking quickly at the code, there is an improvement in 4.x, so you don't need to mess with Globals.h and such, which is not good practice as it impedes upgrades.

Now, in Config.h you just change this to what you want:

#define PIER_SIDE_PREFERRED_DEFAULT  BEST

Set that to EAST, and you should be done.

Let us know that it works as you intended.


Khalid Baheyeldin
 

Dave,
Thanks for the corrections.

Helmut,
If you use 3.16, there is no parameter for meridian flip, so you can do it the same way, with the one line Globals.h change.

If you use 4.x (beta), it is better because now you have a parameter and you are not editing source files, so you are future proof.
You also get a lot of fixes, Spiral Search, ...etc.
It is worth the change of the STM32 board manager in the IDE.
Try it out and ask for assistance if you need it.


helmutliebenau@...
 

I am trying to update to 4.x (beta). The STM32 board manager I changed.
Is this the right link for the software 4.x (beta)? https://github.com/hjd1964/OnStep/tree/beta
What happens with the source code in v2.22 for the ESP8266 WiFi and Smart Hand Controller?
I also have to flash them again?



helmutliebenau@...
 

I have now decided for 3.16. But when I upload the software I get the error message:

Arduino: 1.8.10 (Windows 7), TD: 1.48, Board: "Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), Serial, 72Mhz (Normal), Smallest (default)"

In file included from sketch\src/HAL/HAL.h:60:0,

                 from D:\OnStep\OnStep\OnStep.ino:62:

D:\OnStep\OnStep\OnStep.ino: In function 'void setup()':

sketch\src/HAL/HAL_STM32F1/HAL_STM32F1.h:31:17: error: 'Serial3' was not declared in this scope

 #define SerialB Serial3

                 ^

D:\OnStep\OnStep\OnStep.ino:169:3: note: in expansion of macro 'SerialB'

   SerialB.begin(SERIAL_B_BAUD_DEFAULT);

   ^

D:\OnStep\OnStep\Command.ino: In function 'void processCommands()':

sketch\src/HAL/HAL_STM32F1/HAL_STM32F1.h:31:17: error: 'Serial3' was not declared in this scope

 #define SerialB Serial3

                 ^

D:\OnStep\OnStep\Command.ino:47:9: note: in expansion of macro 'SerialB'

     if (SerialB.available() > 0 && !cmdB.ready()) cmdB.add(SerialB.read());

         ^

sketch\src/HAL/HAL_STM32F1/HAL_STM32F1.h:31:17: error: 'Serial3' was not declared in this scope

 #define SerialB Serial3

                 ^

D:\OnStep\OnStep\Command.ino:1520:13: note: in expansion of macro 'SerialB'

             SerialB.print("1");

             ^

sketch\src/HAL/HAL_STM32F1/HAL_STM32F1.h:31:17: error: 'Serial3' was not declared in this scope

 #define SerialB Serial3

                 ^

D:\OnStep\OnStep\Command.ino:2122:11: note: in expansion of macro 'SerialB'

           SerialB.print(reply);

           ^

Mehrere Bibliotheken wurden für "digitalWriteFast.h" gefunden
 Benutzt: C:\Program
Mehrere Bibliotheken wurden für "Wire.h" gefunden
 Benutzt: C:\Program
 Nicht benutzt: C:\Program
Mehrere Bibliotheken wurden für "RtcDS3231.h" gefunden
 Benutzt: C:\Users\PC1\Documents\Arduino\libraries\Rtc-master
exit status 1
Fehler beim Kompilieren für das Board Generic STM32F103C series.


helmutliebenau@...
 

New status. I flashed the V4.34 successful!
Let me play with the settings und the behavior in NINA. I will give an response after that.


helmutliebenau@...
 

So, the update was the solution for my meridian flip problem with NINA.
Now the process works fine in NINA (dry test at home).

But now the focuser and the DS3231 doesn't work anymore.

Focuser stepper has no reaction. The driver I use is DRV8825. The parameters which are set:
#define ST4_INTERFACE                                    ON_PULLUP //    OFF, ON, ON_PULLUP enables interface. <= 1X guides unless hand control mode.  Option
                                                                                                 //         During goto btn press: aborts slew or continue meridian flip pause home
#define ST4_HAND_CONTROL                           ON //    OFF, ON for hand controller special features and SHC support.                 Option
                                                                                  //         Hold [E]+[W] btns >2s: Guide rate   [E]-  [W]+  [N] trk on/off [S] sync
                                                                                  //         Hold [N]+[S] btns >2s: Usr cat item [E]-  [W]+  [N] goto [S] snd on/off
#define ST4_HAND_CONTROL_FOCUSER        ON //    OFF, ON alternate to above: Focuser move [E]f1 [W]f2 [N]-     [S]+            Option

#define FOCUSER1                                    ON //    OFF, ON to enable this focuser.                                               Option
#define AXIS4_STEPS_PER_MICRON        1.2 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS4_SLEW_RATE_DESIRED       200 //    500, n, Where n=200..5000 (um/s.) Max microns/second. In DC mode, max pwr %   Adjust

#define AXIS4_DRIVER_MODEL                 OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS4_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS4_DRIVER_IHOLD                   OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS4_DRIVER_IRUN                      OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS4_DRIVER_POWER_DOWN    ON //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS4_DRIVER_REVERSE              OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS4_DRIVER_DC_MODE             OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs.              Option

#define AXIS4_LIMIT_MIN_RATE           50 //     50, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr.  Adjust
#define AXIS4_LIMIT_MIN                      0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position.               Adjust
#define AXIS4_LIMIT_MAX                    50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position.               Adjust



DS3231 shows no data about altitude and latitude. This are the settings:

#define TIME_LOCATION_SOURCE          DS3231 //    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

Any ideas?


Dave Schwartz
 

I'm curious why you have the GPS parameters set. I don't know for sure but its possible that having those set is overriding the time setting from the DS3231 and waiting for it from the GPS. The interface to the module with the DS3231 (the ZS-04 module) is working because without it OnStep would not be able to access the EEPROM device and OnStep would not start.

From your previous email, you may not have to update your SHC and WiFi software because there is fairly wide version compatibility between OnStep and these remote modules that communicate only over the stable LX200 protocol. However, with such a big version update, it won't hurt and, especially with the SHC, you will get new menu functions that allow you to access things like the spiral search and temperature-compensated focuser.

Your focuser issue could have to do with your AXIS4_SLEW_RATE_DESIRED being setting being quite low. The focuser maybe moving so slowly you just can't see it. I have mine set at 500.

Also, on the version upgrade the NV memory would have been reset and thus the focuser position set to zero. If you were trying to focus in, OnStep would have prevented that because it won't let you go below the minimum. You should do the initialization procedure again to set the focuser in the center of its range and also use the 'set half travel' function to let OnStep know that that is where it is now.

On 2021-04-07 9:09 a.m., helmutliebenau@web.de wrote:
So, the update was the solution for my meridian flip problem with NINA.
Now the process works fine in NINA (dry test at home).

But now the focuser and the DS3231 doesn't work anymore.

Focuser stepper has no reaction. The driver I use is DRV8825. The parameters which are set:
#define ST4_INTERFACE                                    ON_PULLUP //    OFF, ON, ON_PULLUP enables interface. <= 1X guides unless hand control mode.  Option
                               //         During goto btn press: aborts slew or continue meridian flip pause home
#define ST4_HAND_CONTROL                           ON //    OFF, ON for hand controller special features and SHC support.                 Option
                //         Hold [E]+[W] btns >2s: Guide rate [E]-  [W]+  [N] trk on/off [S] sync
               //         Hold [N]+[S] btns >2s: Usr cat item [E]-  [W]+  [N] goto [S] snd on/off
#define ST4_HAND_CONTROL_FOCUSER        ON //    OFF, ON alternate to above: Focuser move [E]f1 [W]f2 [N]-     [S]+            Option

#define FOCUSER1                                    ON //    OFF, ON to enable this focuser.                                               Option
#define AXIS4_STEPS_PER_MICRON        1.2 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS4_SLEW_RATE_DESIRED       200 //    500, n, Where n=200..5000 (um/s.) Max microns/second. In DC mode, max pwr % Adjust

#define AXIS4_DRIVER_MODEL                 OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these. Option
#define AXIS4_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS4_DRIVER_IHOLD                   OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0. "       Option
#define AXIS4_DRIVER_IRUN                      OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc. "       Option
#define AXIS4_DRIVER_POWER_DOWN    ON //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS4_DRIVER_REVERSE              OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS4_DRIVER_DC_MODE             OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs. Option

#define AXIS4_LIMIT_MIN_RATE           50 //     50, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr. Adjust
#define AXIS4_LIMIT_MIN                      0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position. Adjust
#define AXIS4_LIMIT_MAX                    50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position. Adjust



DS3231 shows no data about altitude and latitude. This are the settings:

#define TIME_LOCATION_SOURCE          DS3231 //    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

Any ideas?


helmutliebenau@...
 

The GPS parameters I didn't set consciously. They was as default. After deactivate by "//",  DS3231 works.
//#define SerialGPS                         Serial3
//#define SerialGPSBaud                 9600
Maybe I delete this lines complete.

Regarding the focuser I do not unterstand complete. How a new initialization is doing? For testing I set AXIS4_SLEW_RATE_DESIRED at 500 and
AXIS4_LIMIT_MAX  at 200. Now the focuser moving.


Khalid Baheyeldin
 

On Wed, Apr 7, 2021 at 02:23 AM, <helmutliebenau@...> wrote:
I am trying to update to 4.x (beta). The STM32 board manager I changed.
Is this the right link for the software 4.x (beta)? https://github.com/hjd1964/OnStep/tree/beta
You can download it using this link to the .zip file.

What happens with the source code in v2.22 for the ESP8266 WiFi and Smart Hand Controller?
I also have to flash them again?
The addons directory in the .zip file has a WiFi directory and a smart controller one too.
Yes, it is best to flash them both, as certain things may have changed.


Dave Schwartz
 
Edited

The "SerialGPS" and "SerialGPSBaud" definitions aren't present in the 4.x configuration file, commented out or not, so it must have been something you did to  get them there. No matter, now that it works since you have commented them out, its all good.

However it is good to know that having the GPS lines defined interferes with getting the time from the DS3231 even when the TIME_LOCATION_SOURCE is not GPS but is DS3231. Perhaps that's something Howard can look into because it does not seem like that would have been the intent.

The focuser initialization gets OnStep synchronized with the mechanical position of the focuser. As I said, the reset of the NV memory which would have happened automatically during the first-time startup of the upgraded software, would have set the current focuser position to zero and it then would not have allowed you to focus inward (into negative numbers) from there. Outward focusing should have worked.

Setting the physical position of the focuser to the halfway position AND using the 'set to half travel' function (an explicit menu entry in the SHC from the same 4.x repository or a long-press on the focuser number
selection buttons in the app) lets OnStep calculate, using LIMIT_MIN and LIMIT_MAX, the number of microns from fully 'in' to fully 'out'. It then sets the current position to the midpoint of that and then knows, using STEPS_PER_MICRON, how many steps it can make in the 'in' or 'out' direction so it never tries to drive your focuser beyond its physical limits.

On 2021-04-07 10:53 a.m., helmutliebenau@web.de wrote:
The GPS parameters I didn't set consciously. They was as default. After deactivate by "//",  DS3231 works.
//#define SerialGPS                         Serial3
//#define SerialGPSBaud                 9600
Maybe I delete this lines complete.

Regarding the focuser I do not unterstand complete. How a new initialization is doing? For testing I set AXIS4_SLEW_RATE_DESIRED at 500 and
AXIS4_LIMIT_MAX  at 200. Now the focuser moving.


helmutliebenau@...
 

Thanks for the explanation. Great support again!!!


Khalid Baheyeldin
 

On Wed, Apr 7, 2021 at 12:15 PM, Dave Schwartz wrote:
The "SerialGPS" and "SerialGPSBaud" definitions aren't present in the 4.x configuration file, commented out or not, so it must have been something you did to  get them there.
It may be the Online Configuration Generator. For the 4.x and master, the Config.h template adds these:

#define SerialGPS                     Serial3
#define SerialGPSBaud                 9600

Of course, they only take effect if TIME_LOCATION_SOURCE is set to GPS.


Dave Schwartz
 

That's the theory. We may have seen a case where they interfere with TIME_LOCATION_SOURCE DS3231. It seems the safer thing would be to add them only if TIME_LOCATION_SOURCE of GPS is chosen.


On April 8, 2021 6:56:25 p.m. EDT, Khalid Baheyeldin <kbahey@...> wrote:
On Wed, Apr 7, 2021 at 12:15 PM, Dave Schwartz wrote:
The "SerialGPS" and "SerialGPSBaud" definitions aren't present in the 4.x configuration file, commented out or not, so it must have been something you did to  get them there.
It may be the Online Configuration Generator. For the 4.x and master, the Config.h template adds these:

#define SerialGPS                     Serial3
#define SerialGPSBaud                 9600

Of course, they only take effect if TIME_LOCATION_SOURCE is set to GPS.

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


Khalid Baheyeldin
 

On Thu, Apr 8, 2021 at 08:02 PM, Dave Schwartz wrote:
That's the theory. We may have seen a case where they interfere with TIME_LOCATION_SOURCE DS3231. It seems the safer thing would be to add them only if TIME_LOCATION_SOURCE of GPS is chosen.
I was hoping to keep things simple from a programming point of view (less conditionals, and everything from a template).
But if it is causing issues, then it has to be fixed.

That code is now in the OCG. Those two lines will be there only if GPS is selected.