Advanced Search

Search Results (Searched for: )

  • rodw
  • rodw's Avatar
Today 01:24
Replied by rodw on topic Help with Modbus needed

Help with Modbus needed

Category: Advanced Configuration

Looks like register 2 sets the frequency. 7 is the actual frequency
at speed will use the near component to compare the two.
I did a detailed Youtube video showing how to use mb2hal recently. You will find it on my @MrRodW channel,
modbus lete you read concecutive registers in one call.
  • tommylight
  • tommylight's Avatar
Today 21:27
Replied by tommylight on topic Help with Modbus needed

Help with Modbus needed

Category: Advanced Configuration

Please upload pictures and config files here on the forum, not on 3'rd party sites, they contain way to much bad scripts.
  • viesturs.lacis
  • viesturs.lacis
Today 20:25
Help with Modbus needed was created by viesturs.lacis

Help with Modbus needed

Category: Advanced Configuration

Hello!

I need to control Invertek Optidrive E3 VFD from LinuxCNC. I have start/stop signal working from Mesa board output and I can set the speed from potentiometer but the actual user wants to set the speed from g-code to avoid potential mistakes, especially if there will be toolchange and different spindle speeds would be needed for different tools.
The thing is that all 4 analog outputs on Mesa 7i33 board are already used for servodrives, so I was thinking that I could hopefully set the frequency via modbus instead of getting new board just for analog output.
I have usb-to-rs485 converter, lsusb shows it as CH340 chip and I was able to determine that it is using ttyUSB0 port.
Here is the section of Optidrive E3 manual that describes the modbus message contents:
ibb.co/PzFsq8fP

And according to manual I can still have start/stop signal the way I have now even when the drive is in Modbus mode so what I would need is
to send the frequency value (optionally - read actual frequency to determine "spindle-at-speed" and "spindle-is-stopped"):
ibb.co/PGXK2gW5

I tried searching web of how to start and went for mb2hal route.
In HAL file I have:
loadusr -W mb2hal config=mb2hal.ini

Here is contents of mb2hal.ini file:
pastebin.com/h9qHcPR1

I tried looking at pins of mb2hal component in HalShow but the only thing that was changing was a pin that shows number of errors.
mb2hal.ini file has 2 entries about debug messages but I did not even understand where to find them so at the moment I have exactly no idea what is wrong and how to proceed so I would appreciate if someone could hold my hand and then gently poke in correct direction. It seems like a basic thing of what people are doing with VFDs over modbus but I have never done that.
  • dbtayl
  • dbtayl
Today 20:08
Replied by dbtayl on topic Perpetual License CAM

Perpetual License CAM

Category: Show Your Stuff

Looking forward to the 1.0.8 release, sounds like some great improvements!

I'm happy to share the part with you, but I don't really want to post it publicly if I can avoid it. Looks like I can submit a support ticket and attach it there if that works for you.
  • Odessit
  • Odessit
Today 18:51 - Today 19:21

Turn G-code: conversational lathe cycle generator for LinuxCNC (12 cycles)

Category: Show Your Stuff

Update: Archimedean spiral - real cut on video

Here is the face spiral cycle cut on my lathe, start to finish (real cut, not an air run). Two frames are attached; a short video of the whole cut (49 s, sped up 2-4x, with music) is on the cycle page:
turngcode.com/en/features/archimedean-spiral/

I painted the face black before cutting so the spiral is easy to see on camera; the paint went on a bit unevenly, so some lands look thinner than they are. The video colour is slightly corrected for contrast, nothing else is edited.

Parameters: diameter 10 -> 110 mm, 3 starts, 2 mm insert (groove) + 2 mm land = 4 mm per turn, spiral lead 12 mm, 1 mm deep in 3 passes + 1 finishing pass, 50 RPM, right-hand.

How it works: the spiral is a G33 move along X, synchronized with the spindle encoder - the same way threads are cut, only across the face instead of along Z. The program works out the lead from the insert width, the land between turns and the number of starts.

Handy detail: the hand of the spiral is set simply by the order of the diameters. Start at the small diameter and finish at the large one - you get a right-hand spiral. Swap the start and end diameters (cut from the outside in) - and the same cycle gives a left-hand spiral, with the same spindle direction.

More on the geometry, lead and speeds, with a sample program:
turngcode.com/en/blog/archimedean-spiral-face-groove/

Questions and criticism welcome. And here is the cycle form with exactly these parameters (English UI):

- Geometry: start and end diameter, pitch P (the land between turns), insert width, number of starts, depth, number of passes, finishing allowance and finishing passes, plunge feed.
- Spindle: roughing and finishing RPM.
- Approach / retract: safe X/Z and retract X/Z.
- Options: tool T number in the program, coolant M8, comments, M30 at the end, G7/G8 output.

The program works out the real pitch per turn (insert width + land = 4 mm) and the spiral lead (x 3 starts = 12 mm) by itself. The 2D preview on the right shows the planned G33 path and the current pass, so you can check the spiral before the machine moves. Generate writes the .ngc file, Send to LinuxCNC hands it over to LinuxCNC.
  • fmueller
  • fmueller
Today 17:20 - Today 17:32

Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface

Category: General LinuxCNC Questions

Thanks for testing it and for posting the compiler output.

Your report exposed an incompatibility between the original Stepper-Ninja HAL driver and the new HAL API used by LinuxCNC 2.10. I have now added a compatibility layer that supports both the LinuxCNC 2.9 HAL API and the new 2.10 HAL API.

I released the fix as v0.1.1:

github.com/FredericM88/linuxcnc-sim/releases/tag/v0.1.1

I did not want to publish the fix based on compilation alone, so I also built LinuxCNC 2.10.0~pre2 as a Run-In-Place installation and tested the driver with HAL API 1.

The 2.10 tests included:
- loading and unloading the Stepper-Ninja HAL module
- the expected HAL pins and data types
- bidirectional UDP communication with the simulator
- homing using the simulated inputs
- XYZ motion
- G38.2 probing using the virtual probe input
- persistent material removal, including curved motion

I also added support for building the HAL module directly against a configured LinuxCNC Run-In-Place tree. The build system still supports installed LinuxCNC development files and keeps the source-only compile-check mode.

For an installed LinuxCNC development environment, the compatibility driver can be built with:



git clone https://github.com/FredericM88/linuxcnc-sim.git
cd linuxcnc-sim
git checkout v0.1.1

git clone https://github.com/atrex66/stepper-ninja.git ../stepper-ninja-hal
git -C ../stepper-ninja-hal checkout --detach eb7e5dfa2e76477e606a47038b07cca5e8a4b424

cmake -S compat/stepper-ninja -B build/compat-hal \
-DSTEPPER_NINJA_SOURCE="$PWD/../stepper-ninja-hal"

cmake --build build/compat-hal -j"$(nproc)"
ctest --test-dir build/compat-hal --output-on-failure

# Result:
build/compat-hal/stepgen-ninja.so

The simulator itself and the Stepper-Ninja UDP protocol were not changed for this fix.

If you have a chance to try v0.1.1 on your LinuxCNC 2.10 installation, I would be very interested in whether it now builds and loads correctly there as well. That would also give me an independent 2.10 test outside my development system.

Thanks again for trying the project so quickly and for providing the error log.
  • tuxcnc
  • tuxcnc
Today 14:32

Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface

Category: General LinuxCNC Questions

Can't compile ninja hal driver for LinuxCNC 2.10, so your hard work is useless for me.
Building LinuxCNC HAL module stepgen-ninja
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:34:13: note: ‘#pragma message: Ethernet version’
   34 |     #pragma message "Ethernet version"
      |             ^~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:99:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
   99 |     hal_float_t *command[stepgens];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:100:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  100 |     hal_float_t *feedback[stepgens];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:101:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  101 |     hal_float_t *scale[stepgens];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:102:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  102 |     hal_bit_t *mode[stepgens];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:103:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  103 |     hal_bit_t *enable[stepgens];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:104:5: error: unknown type name ‘hal_u32_t’; did you mean ‘hal_uint_t’?
  104 |     hal_u32_t *pulse_width;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:107:5: error: unknown type name ‘hal_s32_t’; did you mean ‘hal_sint_t’?
  107 |     hal_s32_t *raw_count[encoders];
      |     ^~~~~~~~~
      |     hal_sint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:108:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  108 |     hal_float_t *enc_scale[encoders];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:109:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  109 |     hal_float_t *enc_position[encoders];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:110:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  110 |     hal_float_t *enc_velocity[encoders];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:111:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  111 |     hal_bit_t *enc_index[encoders];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:112:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  112 |     hal_bit_t *enc_reset[encoders];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:113:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  113 |     hal_float_t *enc_rpm[encoders];
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:131:5: error: unknown type name ‘hal_s32_t’; did you mean ‘hal_sint_t’?
  131 |     hal_s32_t *jitter;
      |     ^~~~~~~~~
      |     hal_sint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:132:5: error: unknown type name ‘hal_u32_t’; did you mean ‘hal_uint_t’?
  132 |     hal_u32_t *step_ring_fill;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:133:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  133 |     hal_bit_t *step_ring_active;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:134:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  134 |     hal_bit_t *step_ring_underflow;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:135:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  135 |     hal_bit_t *step_ring_overflow;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:136:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  136 |     hal_bit_t *input[96];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:137:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  137 |     hal_bit_t *input_not[96];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:138:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  138 |     hal_bit_t *rpi_input[32];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:139:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  139 |     hal_bit_t *rpi_input_not[32];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:141:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  141 |     hal_bit_t *output[64];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:142:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  142 |     hal_bit_t *rpi_output[32];
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:157:5: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’?
  157 |     hal_float_t *debug_freq;
      |     ^~~~~~~~~~~
      |     hal_port_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:158:5: error: unknown type name ‘hal_s32_t’; did you mean ‘hal_sint_t’?
  158 |     hal_s32_t *debug_steps[stepgens];
      |     ^~~~~~~~~
      |     hal_sint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:159:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  159 |     hal_bit_t *debug_steps_reset;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:161:5: error: unknown type name ‘hal_u32_t’; did you mean ‘hal_uint_t’?
  161 |     hal_u32_t *period;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:162:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  162 |     hal_bit_t *connected;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:163:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  163 |     hal_bit_t *io_ready_in;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:164:5: error: unknown type name ‘hal_bit_t’; did you mean ‘hal_uint_t’?
  164 |     hal_bit_t *io_ready_out;
      |     ^~~~~~~~~
      |     hal_uint_t
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: In function ‘watchdog_process’:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:367:39: warning: unused parameter ‘period’ [-Wunused-parameter]
  367 | void watchdog_process(void *arg, long period)
      |                                  ~~~~~^~~~~~
In file included from /usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:441:
/usr/src/stepper-ninja-hal/hal-driver/modules/breakoutboard_hal_0.c: In function ‘bb_hal_setup_pins’:
/usr/src/stepper-ninja-hal/hal-driver/modules/breakoutboard_hal_0.c:23:13: error: implicit declaration of function ‘hal_pin_bit_newf’ [-Wimplicit-function-declaration]
   23 |         r = hal_pin_bit_newf(HAL_OUT, &d->input[i], comp_id, name, j);
      |             ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: In function ‘_receive’:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:445:27: warning: unused parameter ‘arg’ [-Wunused-parameter]
  445 | static int _receive(void *arg)
      |                     ~~~~~~^~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: In function ‘udp_io_process_recv’:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:480:42: warning: unused parameter ‘period’ [-Wunused-parameter]
  480 | void udp_io_process_recv(void *arg, long period)
      |                                     ~~~~~^~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: In function ‘udp_io_process_send’:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:630:29: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  630 |         if (old_pulse_width != *d->pulse_width) {
      |                             ^~
In file included from /usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:49:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: In function ‘rtapi_app_main’:
/usr/src/stepper-ninja-hal/hal-driver/hal_pin_macros.h:65:13: error: implicit declaration of function ‘hal_pin_u32_newf’ [-Wimplicit-function-declaration]
   65 |         r = hal_pin_u32_newf(dir, ptr, comp_id, name, j); \
      |             ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:882:9: note: in expansion of macro ‘PIN_U32_INIT’
  882 |         PIN_U32_INIT(&hal_data[j].pulse_width, HAL_IN, default_pulse_width, module_name ".%d.stepgen.pulse-width", j);
      |         ^~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/hal_pin_macros.h:77:13: error: implicit declaration of function ‘hal_pin_float_newf’ [-Wimplicit-function-declaration]
   77 |         r = hal_pin_float_newf(dir, ptr, comp_id, name, j); \
      |             ^~~~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:885:13: note: in expansion of macro ‘PIN_FLOAT’
  885 |             PIN_FLOAT(&hal_data[j].debug_freq, HAL_OUT, module_name ".%d.stepgen.max-freq-khz", j);
      |             ^~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/hal_pin_macros.h:31:13: error: implicit declaration of function ‘hal_pin_s32_newf’ [-Wimplicit-function-declaration]
   31 |         r = hal_pin_s32_newf(dir, ptr, comp_id, name, j); \
      |             ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:890:9: note: in expansion of macro ‘PIN_S32’
  890 |         PIN_S32(&hal_data[j].jitter, HAL_OUT, module_name ".%d.jitter", j);
      |         ^~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:980:17: note: ‘#pragma message: Adding export functions. (watchdog)’
  980 |         #pragma message "Adding export functions. (watchdog)"
      |                 ^~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:984:13: error: too many arguments to function ‘hal_export_funct’
  984 |         r = hal_export_funct(watchdog_name, watchdog_process, &hal_data[j], 1, 1, comp_id);
      |             ^~~~~~~~~~~~~~~~
In file included from /usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:4:
/usr/include/linuxcnc/hal.h:807:5: note: declared here
  807 | int hal_export_funct(const char *name, void (*funct) (void *, long),
      |     ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:992:17: note: ‘#pragma message: Adding export functions. (process-send)’
  992 |         #pragma message "Adding export functions. (process-send)"
      |                 ^~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:996:13: error: too many arguments to function ‘hal_export_funct’
  996 |         r = hal_export_funct(process_send, udp_io_process_send, &hal_data[j], 1, 1, comp_id);
      |             ^~~~~~~~~~~~~~~~
/usr/include/linuxcnc/hal.h:807:5: note: declared here
  807 | int hal_export_funct(const char *name, void (*funct) (void *, long),
      |     ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:1004:17: note: ‘#pragma message: Adding export functions. (process-recv)’
 1004 |         #pragma message "Adding export functions. (process-recv)"
      |                 ^~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:1008:13: error: too many arguments to function ‘hal_export_funct’
 1008 |         r = hal_export_funct(process_recv, udp_io_process_recv, &hal_data[j], 1, 1, comp_id);
      |             ^~~~~~~~~~~~~~~~
/usr/include/linuxcnc/hal.h:807:5: note: declared here
  807 | int hal_export_funct(const char *name, void (*funct) (void *, long),
      |     ^~~~~~~~~~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c: At top level:
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:445:12: warning: ‘_receive’ defined but not used [-Wunused-function]
  445 | static int _receive(void *arg)
      |            ^~~~~~~~
/usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:203:17: warning: ‘counter’ defined but not used [-Wunused-variable]
  203 | static uint32_t counter = 0;
      |                 ^~~~~~~
In file included from /usr/src/stepper-ninja-hal/hal-driver/config.h:83,
                 from /usr/src/stepper-ninja-hal/hal-driver/transmission.h:5,
                 from /usr/src/stepper-ninja-hal/hal-driver/stepgen-ninja.c:13:
/usr/src/stepper-ninja-hal/hal-driver/kbmatrix.h:12:14: warning: ‘key_names’ defined but not used [-Wunused-variable]
   12 | static char *key_names[] = {"softkey-00",  // column 0 - row 0
      |              ^~~~~~~~~
gmake[4]: *** [/usr/src/stepper-ninja-hal/hal-driver/build-cmake/stepgen-ninja/Makefile:9: stepgen-ninja.o] Błąd 1
gmake[3]: *** [CMakeFiles/stepgen-ninja.dir/build.make:109: stepgen-ninja/stepgen-ninja.so] Błąd 2
gmake[2]: *** [CMakeFiles/Makefile2:91: CMakeFiles/stepgen-ninja.dir/all] Błąd 2
gmake[1]: *** [CMakeFiles/Makefile2:98: CMakeFiles/stepgen-ninja.dir/rule] Błąd 2
gmake: *** [Makefile:170: stepgen-ninja] Błąd 2
  • fmueller
  • fmueller
Today 12:54 - Today 13:27

Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface

Category: General LinuxCNC Questions

Hi,

I've been working on a standalone CNC machine simulator for LinuxCNC and have now published the first experimental version.

The main idea is that the simulator does NOT interpret G-code itself.

LinuxCNC remains responsible for G-code interpretation, trajectory planning, coordinate systems, offsets and compensation. The simulator sits behind LinuxCNC where real motion hardware would normally be connected.

Currently I use the original Stepper-Ninja HAL driver and its UDP protocol as the interface:

G-code
|
v
LinuxCNC
|
v
Trajectory planner / compensation
|
v
Original Stepper-Ninja HAL driver
|
| UDP
v
linuxcnc-sim
|
+-- virtual machine motion
+-- virtual digital inputs
+-- limit switches
+-- probe input
+-- OpenGL visualization
+-- voxel workpiece
+-- material removal

The important part of this approach is that the simulator sees the motion that LinuxCNC actually sends to the virtual hardware instead of trying to reproduce LinuxCNC's trajectory planner.

 

Communication is bidirectional. The simulator can also send virtual machine inputs back to LinuxCNC. I can already use this for limit switches, homing and a simple configurable probe plane.

The current version also contains a sparse voxel workpiece and persistent material removal. Tool movement is processed as continuous swept volumes rather than just removing material at individual sampled positions.

One interesting problem was performance during curved motion. LinuxCNC can generate many small motion segments. Instead of approximating those segments with a larger chord, I batch the actual swept segments for a short time window and calculate the union of their removal volumes. This keeps the resulting voxel state identical while greatly reducing repeated work.

At the moment the simulation is still quite limited:

- flat-end cutter only
- no geometric stock probing yet
- no toolsetter yet
- no spindle/holder model
- no general collision detection
- no rotary material transform

The next area I would like to work on is geometric contact detection. My idea is to use the same contact system later for workpiece probing, a machine-fixed toolsetter and eventually collision detection.

Stepper-Ninja is currently just the interface between LinuxCNC and the simulator. A physical machine does not need to use Stepper-Ninja hardware. I chose it because an existing LinuxCNC HAL driver and a small bidirectional protocol already existed, so I did not have to invent another LinuxCNC hardware interface.

This is my first public release and I consider it experimental development software, not a machine safety system.

Source and v0.1.0:
github.com/FredericM88/linuxcnc-sim

I would be particularly interested in feedback about the architecture. Does placing the simulator behind LinuxCNC at the hardware interface make sense to you? Are there LinuxCNC behaviours or use cases that would be especially useful to test with this approach?

Frederic
  • trackwhack
  • trackwhack
Today 05:25
Replied by trackwhack on topic Perpetual License CAM

Perpetual License CAM

Category: Show Your Stuff

Hi @dbtayl

Thanks for taking the time to write all of this up, and for the screenshots -- they made every point easy to follow.
Here's where each one stands.
Chamfer running into a wall (your first report): fixed for 1.0.8. An edge run that ends against the part -- a wall, a pocket corner, a slot or step just past the end, a fillet rising from it -- now stops each pass where the tool would touch the part, and a notice tells you how much of the edge is left and where. A free end is cut through, with the tool running on past it into air, and a convex corner runs out the way a CAD chamfer on that edge would. While we were in there we also fixed Mill Chamfer cutting into the faces at the corners of an open chain, and a link between passes that cut across the corner. Every case was measured against the finished part.

AFR list: you were right that something was off -- features you picked by hand were being listed in the AFR panel as if AFR had found them. The AFR list now shows only what AFR detected. Fixed for 1.0.8.

Edge break on a face (your U-shaped top face): picking a flat face for a chamfer currently looks for a modelled chamfer on it, hence the geometry error. We're changing it so that picking a face breaks all of its edges, inside and out, at the width you enter -- the one-click edge break you were after. Auto loop should already walk the whole boundary of that face, and on a look-alike part it does, so something in your geometry stops it. The STEP would let us find out what (see below).

Edge break hitting the boss: reproduced. The rim of a slot is a closed loop, and nothing checked the tool against the rest of the part along the pass. We're extending the check to the whole pass: where the tool would hit the part, it lifts over and carries on past, and tells you what it skipped. Start point control is still on the list as well.

Pocket entry: confirmed. Only the first entry at each depth uses the helix. After a retract -- and a pocket with an island retracts between rings -- the tool comes back down with a straight plunge, and the island also switches Keep tool down off. Every re-entry will follow the entry method you chose: link through area already cleared where it can, otherwise come down in cleared area, otherwise helix, and plunge only when no helix fits, with a notice.

Helix angle: today it's fixed at 3 degrees (you can only set the pitch per turn). We're adding a max ramp angle to each tool in the library, which fills in a ramp angle on every op with a helix or ramp entry, so you can still change it per op.

The green highlight: that's the selected op's picked faces, kept lit on purpose so you can see what the op cuts. It shouldn't hide the toolpath, though -- we'll change how it's drawn once the op has a toolpath.

Adaptive: I couldn't reproduce the stock outside the part being left behind -- a test part with 50 mm of stock all round cleared right to the edge -- so something about your setup is different. On depth of cut, you're right: Adaptive adds extra levels at flat floors, so the depths vary. We'll add a fixed-stepdown option, where every level is the same depth and the floors are left for a finishing op.

Leads: separate lead-in and lead-out, a line or an arc, the arc's sweep -- all noted. That's a bigger piece of work, and it's on the list after the items above.

And I agree with your broader point: give people the plain manual control first, then the convenience. We're going through each Mill op's settings with exactly that in mind.

One ask: could you attach the project file (.tks) and the part's STEP to your bug report on the hub (hub.takshakcam.com)? That will let us see why Adaptive left the outside stock and what stops Auto loop on that face.

Thanks again for the detailed write-up and the kind words. I'll post here when 1.0.8 is out.

Kind Regards,
George
  • dbtayl
  • dbtayl
Yesterday 23:07
Replied by dbtayl on topic Perpetual License CAM

Perpetual License CAM

Category: Show Your Stuff

For context, this is what I'd expect to be able to get out of the Adaptive operation: 

That lets me set the speeds/feeds to optimize MRR within my machine's limits, based on the depth of cut I know it's taking. If it starts taking variable depths of cut, I'm running far slower than I need to for the shallow stepdowns. Not to say Z level detection is a bad feature at all! if I weren't so obsessive about trying to optimize toolpaths, it'd be great to have a one-click option. But it's suboptimal if you're trying to optimize cut time.

I'll try not to be a broken record about this, but IMO give me the dumbest, most manual way of specifying an operation first. Once that's bombproof, make it nicer/easier. Doesn't matter how easy it is if I have no way to get the output I want.

And again... I have strong opinions, they may not reflect the general public's. You should design your software to work for your target demographic, not a single squeaky wheel on a forum.
  • dbtayl
  • dbtayl
Yesterday 22:43
Replied by dbtayl on topic Perpetual License CAM

Perpetual License CAM

Category: Show Your Stuff

I've updated my initial comments to reflect where I mis-represented things.

I'll try to move more detailed bug reporting to your actual system, but quick notes below. Also a reminder that I'm just one voice- what I say isn't law, and the way I expect things to work isn't necessarily "right". So long as you can get to the same end result, there's room for interpretation. It's when you literally can't do what you need to that there's a problem.

Adaptive doesn't clear outside stock, regardless of bounding box vs silhouette selection. This is with bbox (silhouette is even more constrained):
 
(you can also see it cutting a bunch of layers, when I'd really like it to do one depth on the outside and one on the inside- at least the option to control that)

Re AFR: This appears to be a different bug than I presented- it appears cuts you add manually subsequently show up in the AFR list- that caused me to believe it was partially detecting features, when in fact I had only partially selected them.

Re chamfer: The highlighted face is one giving me problems. There's no chamfer modeled on it- I just want to do a slight edge break. The entire contour has tangent end points- tiny radii in the "sharp" corners. If I select the face and try to chamfer, I get an error about the geometry. If I select auto loop, it only touches the outside of the "U" shape. I have yet to get manual selection to work- it's really tedious, and the couple times I've tried it's said it's an open loop and can't connect the edges.
 

Separate chamfer issue- maybe your fix mentioned above will correct it- but it's not just walls. In this case, trying to deburr (again, add a small 0.1mm edge break to the slot in the bottom) will run into the boss marked in yellow. This is one of the places where being able to adjust the start point would be helpful- normally what I do in these cases is to manually offset the start of the path to skip the area that's problematic.
 

Re lead-in/-out: This is more about options than operations that I saw that need it. There are lots of places where more control over the lead is required. Different leads for the lead-in and -out may be appropriate. Sometimes you want to lead in with a tangent line, not an arc. Sometimes you want an arc, but only 60 degrees, not 90.


New thing I just found: Pocket operation doesn't seem to respect the entry method for more than the first pass- you can see one helix entry, then a plunge on the outside pass. Doesn't seem to matter if I check the "keep tool down" box or not.
 
(this also illustrates a second thing I think is a bug- that green face is stuck highlighted, makes it hard to see the toolpaths)

And while I'm being picky... controlling the helix angle is important. Some tools choke at more than 1 degree, others are fine at 5 degrees.

OK, that wasn't that quick... but I'd like to end on a positive note here. Like I said in my initial post, I think the core looks really good here, and you're clearly dedicated to making things better. I really like to see that, and am optimistic you'll get there quickly.
  • NWE
  • NWE's Avatar
Yesterday 20:32
Replied by NWE on topic What once was no longer works.

What once was no longer works.

Category: Configuration Tools


I had an old I5 pc that I am repurposing. I have an old GTX1070 I was trying to get to work with the RT kernel (fail), so the gcode preview wouldn't take so long to load with 5MB+ file sizes.. I get that users can run linuxcnc on PI and other micro controllers, but I thought I could just repurpose this old pc to do the job, and have some cool bigger "out of left field" features. haha
 

Nice. I also enjoy using capable 'almost out-of-date by today's standards' PCs. There's lots of them that run great on linux.
I'm pretty sure I have a couple GTX1070 GPUs around here, I don't recall having much trouble with them, but have not recently run LinuxCNC with RT kernel on one. I might have live-booted it at some point but don't remember how it went. I will certainly try it out soon and if I make any progress on that I will share here.

You mention my project, I assume you are referring to halflow? That one got pushed back lately due to other high priority projects eating all my time. When I get back to it, I want to do a major rewrite of it. My new idea is to spend a lot more time planning the structure before the coding starts. AI/llm all the way. I can read and write bash, python and C++ but AI is just faster.

On several different recent projects I spent literally days planning and refining the whole thing before the coding started. I produce a big detailed text file with help from chatgpt, with the build split into stages and finally give it to claude and basically say go. Of course, it ends up needing lots of follow-up and direction. It produced a more coherent build. Back when I started with halflow I had only a vague idea what the end result was supposed to look like, so I simply plunged into building and trying stuff, eventually it became something of a spaghetti program for lack of a solid plan structure. To date, I've refused to buy anything more than Claude/Chatgpt's entry level $20usd/month plans. When they block me saying my quota is used up I say time for a break.
  • spumco
  • spumco
Yesterday 18:23

Looking for an older CNC mill to refurbish/retrofit

Category: General LinuxCNC Questions

I'm starting a search for an older CNC vertical/knee mill for my home shop and thought I'd introduce myself and ask for advice before buying something.
What machines from this era are worth saving, and what should I inspect before buying?

Thanks in advance
 


It's really dependent on your location.

Some makes/models just aren't available in certain locations.  @tommylight's suggestion of a Maho is fine if you're in Europe, but not in the US.

You'll want to find something local - if not, the transport costs will likely double the cost of an old machine.

And location also dictates - to some extent - the electrical supply you have to work with.

Power, at least in the US, is the primary bottleneck for many home-machinists.  You can hire riggers, build a giant workshop, pour a thick concrete pad... but if you don't have enough amps to your house/location (or your breaker/service is near capacity) then it will be very expensive to upgrade your electrical system to handle a 3-phase converter.  In this case you might still be able to run a Bridgeport-ish sized mill, but you will have to budget for a phase converting VFD as well as single-phase servo drives.

So...

Location?
Budget?
Power availability?  (i.e. what phase/voltage/amps do you have - or can get w/in your budget?)
Maximum work envelope?
Displaying 1 - 15 out of 289407 results.
Time to create page: 7.541 seconds
Powered by Kunena Forum