Topics

sticky OnStep Configuration Generator lives on ...


Khalid Baheyeldin
 

The OnStep Configuration Generator is now updated to work with 3.16 (stable) and 4.x (latest master).

This update was done because some people still struggle with the syntax of the configuration file, despite the format of the configuration file from version 3.x onwards was vastly improved to make it more friendly. The users who struggle with the format have no programming experience, and it is difficult to explain that it is case sensitive, it is one argument per #define line, and so on ...

The OCG does the following:
  • Asks for the version of OnStep that you are using.
  • Asks for the two gear ratios, motor steps per rotation, microsteps, ...etc. (same values from the spreadsheet)
  • Calculates the most important parameters to get you going, and validates them as per the spreadsheet formulas.
  • Sets some useful parameters to enabled.
  • Leaves a lot of the remaining parameters unconfigured, as they are in the original Config.h file.
There is no point in supporting version 2.2 or earlier, because it no longer the stable version, and new users will be using the stable or latest master.

The Configuration Generator is now online, and instructions are at the top of the page.

This is a video demonstrating the generator step by step, although for the older versions. The principles are still the same.

Your feedback is welcome.


Alain K
 

Hello Khalid,

I don't see the TMC5160 in the driver list ?

Thanks.


Khalid Baheyeldin
 

On Mon, Jul 27, 2020 at 11:26 PM, Alain K wrote:

I don't see the TMC5160 in the driver list ?
Yeah, it is because the TMC5160 requires a lot of other values to be entered, unlike all other drivers.
I may add it later, but it will require more clutter on the generator's page.

For the time being, just generate a TMC2130, then manually edit the file to change the driver model, and enter the IRUN/IGOTO/... values.


Alain K
 

Thanks Khalid.


Howard Dutton
 

On Tue, Jul 28, 2020 at 07:49 AM, Khalid Baheyeldin wrote:
Yeah, it is because the TMC5160 requires a lot of other values to be entered, unlike all other drivers.
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.

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.

#define AXIS1_STEPS_PER_WORMROT [       ] //  12800, n. Number of steps per worm rotation (PEC Eq mode only:)                <-Req'd
                                          //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage

#define AXIS1_DRIVER_MODEL [            ] //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS1_DRIVER_MICROSTEPS [       ] //    OFF, n. Microstep mode when tracking.                                        <-Often


Markus Kempf
 

Good to know, I had my new 5160 defined as 2130 without any problems but I always used the Spi current settings. Are there any specific options for the 5160? 

Markus
Am 29. Juli 2020, 10:47 +0200 schrieb Howard Dutton <hjd1964@...>:

On Tue, Jul 28, 2020 at 07:49 AM, Khalid Baheyeldin wrote:
Yeah, it is because the TMC5160 requires a lot of other values to be entered, unlike all other drivers.
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.

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.

#define AXIS1_STEPS_PER_WORMROT [ ] // 12800, n. Number of steps per worm rotation (PEC Eq mode only:) <-Req'd
// n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage

#define AXIS1_DRIVER_MODEL [ ] // OFF, (See above.) Stepper driver model. <-Often
#define AXIS1_DRIVER_MICROSTEPS [ ] // OFF, n. Microstep mode when tracking. <-Often


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.


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.


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).


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.


Howard Dutton
 

On Wed, Jul 29, 2020 at 08:38 AM, Khalid Baheyeldin wrote:
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).
Nice!


Khalid Baheyeldin
 

On Wed, Jul 29, 2020 at 04:41 PM, Howard Dutton wrote:
Nice!
I am thinking of adding a link to the OCG at the top of the Config.h page on the Wiki.
Basically saying: if you want a quick basic Config that you can use right away for testing, or to further build on, then use the OCG.

Thoughts?


Howard Dutton
 
Edited

On Wed, Jul 29, 2020 at 01:46 PM, Khalid Baheyeldin wrote:
On Wed, Jul 29, 2020 at 04:41 PM, Howard Dutton wrote:
Nice!
I am thinking of adding a link to the OCG at the top of the Config.h page on the Wiki.
Basically saying: if you want a quick basic Config that you can use right away for testing, or to further build on, then use the OCG.

Thoughts?
I see no issue with it other than the usual downside of the user having no idea what capabilities and configuration are since they didn't "read the instructions."


cui.hongda@...
 

I tried the Online Web,but there are some problems with field  [Steps Per Worm Wheel Rotation].
[ERROR: {Steps Per Worm Wheel Rotation} must be an integer (no decimals)](PS:I input the value 12800)
Thanks


Khalid Baheyeldin
 

There was a bug caused by me trying to fix a bug.
Fixed now.

Please try again.


simpsonj@...
 

I'm not sure if it's operator error (likely) or a bug, but when I attempt to verify release 3.16 using the config.h file generated, I get the following error:

 Arduino: 1.8.5 (Windows 10), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

Build options changed, rebuilding all
In file included from D:\Arduino\OnStep\OnStep.ino:55:0:

Validate.h:264: error: #error "Configuration: AXIS1_MICROSTEPS must be defined in your Config.xxx.h file if using AXIS1_DRIVER_MODEL!"

     #error "Configuration: AXIS1_MICROSTEPS must be defined in your Config.xxx.h file if using AXIS1_DRIVER_MODEL!"

      ^

Validate.h:322: error: #error "Configuration: AXIS1_MICROSTEPS; TMC2130 invalid micro-step mode, use: 256,128,64,32,16,8,4,2,or 1"

       #error "Configuration: AXIS1_MICROSTEPS; TMC2130 invalid micro-step mode, use: 256,128,64,32,16,8,4,2,or 1"

        ^

Validate.h:343: error: #error "AXIS2_MICROSTEPS must be defined in your Config.xxx.h file if using AXIS2_DRIVER_MODEL!"

     #error "AXIS2_MICROSTEPS must be defined in your Config.xxx.h file if using AXIS2_DRIVER_MODEL!"

      ^

Validate.h:398: error: #error "Configuration: AXIS2_MICROSTEPS; TMC2130 invalid micro-step mode, use: 256,128,64,32,16,8,4,2,or 1"

       #error "Configuration: AXIS2_MICROSTEPS; TMC2130 invalid micro-step mode, use: 256,128,64,32,16,8,4,2,or 1"

        ^

Multiple libraries were found for "Wire.h"
 Used: D:\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire
 Not used: D:\Arduino\hardware\Arduino_STM32\STM32F1\libraries\WireSlave
exit status 1
#error "Configuration: AXIS1_MICROSTEPS must be defined in your Config.xxx.h file if using AXIS1_DRIVER_MODEL!"

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I can't find an entry for "AXIS1_MICROSTEPS" or "AXIS2_MICROSTEPS" in the config.h file.  Am I missing something?

Thanks in advance.

Jim Simpson


Khalid Baheyeldin
 

Did you use the Online Configuration Generator?
If so, please attach it to an email (do not copy/paste).
If not, you did not edit the file correctly.

Also, you did not set the options correctly in the Arduino IDE. It has to be 128K, per the instructions.


simpsonj@...
 

Somewhere I missed the instruction to set it to 128k.  I made that change and it made no difference.

I've attached the config.h file that was generated by using the Online Configuration Generator as you requested:

Thanks for taking a look.

Jim Simpson 


Dave Schwartz
 

You must be using an old version of 3.16 because the driver setting validations are currently nowhere near those validate.h line numbers in the error messages.

Validate.h has undergone significant change and may have had a bug in a transitional stage when you may have downloaded it. I suggest you download the current 3.16 and try again.

On 2020-08-14 10:27 a.m., simpsonj via groups.io wrote:
Somewhere I missed the instruction to set it to 128k.  I made that change and it made no difference.

I've attached the config.h file that was generated by using the Online Configuration Generator as you requested:

Thanks for taking a look.

Jim Simpson


Khalid Baheyeldin
 

On Fri, Aug 14, 2020 at 10:49 AM, Dave Schwartz wrote:
I suggest you download the current 3.16 and try again.
Yes.
Download 3.16 again, and then use the same generated Config.h file, and see if it works.