• Increase font size
  • Default font size
  • Decrease font size
English (United Kingdom) Polish (Poland)  
Home Projects Arduino DRO for Quadrature and iGaging scales

Arduino DRO for Quadrature and iGaging scales

This is a new beta version Arduino DRO V6_0 that supports Quadrature Encoder scales through LS7366R-type shield. This version has all the features that the latest version 5 has i.e. still supports iGaging scales, Touch probe, Hall tach with "smart" rpm output, smooth DRO readings. Feel free to download it and test it.

If you look for stable software for iGaging scales check the page Arduino DRO for iGaging scales.

mini mill

The software can run on the DRO controller boards built for ATMega168 or ATMega328-based Arduino boards, such as Arduino UNO, Arduino Nano, etc. Arduino DRO It can read up to four Quadrature Encoder and/or iGaging type Remote DRO scales and simple hall sensor tachometer and one touch probe. For the Arduino Basic DRO Controller board info see Yuryi's website. For Quadrature Encoder type scales you need LS7366R-type shield.

Arduino DRO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

 

The new beta test version of Arduino sketch (Arduino DRO V6.0) is originally based on Yuriy's ArduinoDRO_V3_3. The code has been rewritten for better timing when working with iGaging scales (thanks to Les Jones for help). It has reduced flickering by using weighted average with automatic smoothing factor. It was enhanced by precision tach readout, touch probe support and flexible configuration.
While it is backward compatible with Arduino DRO V5 the new version now supports Quadrature Encoder scales. It can be configured to use iGaging and/or Quadrature Encoder scales on any axis (supports mixed scales environment). Quadrature Encoder scales are connected by LS7366R-type shield. One of on-line sources for that hardware can be SuperDroid Robots site. Depends on number of Quadrature Encoder scales used you may use Single, Dual, Triple, or Quadruple LS7366R Encoder Buffer.
There may be aother sources for LS7366R-type shield or you may make your own.


The tach can read rpm data from 50 rpm to over 6 millions rpm with error less then 1%. The output can be rounded to the nearest 1% or using "smart rounding" (rounding to to the nearest "round" number by 1, 2, 5, 10, 20, 50, 100).
The tach output is compatible with Yuriy's original Touch DRO including the latest version 2.0.2 Build 11/22/2014.
This version of sketch supports also Arduino boards with clock frequency other than 16MHz (for example Arduino Pro Mini 3.3V).
This version is compatible with Touch DRO 2.5.x (the newest version Yuriy's Touch DRO supporting touch probe output). Note, touch probe is not supported by Touch DRO 2.0.x.

Download the source of beta Arduino DRO V6_0 for Quadrature Encoder and iGaging scales with Touch probe support, Hall tach support and "smart" rpm output and smooth DRO readings.

New/changed functionality over the Arduino DRO V5_12:
Added support for for Quadrature Encoder scales.

Note: This is beta test version to work with Yuriy's Tuch DRO


Configuration parameters:

SCALE_<n>_ENABLED

Defines if DRO functionality on axis <n> should be supported.

If supported DRO scale should be connected to I/O pin defined in constant "<n>DataPin" and

DRO data is sent to serial port with corresponding axis prefix (X, Y, Z or W)

Clock pin is common for all iGaging scales should be connected to I/O pin defined in constant "clockPin"

Possible values:

0 = DRO functionality on axis <n> is not supported

1 = DRO functionality on axis <n> is supported

Default value = 1


SCALE_<n>_TYPE (Introduced in 6.0)

Defines the type of scale used on axis <n>.

Two types of scales are supported: iGaging/AccuRemote Digital Scales and quadrature encoder scales (common glass or magnetic)

Note: If at least on scale is type 1 do not connect any other devices to SPI pins as it will interfere with communication with LS7366R.

Possible values:

0 = iGaging/AccuRemote Digital Scales with 21bit protocol

1 = Quadrature Encoder scales through LS7366R-type shield (32-bit quadrature counter with serial interface).

Default value = 0


SCALE_CLK_PIN

Defines the I/O pin where clock signal for all iGaging DRO scales is connected. Used only if at least one scale is type 0.

Possible values:

integer number between 2 and 13

Default value = 2


SCALE_<n>_PIN

Defines the I/O pin where DRO data signal for selected scale is connected

Note: For quadrature scale this pin is connected to SPI SS pin in corresponding LS7366R.

Possible values:

integer number between 2 and 13

Default values = 3, 4, 5, 6 (for corresponding axis X, Y, Z and W)


SCALE_<n>_AVERAGE_ENABLED (Introduced in 5.7)

Defines if DRO reading should be averaged using weighted average calculation with automating smoothing factor.

If average is enabled the reading is much more stable without "jumping" and "flickering" when the scale "can't decide" on the value.

Note: This value is not used when corresponding SCALE_<n>_ENABLED is 0

Possible values:

0 = exact measured from the scale on axis <n> is sent

1 = scale reading from axis <n> is averaged using weighted average calculation with automatic smoothing factor

Default value = 1


AXIS_AVERAGE_COUNT (Introduced in 5.8, Changed in 5.9)

Defines the number of last DRO readings that will be used to calculate weighted average for DRO.

For machines with power feed on any axis change this value to lower number i.e. 8 or 16.

Possible values:

integer number between 4 and 32

Recommended values:

16 for machines with power feed

32 for all manual machines

Default value = 24


TACH_ENABLED (Introduced in 2.b)

Defines if tach sensor functionality should be supported.

If supported tach sensor should be connected to I/O pin defined in constant INPUT_TACH_PIN and rpm value is sent to serial port with axis prefix "T"

Possible values:

0 = tach sensor functionality is not supported

1 = tach sensor functionality is supported

Default value = 1


INPUT_TACH_PIN (Introduced in 2.b)

Defines the I/O pin where tach sensor signal is connected

Possible values:

integer number between 2 and 13

Default value = 7


TACH_PRESCALE (Introduced in 5.2)

Defines how many tach pulses per one revolution the sensor sends.

For example if tach sensor uses two magnets on the shaft the sensor will generate two pulses per revolution.

This can be used to get better resolution and faster response time for very low rpm

Note: This value is not used when TACH_RAW_DATA_FORMAT is enabled

Possible values:

any integer number greater than 0

Default value = 1


TACH_AVERAGE_COUNT (Introduced in 5.3)

Defines the number of last tach readings that will be used to calculate average tach rpm.

If you want to send measured rpm instead of average rpm set this value to 1.

Note: This value is not used when TACH_RAW_DATA_FORMAT is enabled.

It is recommended to set this value 2 times or more of TACH_PRESCALE value.

For example: if TACH_PRESCALE = 4, set TACH_AVERAGE_COUNT = 8

Possible values:

1 = exact measured tach reading is sent

any integer number greater than 1 - average tach reading is sent

Default value = 6


TACH_ROUND (Introduced in 5.3 and 5.10)

Defines how tach reading should be rounded.

If rounding is enabled the reading can be rounded either by 1% of current rpm or to the fixed "round" number with predefined RPM thresholds ("smart rounding").

For example with 1% rounding if measured rpm is between 980rpm and 1020 rpm the display will show numbers rounded to 9 and 10 (i.e. 981, 990, 999, 1000, 1010, 1020 etc.).

With "smart rounding" the measured rpm is rounded to the nearest 1, 2, 5, 10, 20, 50 and 100 depends on measured RPM (change at predefined thresholds).

For example with "smart rounding" all measured rpm is between 500pm and 2000 rpm the display will show numbers rounded to the nearest 5 (i.e. 980, 985, 990, 995, 1000, 1005 etc.).

Note: This value is not used when TACH_RAW_DATA_FORMAT is enabled

Possible values:

0 = exact measured tach reading is sent

1 = tach reading is rounded to the nearest 1% of measured rpm (1% rounding)

2 = tach reading is rounded to the nearest "round" number with fixed thresholds ("smart rounding")

Default value = 2


TACH_RAW_DATA_FORMAT (Introduced in 3)

Defines the format of tach data sent to serial port.

Note: when raw data format is used, then TACH_PRESCALE, TACH_AVERAGE_COUNT and TACH_ROUND are ignored

Possible values:

0 = tach data is sent in single value format: T<rpm>

1 = tach data is sent in raw (two values) format: T<total_time>/<number_of_pulses>

Default value = 0


MIN_RPM_DELAY (Introduced in 2.b)

Defines the delay (in milliseconds) in showing 0 when rotation stops. If rpm is so low and time between tach pulse

changes longer than this value, value zero rpm ("T0;") will be sent to the serial port.

Note: this number will determine the slowest rpm that can be measured. In order to measure smaller rpm I suggest to use a sensor with more than one "ticks per revolution" (for example hall sensor with two or more magnets). The number of "ticks per revolution" should be set in tachometer setting in Android app.

Possible values:

any integer number greater than 0

Default value = 1200 (the minimum rpm measured will be 50 rpm)


OUTPUT_TACH_LED_ENABLED (Introduced in 6.0)

Defines if the tach LED feedback is supported.

If supported the tach feedback LED should be connected to I/O pin defined in constant OUTPUT_TACH_LED_PIN below

Possible values:

0 = tach LED feedback functionality is not supported

1 = tach LED feedback functionality is supported

Default value = 1


OUTPUT_TACH_LED_PIN (Introduced in 2.b, Renamed in 5.11)

Defines the I/O pin where the tach LED feedback is connected.

Tach LED feedback indicates the status of INPUT_TACH_PIN for debugging purposes

Possible values:

integer number between 2 and 13

Default value = 9


PROBE_ENABLED (Introduced in 5.11)

Defines if touch probe sensor functionality should be supported.

If supported touch probe should be connected to I/O pin defined in constant INPUT_PROBE_PIN.

Possible values:

0 = touch probe functionality is not supported

1 = touch probe functionality is supported

Default value = 1


INPUT_PROBE_PIN (Introduced in 5.11)

Defines the I/O pin where touch probe signal is connected.

Possible values:

integer number between 2 and 13

Default value = 8


PROBE_INVERT (Introduced in 5.11)

Defines if the touch probe input pin signal needs to be inverted (enter the signal level when touch probe is not touching).

Possible values:

0 = touch probe input pin signal is LOW (logical Zero) when touch probe is in "normal open" status (not touching)

1 = touch probe input pin signal is HIGH (logical One) when touch probe is in "normal open" status (not touching)

Default value = 0


OUTPUT_PROBE_LED_ENABLED (Introduced in 6.0)

Defines if the touch probe LED feedback is supported.

If supported the touch probe feedback LED should be connected to I/O pin defined in constant INPUT_PROBE_PIN below.

Possible values:

0 = touch probe LED feedback functionality is not supported

1 = touch probe LED feedback functionality is supported

Default value = 1


OUTPUT_PROBE_LED_PIN (Introduced in 5.11)

Defines the I/O pin where the touch probe LED feedback is connected.

Touch probe LED feedback indicates the status of INPUT_PROBE_PIN for debugging purposes

Possible values:

integer number between 2 and 13

Default value = 10


UART_BAUD_RATE (Introduced in 5.2)

Defines the serial port baud rate. Make sure it matches the Bluetooth module's baud rate.

Recommended value:

1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200

Default value = 9600


UPDATE_FREQUENCY (Introduced in 5.2)

Defines the Frequency in Hz (number of timer per second the scales are read and the data is sent to the application).

Possible values:

any integer number between 1 and 64

Default value = 24


TACH_UPDATE_FREQUENCY (Introduced in 5.3, Changed in 5.9)

Defines the max Frequency in Hz (number of timer per second) the tach output is sent to the application.

Note: This value must be a divider of UPDATE_FREQUENCY that would result zero reminder.

For example for UPDATE_FREQUENCY = 24 valid TACH_UPDATE_FREQUENCY are: 1, 2, 3, 4, 6, 8, 12 and 24

Possible values:

any integer number between 1 and UPDATE_FREQUENCY

Default value = 4


Please report any issues and errors using Contact RysiuM form.