# [Beginner] Deriving ratios to show on the UI

06 Oct 2023 02:53 - 06 Oct 2023 03:37 #282413 by rthorntn
Hi,

Apologies if this doesn't make a lot of sense.  Please think of it as thinking around a "semi-manual" lathe that doesn't have any dedicated motors on the carriage or cross-slide.

I should start by emphasizing that I'm not a programmer and that everytime (in the last 30 years) I've tried to program I've hit a brick wall and also I'm a perpetual beginner hobbyist on CNC and machining.  Please be gentle.

​​​​​​So on a lathe lets say you have a spindle RPM encoder, a VFD driven spindle motor and a glass scale on the carriage.

The lathe has a geared head with 6 spindle speeds and manual change gears to change the carriage speed. Does LinuxCNC have a mechanism to calculate and display a readout of projected spindle speeds (6 gears and the VFD changing the actual motor speed) and leadscrew speed (change gear configuration) based on the spindle RPM and the carriage speed?

For the sake of simplicity lets say that you have some way of manually input the current gear setting manually. I think it would be a case of calculating and inputting the 6 speeds into a lookup table for spindle speed.  For feed rate it would be a larger lookup table with all the possible change gear configurations.  I think the math would be something like this:

Rpm ÷ hz = ratio
Ratio x hz = rpm

And:

Rpm ÷ feed rate (micron/sec) = ratio
Ratio x rpm = feed rate

Cheers
Richard
Last edit: 06 Oct 2023 03:37 by rthorntn.

06 Oct 2023 03:22 #282415 by rodw
Yes, you can do anything with linuxcnc
The attched quick and dirty component   does what you want with a 2 pulley belt drive. I use this with a QTdragon_HD panel called belts.ui.
After we developed the panel, its now avalable as an example and documented in the qtdaragon docs.
And yes, I use a VFD with QT dragon.
I measurerd the maximum speed (RPM) with a cheap digital tacho in the fastest gear and then measured the speed of every combintion of belts'I then calculated the gear ratio which  I put into a 2 dimensional array (for the 2 belt) and it scales the output from the VFD to the correct gear.

You can install the panel, and connect this and play with it
Assuming 2.9 on debian, install this like this
sudo apt install linuxcnc-uspace-dev
sudo halcompile --install scalebelts.comp

##### Attachments:
The following user(s) said Thank You: rthorntn