Advanced Search

Search Results (Searched for: )

  • DPFlex
  • DPFlex
19 Jul 2024 03:49 - 19 Jul 2024 04:01
SCARA moving path setup was created by DPFlex

SCARA moving path setup

Category: General LinuxCNC Questions

Hello,
My testing system is Debian Bookworm, LCNC 2.9.3
I tested SCARA moving from position-A to position-B as below video
The End-Point moves from A to B as straight line. It can be high possibility to have singularity situation.
 

File Attachment:

File Name: screencast...0-35.zip
File Size:1,053 KB

I want the moving is as below video. The End-Point moves from A to B as arch line.
 

File Attachment:

File Name: screencast...7-40.zip
File Size:1,113 KB

Can you advise how to do ?.

I compress as zip file so that I can upload here.
Thank you.
 
  • scotta
  • scotta's Avatar
19 Jul 2024 02:00

Remora - ethernet NVEM / EC300 / EC500 cnc board

Category: Computers and Hardware

Hi peeps, I have the ec500 v5 and a stlink v2 I'm struggling to find any info on what pins to connect to my st link. My board has GND, SCK, SWD, PRO-B, 3V3 and BOOT.  Many thanks in advance 

You'll need GND, SCK and SWD and have the board powered from an external source. The ST-Link can't power the board reliably.
  • my1987toyota
  • my1987toyota's Avatar
19 Jul 2024 01:41
Replied by my1987toyota on topic Interesting Youtube Video

Interesting Youtube Video

Category: Off Topic and Test Posts

One thing is for sure, if their was no open source, companies like Apple and Windows would be far worse then they
are now. I still remember here in the states the United States Postal Service wanted people to pay just to send an email
because they felt that email would destroy there revenue stream because they wouldn't be selling the amount of stamps
they used to.
  • PCW
  • PCW's Avatar
18 Jul 2024 22:58
Replied by PCW on topic mesa 7i96s analog spindle

mesa 7i96s analog spindle

Category: Driver Boards

No, the maximum voltage from SPIN- to SPIN+ is 20V
You could use +15 and a DPDT relay
  • Philip Lydin
  • Philip Lydin
18 Jul 2024 22:56
Replied by Philip Lydin on topic mesa 7i96s analog spindle

mesa 7i96s analog spindle

Category: Driver Boards

I have a +/-15v power supply. is it possible to use that? yes it has a spindle enable input.
  • tommylight
  • tommylight's Avatar
18 Jul 2024 22:18
Replied by tommylight on topic Interesting Youtube Video

Interesting Youtube Video

Category: Off Topic and Test Posts

As luck would have, i had seen this today, he makes a lot of good points and some near misses.
Luck, as a while back (probably 6 or more months ago) i had removed him from my watch list as he went on a tangent several times thinking he is the "chosen one", but i am glad he behaved with this.
  • my1987toyota
  • my1987toyota's Avatar
18 Jul 2024 21:53
Interesting Youtube Video was created by my1987toyota

Interesting Youtube Video

Category: Off Topic and Test Posts

So I had seen this video on Youtube. The poster probably should have titled it "Help Save The Future of Open Source".

 
Thoughts?
  • EragonPower
  • EragonPower's Avatar
18 Jul 2024 21:17

HAL Component to bicubic interpolation of a matrix

Category: HAL

Hello everyone,
I'm currently trying to correct a warp in the ways of my machine using a matrix and applying it at external offset.
The thought process is the following: have a XY matrix that contains how much the Z axis should move so that the bed of the machine results flat(I've probed this matrix considering that the bed of my diy CNC is flat as it has just been machined from an outside CNC), I load the matrix into a rt HAL component, the Hal component gets the XY coordinates of the machine, does bicubic interpolation on the matrix to get an accurate Z offset, than I get that offset and put it into external offsets.

Pretty straight forward, no?
Well, not exactly. Not fully understanding how to code HAL components using .comp, I coded this component in C, language that I barely understand better. 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hal.h"
#include "rtapi.h"
#include "rtapi_app.h"
#include "rtapi_math.h"

#define MAX_ROWS 240

typedef struct {
    hal_float_t *x_coord;
    hal_float_t *y_coord;
    hal_float_t *z_output;
    float x_values[MAX_ROWS];
    float y_values[MAX_ROWS];
    float z_values[MAX_ROWS];
    int rows;
} z_offset_t;

static z_offset_t *comp_data;
static int comp_id;

// Function to load the CSV file
void load_csv(const char *filename) {
    FILE *file = fopen(filename, "r");
    if (!file) {
        rtapi_print_msg(RTAPI_MSG_ERR, "Error opening CSV file\n");
        return;
    }

    comp_data->rows = 0;
    while (fscanf(file, "%f,%f,%f",
                  &comp_data->x_values[comp_data->rows],
                  &comp_data->y_values[comp_data->rows],
                  &comp_data->z_values[comp_data->rows]) == 3) {
        comp_data->rows++;
        if (comp_data->rows >= MAX_ROWS) {
            break;
        }
    }

    fclose(file);
}

// Helper function to clamp values to a range
int clamp(int value, int min, int max) {
    if (value < min) return min;
    if (value > max) return max;
    return value;
}

// Function to perform cubic interpolation
float cubicInterpolate(float p[4], float x) {
    return p[1] + 0.5 * x * (p[2] - p[0] + x * (2.0 * p[0] - 5.0 * p[1] + 4.0 * p[2] - p[3] + x * (3.0 * (p[1] - p[2]) + p[3] - p[0])));
}

// Function to perform bicubic interpolation
float bicubicInterpolate(float p[4][4], float x, float y) {
    float arr[4];
    arr[0] = cubicInterpolate(p[0], y);
    arr[1] = cubicInterpolate(p[1], y);
    arr[2] = cubicInterpolate(p[2], y);
    arr[3] = cubicInterpolate(p[3], y);
    return cubicInterpolate(arr, x);
}

// Function to interpolate the Z value using bicubic interpolation
float interpolate(float x, float y) {
    int i, j;
    for (i = 0; i < comp_data->rows - 1; i++) {
        if (x < comp_data->x_values[i + 1]) break;
    }
    for (j = 0; j < comp_data->rows - 1; j++) {
        if (y < comp_data->y_values[j + 1]) break;
    }

    // If coordinates are out of bounds, return 0.0
    if (x < comp_data->x_values[0] || x > comp_data->x_values[comp_data->rows - 1] ||
        y < comp_data->y_values[0] || y > comp_data->y_values[comp_data->rows - 1]) {
        return 0.0;
    }

    float p[4][4];
    for (int m = -1; m <= 2; m++) {
        for (int n = -1; n <= 2; n++) {
            int xi = clamp(i + m, 0, comp_data->rows - 1);
            int yj = clamp(j + n, 0, comp_data->rows - 1);
            p[m + 1][n + 1] = comp_data->z_values[xi];
        }
    }

    float x1 = comp_data->x_values;
    float x2 = comp_data->x_values[i + 1];
    float y1 = comp_data->y_values[j];
    float y2 = comp_data->y_values[j + 1];

    float x_frac = (x - x1) / (x2 - x1);
    float y_frac = (y - y1) / (y2 - y1);

    return bicubicInterpolate(p, x_frac, y_frac);
}

// Update function to read the current X and Y coordinates, interpolate the Z value, and set the Z output
void update(void *arg, long period) {
    if (!comp_data || !comp_data->x_coord || !comp_data->y_coord || !comp_data->z_output) {
        rtapi_print_msg(RTAPI_MSG_ERR, "Null pointer in update function\n");
        return;
    }

    float x = *(comp_data->x_coord);
    float y = *(comp_data->y_coord);

    rtapi_print_msg(RTAPI_MSG_INFO, "Update called with x: %f, y: %f\n", x, y);

    *(comp_data->z_output) = interpolate(x, y);

    rtapi_print_msg(RTAPI_MSG_INFO, "Interpolated z value: %f\n", *(comp_data->z_output));
}

// Component initialization
int rtapi_app_main(void) {
    comp_id = hal_init("z_offset");
    if (comp_id < 0) {
        rtapi_print_msg(RTAPI_MSG_ERR, "hal_init() failed\n");
        return -1;
    }

    comp_data = hal_malloc(sizeof(z_offset_t));
    if (!comp_data) {
        rtapi_print_msg(RTAPI_MSG_ERR, "hal_malloc() failed\n");
        return -1;
    }

    memset(comp_data, 0, sizeof(z_offset_t)); // Ensure comp_data is zero-initialized

    int res = hal_pin_float_new("z_offset.x_coord", HAL_IN, &comp_data->x_coord), comp_id);
    if (res < 0) return res;

    res = hal_pin_float_new("z_offset.y_coord", HAL_IN, &comp_data->y_coord), comp_id);
    if (res < 0) return res;

    res = hal_pin_float_new("z_offset.z_output", HAL_OUT, &comp_data->z_output), comp_id);
    if (res < 0) return res;

    load_csv("/home/linuxcnc/Desktop/CNC/offset_matrix.csv");

    hal_export_funct("z_offset.update", update, comp_data, 1, 0, comp_id);
    hal_ready(comp_id);

    return 0;
}

// Component cleanup
void rtapi_app_exit(void) {
    hal_exit(comp_id);
}

Now. that the code does is to get the matrix from a .csv file (it consists in a three column x 240 rows matrix, containing the x,y,z column and the relative values), get the xy coordinates of the machine, and interpolate the corrisponding z value.

Using this component results in strange values, ranging from absurdly huge ones, to very tiny (in the order of 10E-42) numbers. Has someone an idea on what is messing with this code?

At some point i thought that having negative z values in the input matrix might cause errors, so i've added 10 to the input z value, and subtracted it afterwards, but with no difference, so i've removed it from the code.

I hope that someone more skilled than me could give me some info to move forward.

Thanks a lot in advance to everyone that looks into this
 
  • mark-v-d
  • mark-v-d
18 Jul 2024 21:12 - 18 Jul 2024 21:20
Replied by mark-v-d on topic G71 canned roughing D value - Is this a bug?

G71 canned roughing D value - Is this a bug?

Category: General LinuxCNC Questions

Yes it's a bug. It should be fixed in 2.9.4.

For now you can "fix" this by removing the "N45 X32". line

Or make the X equal to the starting position so "N45 X33"
  • cadcam
  • cadcam
18 Jul 2024 20:51
Replied by cadcam on topic Height map and or points to cloud

Height map and or points to cloud

Category: General LinuxCNC Questions

I did a video on this years ago which should help you -

  • my1987toyota
  • my1987toyota's Avatar
18 Jul 2024 20:38
Replied by my1987toyota on topic Mostly 3D Printed CNC Foam cutter

Mostly 3D Printed CNC Foam cutter

Category: CNC Machines

When I get a chance I will check into that. For now though I already have this SSR .
www.amazon.com/dp/B079BGGVYX?psc=1&ref=p...dt_b_product_details
  • Cant do this anymore bye all
  • Cant do this anymore bye all's Avatar
18 Jul 2024 19:48
Replied by Cant do this anymore bye all on topic SMB share refresh question in debian

SMB share refresh question in debian

Category: Installing LinuxCNC

On the project's GitHub page.
  • sandersjrs
  • sandersjrs
18 Jul 2024 19:13
Replied by sandersjrs on topic Dimensions Slightly Off

Dimensions Slightly Off

Category: Milling Machines

Double update:

It totally works now with all of the shield wires grounded close to signal wires. Still get the rtapi errors, but they don't seem to affect the results.

Thanks all for your help and ideas.
  • Mecanix
  • Mecanix
18 Jul 2024 19:01
Replied by Mecanix on topic Probing: Delay after trigger?

Probing: Delay after trigger?

Category: General LinuxCNC Questions

Fwiw my calibration routine was inspired by github.com/hausen8/EasyProbe

You'll probably need to complete the missing Z calibration, however the X & Y are completed and functional. Have a look. And let us know how you're doing!
  • Mecanix
  • Mecanix
18 Jul 2024 18:53 - 18 Jul 2024 18:54
Replied by Mecanix on topic Probing: Delay after trigger?

Probing: Delay after trigger?

Category: General LinuxCNC Questions

I understand your issue, delay after triggering. Although not a fix (all systems has some sort of delays/accel/decel/ect), the workaround is to use a probe calibration routine. Easier to offset those cal values from the measurement than to real-time the system (imho).

Delay or not, I spec within 5um using cal/offsets.
Displaying 24916 - 24930 out of 25308 results.
Time to create page: 0.459 seconds
Powered by Kunena Forum