[Beginner] "Combining" pins to create child pins possible?

More
09 Aug 2023 22:16 - 09 Aug 2023 23:17 #277479 by rthorntn
Hi,

Is it possible to take 2 encoder outputs pins, 1 for Z1 (mill column axis) and 2 for Z2 (mill quill axis) and "combine" them into a third Z axis pin, lets call it Z, so if you move an a Zx axis it will either add or subtract from the child pin value?

​​​​​I'm wanting to use MDRO with my mill and have this "combined" axis on there.

Thanks.
Richard
Last edit: 09 Aug 2023 23:17 by rthorntn.

Please Log in or Create an account to join the conversation.

More
09 Aug 2023 23:17 #277483 by cornholio
Add the 2 counts using sum2, have the gain at 1 and offset at 0. Have a look at the docs. Hmmm maybe not as they use floats.
You could write your own comp, would be fairly easy, the docs walk you through it.
The following user(s) said Thank You: rthorntn

Please Log in or Create an account to join the conversation.

More
11 Aug 2023 19:01 - 11 Aug 2023 19:38 #277659 by beefy
You also have the conversion components:

conv_s32_float       to convert the output of the encoder component to a float (for input to sum2)

conv_float_s32       if you needed to convert the output of sum2 back to an s32 value

However, this is what I like about custom components, no daisy chaining a bunch of ready made components.
Just one component to replace several.

UPDATE:
I took the sum2 component and modified it so it's got s32 inputs and outputs.
I also removed the gain and offset parts to simplify it.
Renamed it sum2s32.comp (attached).
The two input pins are called in0 and in1, and the output pin is called "out"

You'll have to compile it with Halcompile which will convert it to a machine readable file, and will automatically install it in the correct directory.
To do that, open a terminal, and navigate to the directory containing the comp file.
Then type "halcompile --install sum2s32.comp"

Just one more thing. I edited it on a Windows machine in Notepad++
Before compiling it, to check the comp file has the correct line endings, open it in Geany on your Linux PC, and check the line endings are Unix type. One of the drop down menus in Geany has something like "Check line endings".

You say you are a beginner. If you are a beginner to Linux itself (I'm only just scratching the surface), then you may need to look at some tutorials on navigating the directory/file system from the command line. Plenty of them on Youtube.

Good luck.

 

File Attachment:

File Name: sum2s32.comp
File Size:0 KB
Attachments:
Last edit: 11 Aug 2023 19:38 by beefy.
The following user(s) said Thank You: rthorntn, tommylight

Please Log in or Create an account to join the conversation.

More
12 Aug 2023 01:49 #277689 by rthorntn

...
"halcompile --install sum2s32.comp"
...
If you are a beginner to Linux itself


Thanks, this is so cool.

I'm very proficient in Linux, I just can't code for the life of me!

As you can probably tell I would love to extend MDRO to create a kind of frankenmill...

- VFD control
- Power feed on X control
- Tachometer input (my mill has belts)

I don't want to CNC it, just make it easier to use for a beginner and I'm an IT guy so this is how my mind works lol!

Thanks again.
Richard

Please Log in or Create an account to join the conversation.

More
12 Aug 2023 02:12 - 12 Aug 2023 02:17 #277690 by cornholio
To be completely honest you really don't need 2 scales for the Z. One on the quill is fine. Move the head to a good position, touch off with the quill, zero the DRO and you're good to go. Used this method for quite a few years on my mill when it was manual.
When you need to change a tool you'll want to touch off anyways. So moving the head doesn't matter.

Just trying to give an option that wont cost as much and is simple to install.

Found this, might give you some ideas for the mechanical aspect.
www.homemetalshopclub.org/news/13/dro_presentation.pdf
Last edit: 12 Aug 2023 02:17 by cornholio.
The following user(s) said Thank You: rthorntn

Please Log in or Create an account to join the conversation.

Time to create page: 0.143 seconds
Powered by Kunena Forum