Hi Gene,
I don't know enough about the inner workings of LinuxCNC but when I designed
the Electronic Lead Screw for the lathe I made a decision (good or bad) that
the fundamental units would be imperial simply because at the time I didn't
have a metric lathe to test on.  But there was a need for metric lathes or
at least metric motion on an imperial lathe or the other way around.

And unlike the newest electronic gearing systems based on Arduino's there's
no need to edit a file, compile it and download it into the processor to
make it work with specific units.  Just select TPI, imperial pitch or Metric
to define the distance the lead screw moves.  Now since one of those is in
Turns/Inch and the other two are the inverse and inverse scaled the question
is what is actually stored in EEROM memory and how does the system use that.

Although the text file I've included is a bit old and doesn't quite match
the attached photo the concept of dependant parameters is still there.
And the code for the current version for the Leadscrew pitch is below.  The
structure is described in that text file.

What I'm suggesting as a concept is to device one HAL parameter like
ConversionFactor which states which units you are working in.  If the value
is 1.0 then the joint speed is what is in the ini file.  If it's 25.4 then
rate is in mm/min.  Likely you need an inverse flag of sorts too.  At a
higher level menu it's also possible to request display and entry of
distances etc. be done as metric instead of imperial.  Again, internally
everything is done in imperial units but what you see is metric or imperial.


   { // 5 0x05
        " LEADSCREW PITCH    TPI  PITCH    METRIC",
        0,   // Global Variable Array Index
        0x08070706,      // Data
        0,0,
        MENU_TYPE,       // Format
        0,       // Pos
        0,       // Len
        0,   // Dependancy
        0,   // Units Position that uses Dependancy for which to display
        1.0,  // Conversion Factor
        DoNothing,
        DoNothing
        },
    { // 6 0x06 Store as TPI
        " Imperial Leadscrew                 TPI ",
        LEADSCREW_IPITCH_NDX,   // Global Variable Array Index
        16.0,    // Data
        0.1,0,
        FLOAT_TYPE,      // Format
        8,       // Pos
        0x15,    // Len
        0,   // Dependancy
        0,   // Units Position that uses Dependancy for which to display
        1.0,  // Conversion Factor
        InvertToImperial,               // When storing don't allow 0.0.
        InvertToMetric  
        },
    { // 7 0x07 Store as TPI
        " Imperial Leadscrew Pitch               ",
        LEADSCREW_IPITCH_NDX,   // Global Variable Array Index
        0.0625,  // Data
        0.001,0,
        FLOAT_TYPE,      // Format
        6,       // Pos
        0x37,    // Len
        0x2E,   // Dependancy on Leadscrew Metric Flag
        0,   // Units Position that uses Dependancy for which to display
        1.0,  // Conversion Factor
        ConvertToImperial,              // Write input value to EEROM as
imperial units.
        ConvertToMetric                 // Pull input back out as imperial
but show as metric.
        },
    { // 8 0x08 Store as pitch in imperial units.
        " Metric Leadscrew   Pitch           mm  ",
        LEADSCREW_IPITCH_NDX,   // Global Variable Array Index
        0.01,    // Data
        0.001,0,
        FLOAT_TYPE,      // Format
        6,       // Pos
        0x27,    // Len
        0,   // Not dependant since this menu is always metric.
        0,   // Units Position that uses Dependancy for which to display
        25.4,  // Conversion Factor
        DoNothing,                      // Write input value to EEROM as
imperial units.
        DoNothing                       // Pull input back out as imperial
but show as metric.
        },

> -----Original Message-----
> From: gene heskett [mailto:ghesk...@shentel.net]
> Sent: September 21, 2023 4:39 PM
> To: Emc-users@lists.sourceforge.net
> Subject: [Emc-users] Q, switching machine from inch default to metric
(mm's)
> default?
> 
> Greetings said a confused guy;
> 
> If I want to keep the same physical speeds, basically what the machine
> can do, it makes sense the STEP_SCALE in each axis gets divided by 25.4
> to make it a mm machine.
> 
> But when I've done that the machine moves extremely slow, and throws a
> following error when it has moved by about the amount set in FERROR
> and/or MIN_ERROR. What else besides the MAXVELS and ACCEL's need
> massaging, as it makes sense they should be multiplied by 25.4.  Which I
> did, but then it tries to move at several hundred mm/sec & crashes into
> all the stops.
> 
> Another problem, what is the input resistance load of a 7i76D when its
> set for 12 volt logic. I am using a prox switch for a home switch on
> this new A axis. I get 12 volts  back from the prox switch when
> triggered, and the prox switch is rated for srcing 300 milliamps when
> triggered, but when I hook it up to hm2_5i25.0.7i76.0.0.input-06, the
> switch does not heat, but only gives a few millivolts over 8 volts, like
> there is one hell of a load, and its the same for 2 different new prox
> switches and for 2 different inputs on the 7i76D. The new A axis homes
> like it should, only axis that actually works for homing.
> 
> I could use some help. This is so frustrating that I'm ready to give up,
> copy the 3 axis inch config over this one and add the A axis stuff all
> over again.
> 
> Also:
> This new atpid was not, at least for me, anywhere near ready for prime
> time. It gives huge, often unstable numbers for inch linear axis's, and
> left my bs-1 servo hunting so bad it burned up a $120 motor in about 3
> minutes quietly hunting about half an arcminute, at around 10 hertz. It
> refuses to find usable settings for an angular axis. 6+ digits left of
> the decimal point for vars for that mode, yet when I asked, I'm told it
> should work with the hard to find procedure, but it doesn't.
> 
> Thanks.
> 
> Cheers, Gene Heskett.
> --
> "There are four boxes to be used in defense of liberty:
>   soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author, 1940)
> If we desire respect for the law, we must first make the law respectable.
>   - Louis D. Brandeis
> Genes Web page <http://geneslinuxbox.net:6309/>
> 
> 
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
Dump of LCD Menus and some of the parameters used in ELS Rev 1.01a


A menu is a record structure that has the text that shows up on the 
LCD display.  Additionally it contains information as to what type
of mumber or information to display and where to display it.
Finally, it also contains instructions, in the form of function addresses
of how to save the data and how to retrieve it.

in the C language looks like this:

typedef union _MENU_LINKS {
        long LongValue;                 // List of parameters or Indexes.
        float FloatValue;
        BYTE Next[4];                   // Left and right Menus
  } TMENU_LINKS;


typedef struct tmenu_data{
  BYTE Menubuf[LCD_MENU_SIZE+1];                // Our menu text
  char GIndex;                          // Menu(-1) or leaf(0..n) index
  TMENU_LINKS Data, MinValue, MaxValue;
  BYTE Format;                          // Type of Data
  BYTE Pos;                             // Where on second line
  BYTE Len;                             // How many characters in low nibble, 
how many decimals in high nibble
  BYTE Dependancy;                      // The Parameter is dependant on this 
link's parameter.
                                        // Useful for metric/imperial 
conversion.
  float Conversion;
  void (*WriteValue)(struct tmenu_data *p);
  void (*ReadValue)(struct tmenu_data *p);
} TMENU_DATA;


Each menu is identified by a HEX number from 0..0x42  (67 decimal)

Under the physical LCD display are 4 Function Buttons.  

For MENU records, the values are the Menu # to show when that button 
is pressed.  If the GIndex value is -1 then this is a MENU that displays
more information.  If the GIndex value is between 1..255 then it's aleaf node
and the number is an index into the global array of values that are used by 
the program.

Each numeric data value is also constrained by a min and max parameter to 
prevent 
things like divide by zero with incorrect parameters.  

The Dependancy link is used to dynamically modify how a value is stored and 
retrieved. 
For example: if the Leadscrew is flagged as being metric, then the display of 
parameters 
associated with the leadscrew are all displayed in mm otherwise in inches.  
However, internally
all dimensions are in inches stored as a 32 bit floating point #.



LCD:00
 --------------------
|     E-LEADSCREW    |
|     VERSION 1.01a  |
 --------------------
MENU: LCD:01, LCD:01, LCD:01, LCD:01
Dependant on: 00

LCD:01
 --------------------
|   Choose Option    |
|RUN            SETUP|
 --------------------
MENU: LCD:0D, LCD:01, LCD:01, LCD:02
Dependant on: 00

LCD:02
 --------------------
|      SETUP         |
|SPDL FLGS CRSS LDSCR|
 --------------------
MENU: LCD:0C, LCD:29, LCD:1C, LCD:03
Dependant on: 00

LCD:03
 --------------------
|    LEADSCREW       |
|MOTOR         LDSCRW|
 --------------------
MENU: LCD:09, LCD:01, LCD:01, LCD:04
Dependant on: 00

LCD:04
 --------------------
|    LEADSCREW       |
|  METRIC    IMPERIAL|
 --------------------
MENU: LCD:08, LCD:01, LCD:01, LCD:05
Dependant on: 00

LCD:05
 --------------------
| IMPERIAL LEADSCREW |
|TPI  PITCH  BACKLASH|
 --------------------
MENU: LCD:06, LCD:07, LCD:07, LCD:17
Dependant on: 00

LCD:06
 --------------------
| IMPERIAL LEADSCREW |
|                TPI |
 --------------------
FLOAT:   0.1
Min=  0.0, Max= 200.0
Dependant on: 2E

LCD:07
 --------------------
| IMPERIAL LEADSCREW |
|PITCH           INCH|
 --------------------
FLOAT:   0.118
Min=  0.001, Max= 200.000
Dependant on: 2E

LCD:08
 --------------------
| METRIC LEADSCREW   |
|PITCH           MM  |
 --------------------
FLOAT:    0.12
Min=   0.00, Max= 200.00
Dependant on: 2E

LCD:09
 --------------------
|      MOTOR Z       |
|RATE           PARAM|
 --------------------
MENU: LCD:13, LCD:01, LCD:01, LCD:12
Dependant on: 00

LCD:0A
 --------------------
|   MOTOR Z STEPS    |
|          STEPS/REV |
 --------------------
WORD:2000
Min=200, Max=4000
Dependant on: 00

LCD:0B
 --------------------
|   SERVO ENCODER    |
|         LINES/REV  |
 --------------------
WORD:0
Min=0, Max=0
Dependant on: 00

LCD:0C
 --------------------
|  SPINDLE ENCODING  |
|          PULSES/REV|
 --------------------
BYTE: 1
Min=1, Max=1
Dependant on: 00

LCD:0D
 --------------------
| RUN PARAMETERS     |
|Z    X  TAPER  UNITS|
 --------------------
MENU: LCD:0E, LCD:26, LCD:42, LCD:24
Dependant on: 00

LCD:0E
 --------------------
|Z RUN PARAMETERS    |
|TURN THRD  POS   JOG|
 --------------------
MENU: LCD:10, LCD:34, LCD:18, LCD:16
Dependant on: 00

LCD:0F
 --------------------
|     THREADING      |
|TPI    PITCH  METRIC|
 --------------------
MENU: LCD:3C, LCD:3B, LCD:3B, LCD:3D
Dependant on: 00

LCD:10
 --------------------
|     TURN PITCH     |
|                    |
 --------------------
FLOAT:  0.0030
Min= 0.0010, Max= 200.0000
Dependant on: 24

LCD:11
 --------------------
|MOTOR Z ACCELERATION|
|           STP/RV/RV|
 --------------------
LONG: 9000
Min=1, Max=22988
Dependant on: 00

LCD:12
 --------------------
|MOTOR Z PARAMETERS  |
|ACCEL DELAY    STEPS|
 --------------------
MENU: LCD:11, LCD:1B, LCD:01, LCD:0A
Dependant on: 00

LCD:13
 --------------------
|MOTOR Z RATE VALUES |
|SLEW            HOME|
 --------------------
MENU: LCD:14, LCD:01, LCD:01, LCD:15
Dependant on: 00

LCD:14
 --------------------
|MOTOR Z SLEW RATE   |
|                    |
 --------------------
LONG: 21000
Min=0, Max=22988
Dependant on: 00

LCD:15
 --------------------
|MOTOR Z HOME RATE   |
|                    |
 --------------------
LONG: 15000
Min=0, Max=22988
Dependant on: 00

LCD:16
 --------------------
|ADJUST Z JOG DISTNCE|
|                    |
 --------------------
FLOAT:  0.000
Min= 0.001, Max= 0.200
Dependant on: 24

LCD:17
 --------------------
| LEADSCREW BACKLASH |
|                    |
 --------------------
FLOAT:  0.028
Min= 0.100, Max= 0.100
Dependant on: 2E

LCD:18
 --------------------
|Z START/END POS     |
|START END       ZERO|
 --------------------
MENU: LCD:19, LCD:1A, LCD:00, LCD:25
Dependant on: 00

LCD:19
 --------------------
|Z START POSITION    |
|                    |
 --------------------
FLOAT:   0.100
Min=  0.000, Max=  0.000
Dependant on: 24

LCD:1A
 --------------------
|Z END POSITION      |
|                    |
 --------------------
FLOAT:  -0.250
Min=  0.000, Max=  0.000
Dependant on: 24

LCD:1B
 --------------------
|TIME TILL STEP POWER|
|DOWN          x 1.0S|
 --------------------
BYTE: 10
Min=0, Max=255
Dependant on: 00

LCD:1C
 --------------------
|      MOTOR X       |
|RATE           PARAM|
 --------------------
MENU: LCD:1D, LCD:00, LCD:00, LCD:1E
Dependant on: 00

LCD:1D
 --------------------
|MOTOR X MOVE RATE   |
|                    |
 --------------------
LONG: 6000
Min=0, Max=22988
Dependant on: 00

LCD:1E
 --------------------
|MOTOR X PARAMETERS  |
|ACCEL PITCH    STEPS|
 --------------------
MENU: LCD:1F, LCD:20, LCD:20, LCD:21
Dependant on: 00

LCD:1F
 --------------------
|MOTOR X ACCELERATION|
|           STP/RV/RV|
 --------------------
LONG: 3000
Min=1, Max=22988
Dependant on: 00

LCD:20
 --------------------
|   CROSS SLIDE X    |
| PITCH              |
 --------------------
FLOAT:   0.050
Min=  0.001, Max= 200.000
Dependant on: 31

LCD:21
 --------------------
|   MOTOR X STEPS    |
|          STEPS/REV |
 --------------------
WORD:2400
Min=200, Max=4000
Dependant on: 00

LCD:22
 --------------------
|CROSS SLIDE START   |
|                    |
 --------------------
FLOAT:   0.000
Min=-10.000, Max=  0.000
Dependant on: 00

LCD:23
 --------------------
|CROSS SLIDE RETRCTD |
|                    |
 --------------------
FLOAT:  -0.050
Min=-10.000, Max=  0.000
Dependant on: 00

LCD:24
 --------------------
|THRD OR TURN UNITS  |
|METRIC MODE IS      |
 --------------------
FLAG: 0
Dependant on: 00

LCD:25
 --------------------
|SET Z HOME POSITION |
|                    |
 --------------------
FLOAT:   0.000
Min=  0.000, Max=  0.000
Dependant on: 00

LCD:26
 --------------------
|X RUN PARAMETERS    |
|POS              JOG|
 --------------------
MENU: LCD:27, LCD:01, LCD:01, LCD:28
Dependant on: 00

LCD:27
 --------------------
|X START/END POS     |
|START      RETRACTED|
 --------------------
MENU: LCD:22, LCD:01, LCD:01, LCD:23
Dependant on: 00

LCD:28
 --------------------
|ADJUST X JOG DISTNCE|
|                    |
 --------------------
FLOAT:  0.001
Min= 0.001, Max= 0.100
Dependant on: 00

LCD:29
 --------------------
|SET PROGRAM FLAGS   |
|SCRL ^,v  TOGGLE '.'|
 --------------------
MENU: LCD:2A, LCD:29, LCD:FF, LCD:FF
Dependant on: 00

LCD:2A
 --------------------
|INVERT ESTOP LINE   |
|INVERTED IS         |
 --------------------
FLAG: 1
Dependant on: 00

LCD:2B
 --------------------
|INVERT LIMIT SWITCH |
|INVERTED IS         |
 --------------------
FLAG: 1
Dependant on: 00

LCD:2C
 --------------------
|USE ONBOARD STEPPER |
|STEP MOTOR IS       |
 --------------------
FLAG: 0
Dependant on: 00

LCD:2D
 --------------------
|Z AXIS DIRECTION    |
| INVERTED IS        |
 --------------------
FLAG: 0
Dependant on: 00

LCD:2E
 --------------------
|Z AXIS LEADSCREW    |
| METRIC IS          |
 --------------------
FLAG: 1
Dependant on: 00

LCD:2F
 --------------------
|TRACK SPINDLE SPEED |
|     IS SET         |
 --------------------
FLAG: 0
Dependant on: 00

LCD:30
 --------------------
|X AXIS DIRECTION    |
| INVERTED IS        |
 --------------------
FLAG: 1
Dependant on: 00

LCD:31
 --------------------
|X AXIS LEADSCREW    |
| METRIC IS          |
 --------------------
FLAG: 0
Dependant on: 00

LCD:32
 --------------------
|   AUTOMATIC X      |
|MOVEMENT IS         |
 --------------------
FLAG: 1
Dependant on: 00

LCD:33
 --------------------
|   SERIAL PORT      |
|ECHO CHARS IS       |
 --------------------
FLAG: 1
Dependant on: 00

LCD:34
 --------------------
| THREAD PARAMETERS  |
|PTCH ANGL PASS EXTRA|
 --------------------
MENU: LCD:0F, LCD:35, LCD:36, LCD:37
Dependant on: 00

LCD:35
 --------------------
|THREAD ANGLE & DEPTH|
|ANGLE          DEPTH|
 --------------------
MENU: LCD:40, LCD:40, LCD:3F, LCD:3F
Dependant on: 00

LCD:36
 --------------------
| THREAD PASS CNT    |
|          PASSES    |
 --------------------
BYTE: 20
Min=0, Max=255
Dependant on: 00

LCD:37
 --------------------
| THREAD EXTRA CNT   |
|          PASSES    |
 --------------------
BYTE: 0
Min=0, Max=255
Dependant on: 00

LCD:38
 --------------------
|X AXIS MOVEMENT     |
| DIRECT MODE IS     |
 --------------------
FLAG: 0
Dependant on: 00

LCD:39
 --------------------
|X AXIS STEP POL     |
| INVERTED IS        |
 --------------------
FLAG: 0
Dependant on: 00

LCD:3A
 --------------------
|Z AXIS STEP POL     |
| INVERTED IS        |
 --------------------
FLAG: 0
Dependant on: 00

LCD:3B
 --------------------
|     THREAD PITCH   |
|          INCH      |
 --------------------
FLOAT:   0.050
Min=  0.001, Max= 200.000
Dependant on: 00

LCD:3C
 --------------------
|     THREAD TPI     |
|                    |
 --------------------
FLOAT:   0.1
Min=  0.0, Max= 200.0
Dependant on: 00

LCD:3D
 --------------------
|     THREAD PITCH   |
|             MM     |
 --------------------
FLOAT:   0.050
Min=  0.001, Max= 200.000
Dependant on: 00

LCD:3E
 --------------------
|USE COMPOUND FOR    |
|   THREADING IS     |
 --------------------
FLAG: 0
Dependant on: 00

LCD:3F
 --------------------
| AMOUNT OF THREAD   |
|DEPTH CUT          %|
 --------------------
FLOAT:  75.0
Min=  0.0, Max= 100.0
Dependant on: 00

LCD:40
 --------------------
|   THREAD ANGLE     |
|          DEGREES   |
 --------------------
FLOAT:  30.0
Min=  0.0, Max= 45.0
Dependant on: 00

LCD:41
 --------------------
| TAPER TURNING      |
|   TAPERING  IS     |
 --------------------
FLAG: 0
Dependant on: 00

LCD:42
 --------------------
|   TAPERING RATIO   |
|          " per Inch|
 --------------------
FLOAT:   0.049950
Min=  0.000000, Max=  1.000000
Dependant on: 00

>
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to