Advanced Search

Search Results (Searched for: )

  • Aciera
  • Aciera's Avatar
25 Jul 2024 11:23
Replied by Aciera on topic Possibility of a Retrofit on Alcor 220CNC

Possibility of a Retrofit on Alcor 220CNC

Category: General LinuxCNC Questions

Most important question is what motor drives does the machine use (ie for axis motors and for the spindle). If the current drives accept either analog or step/dir signal then they are usually fine for a refit. If they use some kind of serial interface then things get difficult.
  • Aciera
  • Aciera's Avatar
25 Jul 2024 11:14

[solved] How to set manual tool change remapping in qtdragon. Z limit error

Category: Qtvcp

In other words, when G92/G52 = 0 and G54, the value of <zworkoffset> is "0", right?

That is correct.

The value is around "110", so I think that's the cause.

this would indicate that #5063 (which should hold the Z coordinate value at the time the probe tripped) has the value 'around 110'.

Typing this command in MDI should show the current value of parameter 5063:
(DEBUG, value = #5063)



linuxcnc.org/docs/html/gcode/overview.ht...:numbered-parameters
  • tommylight
  • tommylight's Avatar
25 Jul 2024 10:57
Replied by tommylight on topic Aktuelle hardware mit PCI

Aktuelle hardware mit PCI

Category: Deutsch

Portugal
www.eusurplus.com
Deutchland
www.welectron.com/
Beide haben Mesa karte.
  • SanzuiWorks
  • SanzuiWorks's Avatar
25 Jul 2024 10:50 - 25 Jul 2024 11:53

[solved] How to set manual tool change remapping in qtdragon. Z limit error

Category: Qtvcp

I still don't know the cause, but I think I'm getting a little closer to the answer.


What value does <zworkoffset> represent?

qt_auto_probe_tool.ngc
#<zworkoffset> = [#[5203 + #5220 * 20] + #5213 * #5210]


When calculating using <touch_result>, the results will be more accurate if you omit <zworkoffset>.

qt_auto_probe_tool.ngc
#<touch_result> = [#5063 + #<zworkoffset>]

In other words, when G92/G52 = 0 and G54, the value of <zworkoffset> is "0", right?
<zeorkoffset> value is around "110", so I think that's the cause.
I don't know if the "ini" settings are wrong or what the cause is. Do you know anything?
  • G0G53Z148
  • G0G53Z148's Avatar
25 Jul 2024 10:35 - 25 Jul 2024 10:45
Replied by G0G53Z148 on topic Aktuelle hardware mit PCI

Aktuelle hardware mit PCI

Category: Deutsch

Danke für die infos.

Genau verifizieren kann ich es nicht mehr da ich den adapter schon zurückgegeben habe und ein gebrauchtes mainboard mit 2.6ghz core2 duo mit 4gb ram gekauft habe. Hier liess sich die karte ohne probleme flashen.

Schade nur das nirgends in europa diese mesakarten mehr gehandelt werden. Ich stehe auf jeder Mailingliste doch es kommt nichts nach.

Ich hätte anstelle die 7i76eu gekauft wäre weniger Aufwand gewesen.

Da ich nicht wusste ob die 5i25 funktioniert kaufte ich keine neue hardware. Jetzt soll mal der test laufen dann sehen wir weiter wenn die maschine fertig ist
  • Cant do this anymore bye all
  • Cant do this anymore bye all's Avatar
25 Jul 2024 10:33
Replied by Cant do this anymore bye all on topic Extrernal step gerenation using ESP32+w5500

Extrernal step gerenation using ESP32+w5500

Category: Advanced Configuration

The dev seems active on the github repo, raise the issue there and be patient and wait for a reply.
  • Krulli_Fräser
  • Krulli_Fräser
25 Jul 2024 10:22
Possibility of a Retrofit on Alcor 220CNC was created by Krulli_Fräser

Possibility of a Retrofit on Alcor 220CNC

Category: General LinuxCNC Questions

Greetings everybody,

I´m Matthias from Germany and have recently bought a used CNC-Mill with a defective Heidenhain iTNC530 control. After a long call with the really supportive folks at Heidenhain there are a few easy tests left for me to run, but everything seems to point to a fault in the control's hard drive. In that case I would not only need a new hard drive but also the parameter list from the manufacturer.

However I am not enclined to spend much time and money on this "old"(2005) controller and have another fault in half a years time. If the control ran fine i would be more than happy to use it.

At first glance into the control cabinet the electronics are all in good order and working condition. The big drives for the servos and spindle appear to be functional and it does not look like someone tried tinkering with the machine before. As I understand it, this machine was sold new to a company which then used it until it faulted out and some time after the company went bankrupt and sold the shop with the machine. Now the new owner of the shop has no interest in this non running machine which is why i got it for a good price considering the mechanical state of everything.

I had thought about the possibility of a retrofit with linuxCNC from the moment i knew this machine had a faulty control.
These are a few key points i had in mind:
-Reuse of all motors and drivers (3 axes, 1 spindle, speed control only with vfd, no gearbox)
-Reuse of the Heidenhain monitor and keyboard (if that is feasable and someone knows how to do it)
-Control of other systems like lubrication and hydraulic pump should be no issue as I see it

As this would be my first retrofit and I have no experience with linux or linuxcnc a lot of hand holding will be required. However I am willing to invest a lot of time and effort into this machine. I hope i can get away with buying only a computer and the Mesa cards, but not any servo drives or other high load components.

I hope I can find a lot of helpful and exerienced people here and make a good job of this retrofit.

Best regards
  • andypugh
  • andypugh's Avatar
25 Jul 2024 09:34
Replied by andypugh on topic Yaskawa incremental encoder and Mesa 7i48

Yaskawa incremental encoder and Mesa 7i48

Category: Driver Boards

I wonder if a HAL component could be written to interpret this startup data?
It would rather depend on the rate that it comes in at. It is probably too fast to sample in a servo thread, so can't be directly read from the mesa driver pins.
  • Aciera
  • Aciera's Avatar
25 Jul 2024 09:25
Replied by Aciera on topic Yaskawa incremental encoder and Mesa 7i48

Yaskawa incremental encoder and Mesa 7i48

Category: Driver Boards

There is some information regarding C-Channel in this document:
www.dropbox.com/scl/fi/f43c4x9juh0dsgcp9...y3ktvoa1buw&e=1&dl=0

Relevant sections:

 
 
 

 
  • yathish
  • yathish
25 Jul 2024 08:55 - 25 Jul 2024 08:58

Extrernal step gerenation using ESP32+w5500

Category: Advanced Configuration

Hello Linuxcnc community, I was trying external step generation using ESP32+W5500, I was refering github.com/jzolee/HAL2UDP/blob/main/src/main.cpp. In HAL2UDp/scr/main.cpp , which is nothing but ESP32 side code, the syntax has to be changed because some functions have been combined refer this for changed syntax docs.espressif.com/projects/arduino-esp3...atest/api/timer.html.
This is the updated main.cpp : #include <Arduino.h>
//#include <driver/ledc.h>/
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <esp_task_wdt.h>
/*==================================================================*/
byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 96, 54);
unsigned int port = 58427;
/*==================================================================*/
#define SPI_CS_PIN 5 // hardcoded in Ethernet_mod/src/utility/w5100.h !!!!!!!!!!!!!!
/*==================================================================*/
#define STEP_0_PIN 12
#define STEP_0_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT12)
#define STEP_0_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT12)
#define DIR_0_PIN 13
#define DIR_0_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT13)
#define DIR_0_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT13)
#define STEP_1_PIN 16
#define STEP_1_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT16)
#define STEP_1_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT16)
#define DIR_1_PIN 17
#define DIR_1_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT17)
#define DIR_1_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT17)
#define STEP_2_PIN 21
#define STEP_2_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT21)
#define STEP_2_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT21)
#define DIR_2_PIN 22
#define DIR_2_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT22)
#define DIR_2_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT22)
/*==================================================================*/
#define OUT_00_PIN 2
#define OUT_00_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT2)
#define OUT_00_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT2)
#define OUT_01_PIN 4
#define OUT_01_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT4)
#define OUT_01_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT4)
#define OUT_02_PIN 25
#define OUT_02_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT25)
#define OUT_02_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT25)
#define OUT_03_PIN 1
#define OUT_03_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT1)
#define OUT_03_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT1)
#define OUT_04_PIN 14
#define OUT_04_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT14)
#define OUT_04_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT14)
#define OUT_05_PIN 15
#define OUT_05_H REG_WRITE(GPIO_OUT_W1TS_REG, BIT15)
#define OUT_05_L REG_WRITE(GPIO_OUT_W1TC_REG, BIT15)
/*==================================================================*/
#define IN_00_PIN 26
#define IN_00 REG_READ(GPIO_IN_REG) & BIT26 //26
#define IN_01_PIN 27
#define IN_01 REG_READ(GPIO_IN_REG) & BIT27 //27
#define IN_02_PIN 32
#define IN_02 REG_READ(GPIO_IN1_REG) & BIT0 //32 -32
#define IN_03_PIN 33
#define IN_03 REG_READ(GPIO_IN1_REG) & BIT1 //33 -32
#define IN_04_PIN 34
#define IN_04 REG_READ(GPIO_IN1_REG) & BIT2 //34 -32
#define IN_05_PIN 35
#define IN_05 REG_READ(GPIO_IN1_REG) & BIT3 //35 -32
#define IN_06_PIN 36
#define IN_06 REG_READ(GPIO_IN1_REG) & BIT4 //36 -32
#define IN_07_PIN 39
#define IN_07 REG_READ(GPIO_IN1_REG) & BIT7 //39 -32
/*==================================================================*/
#define CTRL_DIRSETUP 0b00000001
#define CTRL_ACCEL    0b00000010
#define CTRL_PWMFREQ  0b00000100
#define CTRL_READY    0b01000000
#define CTRL_ENABLE   0b10000000
#define IO_00 0b00000001
#define IO_01 0b00000010
#define IO_02 0b00000100
#define IO_03 0b00001000
#define IO_04 0b00010000
#define IO_05 0b00100000
#define IO_06 0b01000000
#define IO_07 0b10000000
/*==================================================================*/
EthernetUDP Udp; // An EthernetUDP instance to let us send and receive packets over UDP
struct cmdPacket {
    uint8_t control;
    uint8_t io;
    uint16_t pwm[6];
    int32_t pos[3];
    float vel[3];
} cmd = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f };
struct fbPacket {
    uint8_t control;
    uint8_t io;
    int32_t pos[3];
    float vel[3];
} fb = { 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f };
/*==================================================================*/
volatile unsigned long ul_dirSetup[3] = { 1000, 1000, 1000 }; // x 25 nanosec
volatile float f_accel_x2[3] = { 1000.0, 1000.0, 1000.0 }; // acceleration*2 step/sec2
/*==================================================================*/
volatile unsigned long ul_cmd_T[3];
unsigned long ul_accelStep[3] = { 0, 0, 0 };
volatile unsigned long ul_T[3] = { 0, 0, 0 };
volatile unsigned long ul_TH[3] = { 0, 0, 0 };
volatile unsigned long ul_TL[3] = { 0, 0, 0 };
volatile bool b_math[3] = { false, false, false };
volatile bool b_dirSignal[3] = { LOW, LOW, LOW };
volatile bool b_dirChange[3] = { false, false, false };
const uint8_t pwm_pin[6] = { OUT_00_PIN, OUT_01_PIN, OUT_02_PIN, OUT_03_PIN, OUT_04_PIN, OUT_05_PIN };
bool pwm_enable[6] = { false, false, false, false, false, false };
/*==================================================================*/
hw_timer_t* stepGen_0 = NULL;
hw_timer_t* stepGen_1 = NULL;
hw_timer_t* stepGen_2 = NULL;
/*==================================================================*/
float IRAM_ATTR fastInvSqrt(const float x)
{
    const float xhalf = x * 0.5f;
    union {
        float x;
        uint32_t i;
    } u = { .x = x };
    u.i = 0x5f3759df - (u.i >> 1);
    return u.x * (1.5f - xhalf * u.x * u.x);
}
/*==================================================================*/
/*float IRAM_ATTR Q_InvSqrt(float x)
{
    float xhalf = x * 0.5f;
    int i = (int)&x; // evil floating point bit level hacking
    i = 0x5f3759df - (i >> 1); // what the fuck?
    x = (float)&i; // convert new bits into float
    x = x * (1.5f - xhalf * x * x); // 1st iteration of Newton's method
    //x = x * (1.5f - xhalf * x * x); // 2nd iteration, this can be removed
    return x;
}*/
/*==================================================================*/
void IRAM_ATTR onTime_0()
{
    static bool b_stepState = LOW;
    static bool b_dirState = LOW;
    if (b_stepState == LOW) { // end of period
        if (ul_T[0]) { // there is a period time so a pulse must be started
            if (!b_dirChange[0]) { //direction is good, start a new pulse (step L-H transition)
                STEP_0_H;
                timerWrite(stepGen_0, ul_TH[0]);
                b_stepState = HIGH;
                b_dirState ? fb.pos[0]++ : fb.pos[0]--;
                b_math[0] = true; // calculation of a new period time
            } else { // need to change direction
                if (b_dirSignal[0]) {
                    DIR_0_H;
                    b_dirState = HIGH;
                } else {
                    DIR_0_L;
                    b_dirState = LOW;
                }
                timerWrite(stepGen_0, ul_dirSetup[0]);
                b_dirChange[0] = false;
            }
        } else { // no need to step pulse
            timerWrite(stepGen_0, 4000ul); // 0,1 millis scan
            b_math[0] = true; // calculation of a new period time
        }
    } else { // the middle of the period time (step H-L transition)
        STEP_0_L;
        timerWrite(stepGen_0, ul_TL[0]);
        b_stepState = LOW;
    }
}
/*==================================================================*/
void IRAM_ATTR onTime_1()
{
    static bool b_stepState = LOW;
    static bool b_dirState = LOW;
    if (b_stepState == LOW) { // end of period
        if (ul_T[1]) { // there is a period time so a pulse must be started
            if (!b_dirChange[1]) { //direction is good, start a new pulse (step L-H transition)
                STEP_1_H;
                timerWrite(stepGen_1, ul_TH[1]);
                b_stepState = HIGH;
                b_dirState ? fb.pos[1]++ : fb.pos[1]--;
                b_math[1] = true; // calculation of a new period time
            } else { // need to change direction
                if (b_dirSignal[1]) {
                    DIR_1_H;
                    b_dirState = HIGH;
                } else {
                    DIR_1_L;
                    b_dirState = LOW;
                }
                timerWrite(stepGen_1, ul_dirSetup[1]);
                b_dirChange[1] = false;
            }
        } else { // no need to step pulse
            timerWrite(stepGen_1, 4000ul); // 0,1 millis scan
            b_math[1] = true; // calculation of a new period time
        }
    } else { // the middle of the period time (step H-L transition)
        STEP_1_L;
        timerWrite(stepGen_1, ul_TL[1]);
        b_stepState = LOW;
    }
}
/*==================================================================*/
void IRAM_ATTR onTime_2()
{
    static bool b_stepState = LOW;
    static bool b_dirState = LOW;
    if (b_stepState == LOW) { // end of period
        if (ul_T[2]) { // there is a period time so a pulse must be started
            if (!b_dirChange[2]) { //direction is good, start a new pulse (step L-H transition)
                STEP_2_H;
                timerWrite(stepGen_2, ul_TH[2]);
                b_stepState = HIGH;
                b_dirState ? fb.pos[2]++ : fb.pos[2]--;
                b_math[2] = true; // calculation of a new period time
            } else { // need to change direction
                if (b_dirSignal[2]) {
                    DIR_2_H;
                    b_dirState = HIGH;
                } else {
                    DIR_2_L;
                    b_dirState = LOW;
                }
                timerWrite(stepGen_2, ul_dirSetup[2]);
                b_dirChange[2] = false;
            }
        } else { // no need to step pulse
            timerWrite(stepGen_2, 4000ul); // 0,1 millis scan
            b_math[2] = true; // calculation of a new period time
        }
    } else { // the middle of the period time (step H-L transition)
        STEP_2_L;
        timerWrite(stepGen_2, ul_TL[2]);
        b_stepState = LOW;
    }
}
/*==================================================================*/
void IRAM_ATTR newT(const int i) // period time calculation
{
    //ul_T = 40000000.0f / sqrtf((float)(ul_accelStep * ul_accel_x2));
    ul_T = 40000000.0f * fastInvSqrt((float)ul_accelStep * f_accel_x2); // fast method (>3x)
    ul_TH = ul_T >> 1;
    ul_TL = ul_T - ul_TH;
}
/*==================================================================*/
void IRAM_ATTR deceleration(const int i)
{
    if (ul_accelStep) {
        ul_accelStep--;
        if (ul_accelStep)
            newT(i);
        else
            ul_T = 0;
    }
}
/*==================================================================*/
void IRAM_ATTR acceleration(const int i)
{
    if (cmd.control & CTRL_ENABLE) {
        ul_accelStep++;
        newT(i);
    } else
        deceleration(i);
}
/*==================================================================*/
void IRAM_ATTR outputHandler() {
    static int last_pwm[6] = { 0, 0, 0, 0, 0, 0 };
    bool enable = cmd.control & CTRL_ENABLE;
    if (pwm_enable[0]) {
        if (enable) {
            if (last_pwm[0] != cmd.pwm[0]) {
                last_pwm[0] = cmd.pwm[0];
                ledcWrite(0, last_pwm[0]);
            }
        } else {
            ledcWrite(0, 0);
            last_pwm[0] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_00) {
                OUT_00_H;
            } else {
                OUT_00_L;
            }
        } else {
            OUT_00_L;
        }
    }
    if (pwm_enable[1]) {
        if (enable) {
            if (last_pwm[1] != cmd.pwm[1]) {
                last_pwm[1] = cmd.pwm[1];
                ledcWrite(2, last_pwm[1]);
            }
        } else {
            ledcWrite(2, 0);
            last_pwm[1] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_01) {
                OUT_01_H;
            } else {
                OUT_01_L;
            }
        } else {
            OUT_01_L;
        }
    }
    if (pwm_enable[2]) {
        if (enable) {
            if (last_pwm[2] != cmd.pwm[2]) {
                last_pwm[2] = cmd.pwm[2];
                ledcWrite(4, last_pwm[2]);
            }
        } else {
            ledcWrite(4, 0);
            last_pwm[2] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_02) {
                OUT_02_H;
            } else {
                OUT_02_L;
            }
        } else {
            OUT_02_L;
        }
    }
    if (pwm_enable[3]) {
        if (enable) {
            if (last_pwm[3] != cmd.pwm[3]) {
                last_pwm[3] = cmd.pwm[3];
                ledcWrite(6, last_pwm[3]);
            }
        } else {
            ledcWrite(6, 0);
            last_pwm[3] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_03) {
                OUT_03_H;
            } else {
                OUT_03_L;
            }
        } else {
            OUT_03_L;
        }
    }
    if (pwm_enable[4]) {
        if (enable) {
            if (last_pwm[4] != cmd.pwm[4]) {
                last_pwm[4] = cmd.pwm[4];
                ledcWrite(8, last_pwm[4]);
            }
        } else {
            ledcWrite(8, 0);
            last_pwm[4] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_04) {
                OUT_04_H;
            } else {
                OUT_04_L;
            }
        } else {
            OUT_04_L;
        }
    }
    if (pwm_enable[5]) {
        if (enable) {
            if (last_pwm[5] != cmd.pwm[5]) {
                last_pwm[5] = cmd.pwm[5];
                ledcWrite(10, last_pwm[5]);
            }
        } else {
            ledcWrite(10, 0);
            last_pwm[5] = 0;
        }
    } else {
        if (enable) {
            if (cmd.io & IO_05) {
                OUT_05_H;
            } else {
                OUT_05_L;
            }
        } else {
            OUT_05_L;
        }
    }
}
/*==================================================================*/
void IRAM_ATTR inputHandler()
{
    (IN_00) ? fb.io = IO_00 : fb.io = 0;
    if (IN_01)
        fb.io |= IO_01;
    if (IN_02)
        fb.io |= IO_02;
    if (IN_03)
        fb.io |= IO_03;
    if (IN_04)
        fb.io |= IO_04;
    if (IN_05)
        fb.io |= IO_05;
    if (IN_06)
        fb.io |= IO_06;
    if (IN_07)
        fb.io |= IO_07;
}
/*==================================================================*/
void IRAM_ATTR commandHandler()
{
    if (cmd.control & CTRL_READY) {
        Serial.println("Handling CTRL_READY");
        for (int i = 0; i < 3; i++) {
            if (cmd.vel > 0.0f)
                ul_cmd_T = (unsigned long)(40000000.0f / cmd.vel);
            else if (cmd.vel < 0.0f)
                ul_cmd_T = (unsigned long)(40000000.0f / -cmd.vel);
            else
                ul_cmd_T = 40000000ul;
        }
    }
    if (!(fb.control & CTRL_READY)) {
        Serial.println("fb.control not ready");
        if ((fb.control & CTRL_DIRSETUP)
            && (fb.control & CTRL_ACCEL)
            && (fb.control & CTRL_PWMFREQ)) {
            fb.control |= CTRL_READY;
            Serial.println("CTRL_READY set");
        } else if (cmd.control & CTRL_DIRSETUP) {
            fb.control |= CTRL_DIRSETUP;
            for (int i = 0; i < 3; i++)
                ul_dirSetup = cmd.pos / 25; //   25ns / timer tic
            Serial.println("CTRL_DIRSETUP set");
        } else if (cmd.control & CTRL_ACCEL) {
            fb.control |= CTRL_ACCEL;
            for (int i = 0; i < 3; i++)
                f_accel_x2 = (float)cmd.pos * 2.0;
            Serial.println("CTRL_ACCEL set");
        } else if (cmd.control & CTRL_PWMFREQ) {
            fb.control |= CTRL_PWMFREQ;
            for (int i = 0; i < 6; i++) {
                if (cmd.pwm) {
                    ledcAttach(pwm_pin, i * 2, true);
                    ledcAttach(pwm_pin, cmd.pwm, 10);
                    ledcWrite(i * 2, 0);
                    pwm_enable = true;
                    Serial.print("PWM enabled for pin ");
                    Serial.println(pwm_pin);
                } else {
                    if (i == 0) {
                        pinMode(OUT_00_PIN, OUTPUT);
                        digitalWrite(OUT_00_PIN, 0);
                    } else if (i == 1) {
                        pinMode(OUT_01_PIN, OUTPUT);
                        digitalWrite(OUT_01_PIN, 0);
                    } else if (i == 2) {
                        pinMode(OUT_02_PIN, OUTPUT);
                        digitalWrite(OUT_02_PIN, 0);
                    } else if (i == 3) {
                        pinMode(OUT_03_PIN, OUTPUT);
                        digitalWrite(OUT_03_PIN, 0);
                    } else if (i == 4) {
                        pinMode(OUT_04_PIN, OUTPUT);
                        digitalWrite(OUT_04_PIN, 0);
                    } else if (i == 5) {
                        pinMode(OUT_05_PIN, OUTPUT);
                        digitalWrite(OUT_05_PIN, 0);
                    }
                }
            }
        }
    }
}
/*==================================================================*/
void IRAM_ATTR loop_Core0(void* parameter)
{
    delay(500);
    Udp.parsePacket(); /* to empty buffer */
    for (;;) {
        Serial.println("Inside loop_Core0");
        static unsigned long ul_watchdog;
        if (Udp.parsePacket() == sizeof(cmd) + 1) {
            char packetBuffer[60]; // buffer for receiving and sending data
            Udp.read(packetBuffer, sizeof(cmd) + 1);
            uint8_t chk = 71;
            for (int i = 0; i < sizeof(cmd); i++)
                chk ^= packetBuffer;
            if (packetBuffer[sizeof(cmd)] == chk) {
                memcpy(&cmd, &packetBuffer, sizeof(cmd));
                commandHandler();
                ul_watchdog = millis();
            }
            inputHandler();
            for (int i = 0; i < 3; i++) {
                unsigned long ul_t = ul_T;
                if (ul_t)
                    b_dirSignal ? fb.vel = 40000000.0f / (float)ul_t : fb.vel = -40000000.0f / (float)ul_t;
                else
                    fb.vel = 0.0f;
            }
            memcpy(&packetBuffer, &fb, sizeof(fb));
            Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
            Udp.write(packetBuffer, sizeof(fb));
            Udp.endPacket();
            outputHandler();
        }
        if (millis() - ul_watchdog > 10ul) {
            fb.control = 0;
            cmd.control = 0;
            outputHandler();
            ul_watchdog = millis();
        }
        esp_task_wdt_reset();
    }
}
/*==================================================================*/
void setup_Core0(void* parameter)
{  
    disableCore0WDT(); // Disable Core0 Watchdog Timer
    //disableCore1WDT(); // Disable Core1 Watchdog Timer
   
    pinMode(IN_00_PIN, INPUT_PULLUP);
    pinMode(IN_01_PIN, INPUT_PULLUP);
    pinMode(IN_02_PIN, INPUT_PULLUP);
    pinMode(IN_03_PIN, INPUT_PULLUP);
    pinMode(IN_04_PIN, INPUT);
    pinMode(IN_05_PIN, INPUT);
    pinMode(IN_06_PIN, INPUT);
    pinMode(IN_07_PIN, INPUT);
    delay(500);
    Ethernet.init(SPI_CS_PIN); /* You can use Ethernet.init(pin) to configure the CS pin */
    Ethernet.begin(mac, ip); /* start the Ethernet */
    delay(500);
    Udp.begin(port); /* start UDP */
    delay(100);
    xTaskCreatePinnedToCore(
        loop_Core0, // Task function.
        "loopTask_Core0", // name of task.
        1024, // Stack size of task, // Stack size of task
        NULL, // parameter of the task
        0, // priority of the task (changed to 1)
        NULL, // Task handle to keep track of created task
        0); // pin task to core 0
    //disableCore0WDT();
    vTaskDelete(NULL);
}
/*==================================================================*/
void setup()
{
    Serial.begin(9600);
    //disableCore0WDT(); // Disable Core0 Watchdog Timer
    //disableCore1WDT(); // Disable Core1 Watchdog Timer
   
    pinMode(STEP_0_PIN, OUTPUT);
    digitalWrite(STEP_0_PIN, 0);
    pinMode(DIR_0_PIN, OUTPUT);
    digitalWrite(DIR_0_PIN, 0);
    pinMode(STEP_1_PIN, OUTPUT);
    digitalWrite(STEP_1_PIN, 0);
    pinMode(DIR_1_PIN, OUTPUT);
    digitalWrite(DIR_1_PIN, 0);
    pinMode(STEP_2_PIN, OUTPUT);
    digitalWrite(STEP_2_PIN, 0);
    pinMode(DIR_2_PIN, OUTPUT);
    digitalWrite(DIR_2_PIN, 0);
    // Configure the timers
 // Set timer frequency to 1 MHz (1,000,000 Hz)
    stepGen_0 = timerBegin(1000000); // Timer 0
    stepGen_1 = timerBegin(1000000); // Timer 1
    stepGen_2 = timerBegin(1000000); // Timer 2
    // Attach the interrupt service routine (ISR) `onTime_0` to Timer 0.
    timerAttachInterrupt(stepGen_0, &onTime_0);
    // Attach the ISR `onTime_1` to Timer 1.
    timerAttachInterrupt(stepGen_1, &onTime_1);
    // Attach the ISR `onTime_2` to Timer 2.
    timerAttachInterrupt(stepGen_2, &onTime_2);
    // Set the alarm value for Timer 0 to 40,000,000 microseconds (40 seconds).
    timerAlarm(stepGen_0, 40000000, true, 0);
    // Set the alarm value for Timer 1 to 40,000,000 microseconds (40 seconds).
    timerAlarm(stepGen_1, 40000000, true, 0);
    // Set the alarm value for Timer 2 to 40,000,000 microseconds (40 seconds).
    timerAlarm(stepGen_2, 40000000, true, 0);
    // Start Timer 0.
   // timerStart(stepGen_0);
    // Start Timer 1.
  //  timerStart(stepGen_1);
    // Start Timer 2.
  //  timerStart(stepGen_2);
    xTaskCreatePinnedToCore(
        setup_Core0, // Task function.
        "setup_Core0Task", // name of task.
        1024, // Stack size of task
        NULL, // parameter of the task
        0, // priority of the task
        NULL, // Task handle to keep track of created task
        0); // pin task to core 0
    //vTaskDelete(NULL);
}
/*==================================================================*/
void IRAM_ATTR loop()
{
    for (int i = 0; i < 3; i++) {
        if (b_math) {
            Serial.print("Math processing for axis: ");
            Serial.println(i);
            b_math = false;
            if (!ul_accelStep) { // the axis is stationary
                long l_pos_error = cmd.pos - fb.pos;
                Serial.print("Position error for axis ");
                Serial.print(i);
                Serial.print(": ");
                Serial.println(l_pos_error);
                if (l_pos_error) { // if there is a position error
                    if ((l_pos_error > 0 && b_dirSignal == HIGH) || (l_pos_error < 0 && b_dirSignal == LOW)) // the direction is good
                        acceleration(i);
                    else { // need to change direction
                        (l_pos_error > 0) ? b_dirSignal = HIGH : b_dirSignal = LOW;
                        b_dirChange = true;
                        Serial.print("Changing direction for axis ");
                        Serial.println(i);
                    }
                }
            } else { // the axis moves
                Serial.print("Axis ");
                Serial.print(i);
                Serial.println(" is moving");
                if ((cmd.vel > 0.0f && b_dirSignal == HIGH) || (cmd.vel < 0.0f && b_dirSignal == LOW)) { // the direction is good
                    if (ul_T > ul_cmd_T) // the speed is low
                        acceleration(i);
                    else if (ul_T < ul_cmd_T) // the speed is high
                        deceleration(i);
                } else // the direction is wrong or the target speed is zero
                    deceleration(i);
            }
        }
    }
}

But still im getting error as 
ELF file SHA256: 78d5431e5da1b11c

 Rebooting...
�E (123) task_wdt: esp_task_wdt_reset(763): task not found
E (124) task_wdt: esp_task_wdt_reset(763): task not found
E (125) task_wdt: esp_task_wdt_reset(763): task not found
E (173) task_wdt: esp_task_wdt_reset(763): task not found
E (235) task_wdt: esp_task_wdt_reset(763): task not found
E (296) task_wdt: esp_task_wdt_reset(763): task not found
E (358) task_wdt: esp_task_wdt_reset(763): task not found
E (419) task_wdt: esp_task_wdt_reset(763): task not found
E (481) task_wdt: esp_task_wdt_reset(763): task not found
E (542) task_wdt: esp_task_wdt_reset(763): task not found
E (604) task_wdt: esp_task_wdt_reset(763): task not found
Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (setup_Core0Task)
Core 0 register dump:
PC : 0x4008b56c PS : 0x00060a36 A0 : 0x40084766 A1 : 0x3ffb8c90
A2 : 0x00000000 A3 : 0x3ffc1f7c A4 : 0xffffffff A5 : 0x3ffc221c
A6 : 0x00000227 A7 : 0x00000000 A8 : 0x80083ad8 A9 : 0x3ffb8d30
A10 : 0x3ff000dc A11 : 0x00000001 A12 : 0x00060620 A13 : 0x3f407040
A14 : 0x80000000 A15 : 0x00060021 SAR : 0x00000007 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x400868c0 LEND : 0x400868d6 LCOUNT : 0x00000000

 
 Backtrace: 0x4008b569:0x3ffb8c90 0x40084763:0x3ffb8d70 0x400d4275:0x3ffb8d90 0x400d2e5b:0x3ffb8db0 0x400d1e97:0x3ffb8de0 0x400d1f3c:0x3ffb8e10 0x400d1f9d:0x3ffb8ec0 0x400d1ff0:0x3ffb8f60 0x400d18fd:0x3ffb8fe0 0x4008b1fd:0x3ffb9030

 
  • yathish
  • yathish
25 Jul 2024 08:49
Replied by yathish on topic ESP32 HAL2UDP setup for linux CNC noob.

ESP32 HAL2UDP setup for linux CNC noob.

Category: Computers and Hardware

Even im stuck with this problem can anyone help
  • karoria
  • karoria
25 Jul 2024 07:40
Replied by karoria on topic New interface for small display!

New interface for small display!

Category: Qtvcp

I was looking for similar setup since long. I am waiting for this project to go live for users. Thanks for your efforts.
  • viesturs.lacis
  • viesturs.lacis
25 Jul 2024 07:08
Replied by viesturs.lacis on topic Yaskawa incremental encoder and Mesa 7i48

Yaskawa incremental encoder and Mesa 7i48

Category: Driver Boards

I spent quite a few hours yesterday watching A, B and C lines (as well as rawcounts value) in HalScope and I found a nice pattern there. I have created excel spreadsheet where I tried to draw those graphs with cell boarders and also wrote the rawcounts values at which those transitions take place (basically only transitions are shown, everything in middle is ommited).
docs.google.com/spreadsheets/d/1M04yZmUE...2&rtpof=true&sd=true

I have plotted full revolution of motor shaft, there are 24 transitions (25th is the same as 1st). The pattern repeats 4 times (that is 8 pole motor - 4 electrical revolutions), so pattern is divided in 6 parts of similar length.I should note that difference of rawcounts between 1st and 25th transition is slightly more than expected for 8192 CPR encoder, but I was having realtime errors as I tried to use TightVNC to connect to the LinuxCNC PC from my laptop so that I could see the screen (most importantly - numbers there) while standing near the motor and turning it. But it was so slow on updating screen that I ended running back and forth to the PC anyway.

One more thing - there were several occasions where I noticed strange spikes in C graphs. At first I thought that those are glitches etc, but at one time when I saw it again I tried to catch that place again in HalScope. So I got 3 repetitions and all 3 attempts show a spike there so that makes me think that something similar to index pulse is integrated in C channel (I have attached all three log files for this spike, it is between rawcounts 33658 and 33659, I changed the extension from csv to txt, because adding csv files is not allowed).I did save log files for almost all other transitions as well if that helps (forgot to save 2 or 3 due to lack of concentration as it was around midnight).

Is there any chance to get anything meaningful out of this? I would like to think that this pattern can be used similarly to Hall sensor feedback.

And this thread alone shows that I am not the only one who would had liked to use Yaskawa motors (I have one more machine that will need replacement of at least 2 drives and one previous retrofit that also is not working anymore because of drive faults and would need to be reanimated).
  • jimmyrig
  • jimmyrig
25 Jul 2024 02:10
Replied by jimmyrig on topic Mesa 7i96s + DM556T -> Motors not moving

Mesa 7i96s + DM556T -> Motors not moving

Category: Driver Boards

Stepper online drivers have a 24v and a 5v logic switch at the top. It needs to be 5v for the mesa
  • PCW
  • PCW's Avatar
25 Jul 2024 01:51

Mesa 7i96s + DM556T -> Motors not moving

Category: Driver Boards

DIR0+ would be TB1 pin 5 for example
Displaying 24241 - 24255 out of 25551 results.
Time to create page: 0.541 seconds
Powered by Kunena Forum