Author Topic: Pi PICO DRO/Quill-Knee combiner  (Read 62236 times)

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Pi PICO DRO/Quill-Knee combiner
« on: January 02, 2024, 04:38:26 PM »
I'm just throwing this out here in case anyone is interested.

I'm knocking-up a DRO and Knee-Quill scale combiner using a Pi PICO.

Both use the PICO's PIO (programmable input/output) to count the quadrature input from the scales . The four  PIOs unload the fast counting operations from the main program,  so enabling the rest of the code to be written in MicroPython . 

The Quill-Knee combiner reads each scale (they can be different resolutions and could even be a capacitive caliper type scale with appropriate driver) then  add or subtracts the result before pulsing a quadrature output to drive the Z input of a DRO (this can also be a different resolution) .

As a DRO, the four inputs can count any resolution , I'm setting this at 0.1um (100nm),  at upto about 12MHz  (it would take some cranking to get the knee upto that speed ;-0)

ATM I'm considering a separate  SDD1322 128x64 by 16 greyscale  display for each Axis (or may each pair) as a single large display may eat too much the PICO available RAM.
 
I want to implement my scrolling analogue fractional display that I used on a Visual Basic based DRO i made some years ago :

 https://drive.google.com/file/d/1rM2Hi0BpiGD3UBXQO2KIPjKZfed-vfZa/view?usp=drive_link


If anyone is interested, please respond and I'll post the progress here.
Bill

Offline JHovel

  • Jr. Member
  • **
  • Posts: 97
  • Country: au
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #1 on: January 03, 2024, 06:33:59 AM »
Very interested Bill!
As you know, I built your DRO of 15 years or more ago back then. I've still got it!
Cheers,
Joe

Offline JamesC

  • Jr. Member
  • **
  • Posts: 15
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #2 on: January 03, 2024, 08:32:28 AM »
A very long time lurker,

I too would be very interested in following this and maybe if my skills alow building one.

James

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #3 on: January 03, 2024, 10:06:21 AM »
Hi Joe , James  good to have you onboard :)

This doesn't look much ATM  but this is the heart of the DRO :

On the extreme left is a hand-wheel encoder and right , a servo motor they are  standing in for a glass scales giving a 2000 and 5000 pulse per rev quadrature output . Each feeds a PICO PIO programmed as a quadrature counter and displayed as K: ans Q: .

A third PIO input , Z: , is fed from the quadrature output pins @ 2000pulse per unit  which is currently squirting out the sum of K and Q (the slight error in the counts is due to the difference in resolutions (my mill would not see those last two digits)



Bill

Offline Fred Bloggs

  • Jr. Member
  • **
  • Posts: 51
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #4 on: January 04, 2024, 05:10:52 AM »
Hi.

Im just in the process of converting my 1950's German vertical mill to 3 phase with a VFD and your DRO would be a good addition, please post  :nrocks:

Best regards

Fred

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #5 on: January 04, 2024, 01:35:28 PM »
Hi Fred,
What make of mill?
Bill

Offline djc

  • Jr. Member
  • **
  • Posts: 86
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #6 on: January 04, 2024, 02:36:26 PM »
I am a bit confused on the functionality. I think it is becasue of some slightly loose terminology you are using.

To me, a DRO system consists of two parts: the scale and the display head. I kind of get the impression you are using DRO to mean the latter of these two and that is where the confusion lies.

I am sure you are aware that there are commercially-available 'adder' boxes that combine the knee and quill scales.

The quill scale and knee scale form the inputs to the box. The output of the box goes to your existing head unit display - Sino, Anilam, Sony, whomever.

Hence, please could you confirm that you are aiming to duplicate the functionality of the commercial units in a more affordable package. Thanks.

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #7 on: January 04, 2024, 03:32:31 PM »
I'm describing two things with essentially similar hardware:

A) A Digital Read Out  -- i.e. a device that counts/decode and displays numerical position with inputs from a variety of "Scales" or other sources (DRO and Scales are two different things , either can be bought separately) 

B) A Knee and Quill scale combiner that will read two (or more) scales and combines them into a pair (or more)  of quadrature signals for another DRO/CNC/Duberry  . In this case it can Add , Subtract or 'any other function',  if it can be programmed in python.

To be clear, since term-u-know-leggy seems critical  : the scale inputs will initially be TTL (5v) type . Although, I am looking at capacitive caliper type devices , since I have a couple that would do for my small lathe .

While tackling a sine wave resolver with a PICO might just be possible, it might not be quick  (I have a couple of Newall Sphrerical magnetic scales  that i would like to be able to read and heidenhain F series glass scale with sine out  that I'd love to be able to read to sub-micron resolution)  .

I'm building my own because :
1) I can
2) it's cheap
3) It's what we do here ;-)

 :proj:
Bill

Offline Muzzerboy

  • Full Member
  • ***
  • Posts: 126
  • Country: gb
    • The Mighty Shiz
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #8 on: January 05, 2024, 09:45:32 AM »
There was a Brit on Youtube who fitted scales on both the knee and quill of his Bridgeport clone and did something similar, so that he didn't need to reset his  home every time he changed the knee height. John somebody(?). May be worth seeing how he did it, although it may have been in the CNC controller itself. It wasn't somebody on here, was it?

Offline John Rudd

  • Hero Member
  • *****
  • Posts: 2526
  • Country: gb
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #9 on: January 05, 2024, 10:38:05 AM »
I too remember seeing a’device’ for combining the readings from a knee and quill, but was done with Arduino….might have the code still somewhere…never got round to implementing it on mine…
eccentric millionaire financed by 'er indoors
Location:  Backworth Newcastle

Skype: chippiejnr

Offline JHovel

  • Jr. Member
  • **
  • Posts: 97
  • Country: au
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #10 on: January 07, 2024, 06:14:32 AM »

3) It's what we do here ;-)

 :proj:

That's all the reason we need!
Cheers,
Joe

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #11 on: January 11, 2024, 07:48:48 AM »
 I am making progress , slowly. I'm trying to abstract the display driver as much as possible to avoid rewriting if i change the hardware. I'm building a simple screen/windowing system loosely based on Kivy  (I suspect I'll run of RAM at some point and be forced to scale it back further).

How many here have played with RPIs PICOs and Python?  Would anyone like me to expand on how this is supposed to work?  Perhaps you could chip in with ideas.

[edit] schematic removed  - first time playing with kicad and got carried away with cut n paste 
« Last Edit: January 12, 2024, 05:25:07 AM by BillTodd »
Bill

Offline AdeV

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2434
  • Country: gb
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #12 on: January 11, 2024, 01:25:34 PM »
I am making progress , slowly. I'm trying to abstract the display driver as much as possible to avoid rewriting if i change the hardware. I'm building a simple screen/windowing system loosely based on Kivy  (I suspect I'll run of RAM at some point and be forced to scale it back further).

How many here have played with RPIs PICOs and Python?  Would anyone like me to expand on how this is supposed to work?  Perhaps you could chip in with ideas.

Can't honestly say I've played with a Pi PICO yet (on the very very very long TODO list!); I have, however, been messing around with GUIs on ESP32s (a sort of Arduino-esque chip with built in WiFi, more speed & RAM). I was also looking, a while back, at doing a DIY DRO (for my lathe, as I already have a 2-axis on the mill), using a Teensy 4.0 to read the scale output, and "something" (never did get that far) to make the actual display. In the end, I just bought a Chinesium 4-axis DRO, mounted 3 of the axes & their head unit, and that's as far as I got...

I've used some medium sized TFTs with the ESP32 - I think 3.2" is the biggest you can drive using SPI, any larger and you're looking at HDMI, and that's a whole different barrel of fish, into which I do not fancy diving... I think my next step would be a regular Raspberry Pi, with an intermediary microcontroller (ESP32 or Teensy) handling the quadrature encoding & spitting out change values to the Pi, which would then update the (large) display accordingly. One then gets into "which programming language to write the display" in, and it turns - again - into a barrel of fish. Specifically, one of those Swedish(?) rotten herring barrels. Ugh.

I even tried using a web-based display with a go backend & react frontend.... but honestly, that seems like massive overkill for a DRO. Plus it's not very fast at updating, and fragile when large amounts of data are being thrown around.

I didn't consider MicroPython, because I hate Python & refuse to learn it. It will be the PHP of the future...
Cheers!
Ade.
--
Location: Wallasey, Merseyside. A long way from anywhere.
Occasionally: Zhengzhou, China. An even longer way from anywhere...

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #13 on: January 11, 2024, 01:48:42 PM »
Interesting, why the hatred of python?  It has become the defacto scripting language for linux, and a lot of neural networks . I think it'll be around a while.

Re using a raspberry pi as a display. That's something I may well do for the grinder project. I'm leaning towards using the existing motors on the Yand Z axes (to save making geared handwheels) and using another pico or two to drive the servo h bridge. Adding a pi might give me enough power to do some simple cnc grinding (of drills etc.)



Bill

Offline AdeV

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2434
  • Country: gb
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #14 on: January 11, 2024, 02:07:38 PM »
Interesting, why the hatred of python?  It has become the defacto scripting language for linux, and a lot of neural networks . I think it'll be around a while.

A few reasons: It's an interpreted script language, which I'm not keen on for starters (I don't like JS much either!); the format of the source code is an integral part of the language, which IMHO makes it harder to read & reason about (especially in a text only paged environment), plus - from what little I've read & seen - it seems to lean heavily on global variables; you can kill one library by importing another that overwrites its keywords...

Probably the biggest for me, though: I've only got a certain amount of brain matter, and I need to know SQL, Typescript, Go, C++, C#, Regex and Bash scripting just for my day-to-day stuff... adding another language in there will force something important out, like remembering to breathe, or how to use a lathe safely! So... it's not for me. It also reminds me a lot of Visual Basic (VB in the early days): One of those languages that "anyone" can learn, then you see what they write & come to the conclusion that whilst anyone CAN learn VB, most probably SHOULDN'T! I also had similar experiences with Microsoft Access ("Anyone can create a database!") - trying to unpick the disaster that someone's created in MS Access is a nightmare, and some years ago, I had to do it multiple times.

So having said all of that: I'm one of those electronics guys that real electronics guys shake their heads about  :lol: :zap:

Re using a raspberry pi as a display. That's something I may well do for the grinder project. I'm leaning towards using the existing motors on the Yand Z axes (to save making geared handwheels) and using another pico or two to drive the servo h bridge. Adding a pi might give me enough power to do some simple cnc grinding (of drills etc.)

The Pi is great, but I wish there was a microcontroller-esque way of programming it. Waiting for Linux to boot before your program starts is - for DROs and similar - a bit of a chore. Yes, a good hacker can get that boot time down to a handful seconds, but for most of us that's going to be beyond our pay grade: If there were a nice, reasonably simple, IDE where one could burn an SD card that booted bare-metal onto the Pi (but with the ability to access the GPIOs, the HDMI, the network, the sound capabilites... then how cool would that be?  Well - so long as it wasn't Python obviously!  :lol:
Cheers!
Ade.
--
Location: Wallasey, Merseyside. A long way from anywhere.
Occasionally: Zhengzhou, China. An even longer way from anywhere...

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #15 on: January 11, 2024, 04:43:54 PM »
The simplest linux gui I've used is Kivy (python  based) . It runs without the desktop overhead, so boots as quickly as linux (i.e.not very fast)

Bill

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #16 on: January 20, 2024, 09:53:16 AM »
Apologies for lack of updates. I been slightly distracted ;

I got my PICO dc servo controller working  after a bit of head scratching and a fight with python's garbage collection.  It means i can use the existing motors on the slides for the surface grinder project

I bought a weather station "from Amazon" which is basically non-functional (does not like the cold) azamon want me to send it back to china (at my expense - so that ain't gonna happen)  - I could have bought the same bad experience from Ebay  for less money - so won't be buying any thing from arze-a-mon again!

I been struggling with a reliable algorithm to scroll text  for the DRO's menu and  fractional display.   
Bill

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #17 on: January 29, 2024, 03:52:45 PM »
I'm making some progress with the software. (If I could remember how to use it, I'd post it on github)

I have built a screen management system to abstract the display driver and avoid having to rewrite everything if I change lcd.

The screens have simple widgets (loosely based on kivi) for text labels and a scrolling text box.

I have a setting menu operating  using the scroll box.

Next step will be a scrolling fraction display.

And at some point I will have to complete the hardware design.
Bill

Offline JamesC

  • Jr. Member
  • **
  • Posts: 15
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #18 on: January 30, 2024, 03:38:10 AM »
Still watching with interest

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #19 on: January 30, 2024, 07:20:38 AM »
Thanks James,

I've just uploaded a short video of the menu



I'd like to find a true monospace font that has consistent width , this one jumps about too much for my liking
Bill

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #20 on: January 30, 2024, 02:19:47 PM »
Aha!
 fixed the font error by editing the font file . No more bouncing numbers .
Bill

Offline AdeV

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2434
  • Country: gb
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #21 on: January 31, 2024, 04:55:33 AM »
Very nice!

If you can implement the sliding woodworker's scale ( :lol: the inch fractional one), that would be the icing on the cake. But it looks like you already have a really nice functional DRO.
Cheers!
Ade.
--
Location: Wallasey, Merseyside. A long way from anywhere.
Occasionally: Zhengzhou, China. An even longer way from anywhere...

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #22 on: January 31, 2024, 05:01:58 AM »
That's today's project  :lol:
Bill

Offline philf

  • Hero Member
  • *****
  • Posts: 1123
  • Country: gb
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #23 on: January 31, 2024, 06:53:57 AM »
If you can implement the sliding woodworker's scale ( :lol: the inch fractional one), that would be the icing on the cake.......
Funnily enough I was thinking the same. I find it much easier to move to a value on a dial rather than via the DRO. (Not that I'd want fractions!)
Phil Fern
Location: Marple, Cheshire

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 1112
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Pi PICO DRO/Quill-Knee combiner
« Reply #24 on: January 31, 2024, 02:55:24 PM »
It's almost working . a couple of quirks to iron out but the PICO seems fast enough.
Not the greatest video , but my camera battery went flat and i could not retake. The ghosting is a problem with the OLED display , I suspect the driver chip setting requires tuning (there are a few pre-charge and current settings to adjust) anyone have any experience?

Shown are 64ths but any divisor can be used (works nicely at 1/16")

&feature=youtu.be
« Last Edit: January 31, 2024, 03:27:32 PM by BillTodd »
Bill