Advanced Search

Search Results (Searched for: )

  • Aciera
  • Aciera's Avatar
07 Dec 2024 08:31
  • Deje63
  • Deje63
07 Dec 2024 08:30
Replied by Deje63 on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

I do not see Images for LinuxCNC 2.9.3 on the Download page, am I blind?
With the ones provided I ended up in 640x480 display resolution, no idea why. But I could not use it.

To me, this is a big difference. ;)

btw. build time is no issue on the RPI5.
  • Pele
  • Pele
07 Dec 2024 08:29

ASD B3 0121 L Loses connection with computer when Servo On

Category: Driver Boards

I have such a problem when I turn on the servo driver of the servo drive b3 0121 L model, it connects successfully via mini usb and when I start the servo, that is, turn on the Servo On, the computer loses connection with the sevro driver or the draver stops responding and when this mode is turned on, not much noise is barely audible from the driver. I don't have any ideas about this problem.

The problem is observed both in Linux (ubuntu distribution) and in Windows (11 pro)
  • abdulasis12
  • abdulasis12
07 Dec 2024 06:38

Feedback control XY not full speed run G1 when curve or Arc

Category: General LinuxCNC Questions

Hi
I use servo motor 750W  and encoder from motor connect to 7i77  X and Y axis Feedback control
I use fusion360 for CAM and option G64 P0.002 Q0.002
when my cnc run process  Adaptive clearing toolpath is curve or  Arc  I few cnc base little jerky and feed in Gcode(G1) is 1200 mm/mins but CNC just run 100-300 mm/mins
How to fix this problem ?
I don't know where setting wrong.

Thank you
Asis

 
 
 
  • SOLD
  • SOLD
07 Dec 2024 06:08
Replied by SOLD on topic AX58100

AX58100

Category: EtherCAT

I have an idea to add M19 function inside STM32 so that it can manage the Orientation process by itself, receiving M19 command or just 1 button from lcnc.

I tried to let Ai create a sample code according to my needs. It came out as follows. Of course, it still doesn't work. And the Obj variable that can't handle it. I don't have the knowledge to create a new program.
#include "OrientationHandler.h"
#include <Arduino.h>
#include "MyEncoder.h"

extern HardwareSerial Serial1;
extern MyEncoder Encoder1;
extern double spindleTargetPos;  // ตัวแปรใหม่ที่ใช้เก็บตำแหน่งเป้าหมายสำหรับสปินเดิล
extern const byte DAC1_pin;      // ขาสำหรับเชื่อมต่อสัญญาณอนาล็อก (0-10V)
extern _Objects Obj;

// ฟังก์ชันคำนวณทิศทางที่สั้นที่สุดในการหมุน
int calculateShortestAngle(int currentAngle, int targetAngle)
{
    // ทำให้มุมทั้งหมดอยู่ในช่วง 0-360 องศา
    currentAngle = currentAngle % 360;
    targetAngle = targetAngle % 360;
    
    // คำนวณความแตกต่างระหว่างมุม
    int deltaAngle = targetAngle - currentAngle;
    
    // ถ้าความแตกต่างมากกว่า 180 องศา ให้เลือกหมุนทางที่สั้นที่สุด
    if (deltaAngle > 180)
        deltaAngle -= 360;
    else if (deltaAngle < -180)
        deltaAngle += 360;

    return deltaAngle;  // ผลลัพธ์เป็นมุมที่ใกล้ที่สุดในการหมุน
}

// ฟังก์ชันสำหรับการหมุนสปินเดิลไปยังมุมที่กำหนด
void spindleOrientation(int targetAngle)
{
    Serial1.println("คำสั่ง M19 ได้รับแล้ว กำลังหมุนสปินเดิลไปยังมุมเป้าหมาย...");
    
    int currentAngle = Encoder1.currentPos();  // อ่านมุมปัจจุบันของสปินเดิล
    int deltaAngle = calculateShortestAngle(currentAngle, targetAngle);  // คำนวณมุมที่ใกล้ที่สุดที่ควรหมุน

    Serial1.print("มุมที่ใกล้ที่สุด: ");
    Serial1.println(deltaAngle);

    // ถ้ามุมที่ต้องการคือ 0 หรือใกล้เคียง (ไม่ต้องหมุน)
    if (fabs(deltaAngle) <= 0.01)
    {
        Serial1.println("ตำแหน่งปัจจุบันตรงกับตำแหน่งที่ต้องการ ไม่ต้องหมุน");
        analogWrite(DAC1_pin, 0);  // หยุดการหมุน
        Obj.SpindleStatus = 1;  // หมายเลข 1 สำหรับสำเร็จ
        return;  // ออกจากฟังก์ชัน
    }

    // คำนวณค่าอนาล็อกเพื่อควบคุมแรงดัน 0-10V (ใช้ map แปลงจากมุมที่ต้องหมุนเป็นค่าที่ใช้กับ analogWrite)
    int analogValue = map(abs(deltaAngle), 0, 360, 0, 255);
    if (analogValue > 255) analogValue = 255; // ตรวจสอบให้ค่าไม่เกิน 255

    // กำหนดทิศทางการหมุนและควบคุมมอเตอร์
    if (deltaAngle > 0)  // หมุนไปทางขวา (clockwise)
    {
        analogWrite(DAC1_pin, analogValue);
        Serial1.println("หมุนไปทางขวา (clockwise)");
    }
    else if (deltaAngle < 0)  // หมุนไปทางซ้าย (counterclockwise)
    {
        analogWrite(DAC1_pin, analogValue);
        Serial1.println("หมุนไปทางซ้าย (counterclockwise)");
    }
    
    // ตั้งเวลาหมุนสูงสุด (timeout) เช่น 5 วินาที
    unsigned long startTime = millis();
    unsigned long timeout = 5000;  // เวลา 5 วินาที

    // รอจนกว่าสปินเดิลจะถึงตำแหน่งเป้าหมาย หรือจนถึงเวลาหมด
    while (fabs(Encoder1.currentPos() - targetAngle) > 0.01)
    {
        // ตรวจจับ rising edge ของสัญญาณ encoder index pulse เพื่อยืนยันการหมุนถึงตำแหน่งศูนย์
        if (Encoder1.indexHappened())
        {
            Serial1.println("ตรวจจับ index pulse แล้ว.");
        }

        // ลดความเร็วเมื่อเข้าใกล้ตำแหน่งเป้าหมาย
        if (fabs(Encoder1.currentPos() - targetAngle) < 5.0)
        {
            Serial1.println("ใกล้ถึงตำแหน่งเป้าหมาย ลดความเร็วลง...");
            analogValue = map(abs(deltaAngle), 0, 360, 0, 100); // ลดค่าควบคุมแรงดันเพื่อหมุนช้าลง
            analogWrite(DAC1_pin, analogValue);
        }

        // อัพเดตการทำงานของมอเตอร์
        updateStepperGenerators();

        // ตรวจสอบเวลา timeout
        if (millis() - startTime > timeout)
        {
            Serial1.println("เวลาหมุนหมดแล้ว, ไม่สามารถหาตำแหน่งได้!");
            analogWrite(DAC1_pin, 0);  // หยุดการหมุน

            // ส่งสถานะกลับไปยัง Master ว่าการหมุนไม่สำเร็จ
            Obj.SpindleStatus = 2;  // หมายเลข 2 สำหรับ Timeout
            return;  // ออกจากฟังก์ชัน
        }
    }

    // เมื่อถึงตำแหน่งเป้าหมาย, หยุดจ่ายไฟ (หรือปรับค่าผลลัพธ์เป็น 0)
    analogWrite(DAC1_pin, 0);  // หยุดการหมุนโดยการส่งค่าแรงดัน 0

    // ส่งสถานะกลับไปยัง Master ว่าการหมุนสำเร็จ
    Obj.SpindleStatus = 1;  // หมายเลข 1 สำหรับสำเร็จ

    Serial1.println("สปินเดิลได้ถูกออเรียนเทชันไปยังมุมที่กำหนดแล้ว.");
}

Functions to be included
- Use DAC1 as analog +-10V to control servo spindle
- Receive M19 command and degree variables such as R0 R45 R90 from Hal " net spindle_orientation => ecat.0.command "
- Check if the current position is the same as the desired target
- Calculate the nearest rotation direction
- Add edge, near function
- Timer to turn off DAC if no target is found
- Confirm operation or error back to Master
Other if necessary
  • SOLD
  • SOLD
07 Dec 2024 05:24
Replied by SOLD on topic AX58100

AX58100

Category: EtherCAT

ฮาคานโพสต์=316122 userid=22448ขอแสดงความยินดีด้วย โปรแกรมดีบักเกอร์ช่วยได้มากในการแก้ปัญหาบางอย่าง
ดังที่คุณทราบ ตัวแปรจะอัปเดตเมื่อโปรแกรมหยุดชั่วคราวหรือกำลังดำเนินการ

Thanks for the guide.

Next step, I might change the name of pin in u32 index-status; in metalmusings_encoder.comp to match the name of pdo, as I have confused it, and might need to change the data type of one of the parts to match.

Then reconnect the hal.

As I understand it,
when "Obj.IndexStatus" is sent to "pin in u32 index-status" in metalmusings_encoder,
it causes "pin io bit index-c-enable", which is equivalent to the original index-enable, to change the state to 1.
When index-c-enable is triggered, "pin out u32 index-latch-enable" will return to "Obj.IndexLatchEnable" to reset encCnt to 0, waiting to be 1 in the next round.
  • SOLD
  • SOLD
07 Dec 2024 04:17
Replied by SOLD on topic AX58100

AX58100

Category: EtherCAT

I have been playing with the inputs and outputs of the card and I realized that these are of type u32 and in order to be used in LCN they must be converted to BITs with the conv_u32_bit component, this is because some pins that LCN automatically creates are of type bit, such as joint.N.amp-fault.in, iocontrol.o.emc.enable-in, or any other pin that has been declared as type bit.

This problem is fixed directly in ethercat-conf.xml using the original eeprom.
<pdo idx="1a01">
<pdoEntry idx="6001" subIdx="01" bitLen="1" halPin="in1" halType="bit"/>
<pdoEntry idx="6001" subIdx="02" bitLen="1" halPin="in2" halType="bit"/>
<pdoEntry idx="6001" subIdx="03" bitLen="1" halPin="in3" halType="bit"/>
<pdoEntry idx="6001" subIdx="04" bitLen="1" halPin="in4" halType="bit"/>
<pdoEntry idx="6001" subIdx="05" bitLen="1" halPin="in5" halType="bit"/>
<pdoEntry idx="6001" subIdx="06" bitLen="1" halPin="in6" halType="bit"/>
<pdoEntry idx="6001" subIdx="07" bitLen="1" halPin="in7" halType="bit"/>
<pdoEntry idx="6001" subIdx="08" bitLen="1" halPin="in8" halType="bit"/>
</pdo>
 
  • cmorley
  • cmorley
07 Dec 2024 04:10
Replied by cmorley on topic qtvismach, a axis toolpath

qtvismach, a axis toolpath

Category: Qtvcp

Uses a HAL U32 pin to set the color.  Alpha can be preset:
class HALColor(Collection):
    def __init__(self, parts, comp, var, alpha=1.0):
        self.comp = comp
        self.var = var
        self.alpha = float(alpha)
        Collection.__init__(self, parts)

    def apply(self):
        try:
            if self.comp is None:
                v = hal.get_value(self.var)
            else:
                v = self.comp[self.var]
        except:
            v = 0
        r = ((v & 0x000000FF) >> 0)/255
        g = ((v & 0x0000FF00) >> 8)/255
        b = ((v & 0x00FF0000) >> 16)/255
        c =[r,g,b,self.alpha]

        GL.glPushAttrib(GL.GL_LIGHTING_BIT)
        GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE, c)
        GL.glEnable(GL.GL_BLEND)
        GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)

    def unapply(self):
        GL.glPopAttrib()
        GL.glDisable(GL.GL_BLEND)

c.newpin("color", hal.HAL_U32, hal.HAL_IN)

link7 = HALColor([link7], c, "color",alpha=0.5)

 
  • fake_name
  • fake_name
07 Dec 2024 03:59 - 07 Dec 2024 04:11
Replied by fake_name on topic Ethercat auto configurator.

Ethercat auto configurator.

Category: EtherCAT

FWIW, I rolled back to qt5 and it builds.

I can get the binary in the referred directory (
ethercat_twincat
) to build and run, but it doesn't seem to correctly identify my hardware, and I don't really understand what to do next. It seems to identify my servo driver (a Lichuan LC10-E) as a EK1100. 
ethercat pdos
seems to show the correct process data objects, so I'm not sure what's going on.

If there's anything I can do to help (you want shell access? I should be able to figure something out) I'd be happy do contribute.

I also have a number of Lichuan ethercat stepper servo drivers, and a ethercat IO thingie (one of these: www.forum.linuxcnc.org/ethercat/52997-et...at-catio-module-help).
  • fake_name
  • fake_name
07 Dec 2024 03:52 - 07 Dec 2024 03:54
Replied by fake_name on topic Ethercat auto configurator.

Ethercat auto configurator.

Category: EtherCAT

@Fakename
The links are broken indeed, the source has moved to :
codeberg.org/skynet/realtime_app/src/bra...dor/ethercat_twincat

It is part of a bigger project that used opencascade.

 


That lets me localize things a bit, but could you possibly be a bit more explicit about dependencies? The version of qt6 packaged on debian 12 (current linuxcnc) seems to be too new, and it will not build:

cnc@servobox:~/realtime_app/src/vendor/ethercat_twincat/build$ cmake ..
-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cnc/realtime_app/src/vendor/ethercat_twincat/build
cnc@servobox:~/realtime_app/src/vendor/ethercat_twincat/build$ make -j4
[  5%] Automatic MOC and UIC for target ethercat_twincat
[  5%] Built target ethercat_twincat_autogen
[ 20%] Building CXX object CMakeFiles/ethercat_twincat.dir/main.cpp.o
[ 20%] Building CXX object CMakeFiles/ethercat_twincat.dir/ethercat_twincat_autogen/mocs_compilation.cpp.o
[ 20%] Building CXX object CMakeFiles/ethercat_twincat.dir/mainwindow.cpp.o
[ 25%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/ethercat_master/tool/Command.cpp.o
[ 30%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/ethercat_master/tool/CommandXml.cpp.o
[ 35%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/ethercat_master/tool/MasterDevice.cpp.o
[ 40%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/ethercat_master/tool/NumberListParser.cpp.o
[ 45%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/graphics_view.cpp.o
[ 50%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/form_node_port.cpp.o
[ 55%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/form_node_base.cpp.o
[ 60%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/form_node_port_out.cpp.o
[ 65%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/form_node_port_in.cpp.o
[ 70%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/graphics_node.cpp.o
[ 75%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/graphics_curve.cpp.o
[ 80%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/qcustomwidget.cpp.o
[ 85%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/qcustomtimerwidget.cpp.o
[ 90%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/qcustomscopewidget.cpp.o
[ 95%] Building CXX object CMakeFiles/ethercat_twincat.dir/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp.o
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp: In member function ‘Qt::Alignment QCPLayoutInset::insetAlignment(int) const’:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:3121:12: error: invalid conversion from ‘int’ to ‘Qt::AlignmentFlag’ [-fpermissive]
 3121 |     return 0;
      |            ^
      |            |
      |            int
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:1401,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qnamespace.h:8,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobjectdefs.h:12,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:10,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QObject:1,
                 from /home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.h:29,
                 from /home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:26:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h:74:45: note:   initializing argument 1 of ‘constexpr QFlags<T>::QFlags(Enum) [with Enum = Qt::AlignmentFlag]’
   74 |     constexpr inline Q_IMPLICIT QFlags(Enum flags) noexcept : i(Int(flags)) {}
      |                                        ~~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:1407:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp: In destructor ‘virtual QCPItemAnchor::~QCPItemAnchor()’:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:7461:47: error: ‘class QSet<QCPItemPosition*>’ has no member named ‘toList’
 7461 |   foreach (QCPItemPosition *child, mChildrenX.toList())
      |                                               ^~~~~~
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:7466:47: error: ‘class QSet<QCPItemPosition*>’ has no member named ‘toList’
 7466 |   foreach (QCPItemPosition *child, mChildrenY.toList())
      |                                               ^~~~~~
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp: In destructor ‘virtual QCPItemPosition::~QCPItemPosition()’:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:7639:47: error: ‘class QSet<QCPItemPosition*>’ has no member named ‘toList’
 7639 |   foreach (QCPItemPosition *child, mChildrenX.toList())
      |                                               ^~~~~~
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:7644:47: error: ‘class QSet<QCPItemPosition*>’ has no member named ‘toList’
 7644 |   foreach (QCPItemPosition *child, mChildrenY.toList())
      |                                               ^~~~~~
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp: In member function ‘void QCustomPlot::replot(RefreshPriority)’:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:10372:37: error: ‘HighQualityAntialiasing’ is not a member of ‘QPainter’
10372 |     painter.setRenderHint(QPainter::HighQualityAntialiasing); // to make Antialiasing look good if using the OpenGL graphicssystem
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp: In member function ‘virtual void QCustomPlot::wheelEvent(QWheelEvent*)’:
/home/cnc/realtime_app/src/vendor/nodelib/qcustomplot.cpp:10855:53: error: ‘class QWheelEvent’ has no member named ‘pos’
10855 |   if (QCPLayoutElement *el = layoutElementAt(event->pos()))
      |                                                     ^~~

 
  • scotta
  • scotta's Avatar
07 Dec 2024 03:47

Remora - ethernet NVEM / EC300 / EC500 cnc board

Category: Computers and Hardware

When LinuxCNC is in eStop there is no communication happening to the controller board, which is why the servo thread executes quickly. Come out of eStop and then you have a full SPI communication time to read and write to the board.

The PRU_base_freq only informs the LinuxCNC Remora component what base frequency the controller board is running. It does not change any timings in LinuxCNC. 

Remora does not use the Base Thread.

Whether you run Remora or MESA the latency will be the same.
  • tommylight
  • tommylight's Avatar
07 Dec 2024 02:39

Installing LinuxCNC 2.8.4 on Ubuntu 22.04 LTS with Real Time Kernel

Category: Installing LinuxCNC

XFCE has it's place, well deserved.
You can use Linux Mint Debian Edition 6, it works better than any Ubuntu after 10.04, and better than any Debian and that is really strange, but hey, it works. I used it for roughly 6 months on several PC and did not have Debian issues (disappearing stuff from panels, stuff crashing, again rarely), except once.
Installing LinuxCNC is the now standard set of two lines:
sudo apt update
sudo apt install linuxcnc-uspace
You can also use any version of Mint, but LinuxCNC must be built from sources.
-
Did you try installing a Debian RT kernel?
That usually works, as simple as downloading and installing using gdebi. Try this
ftp.debian.org/debian/pool/main/l/linux-..._6.10.12-1_amd64.deb
  • rodw
  • rodw's Avatar
07 Dec 2024 02:38

Ethercat installation from repositories - how to step by step

Category: EtherCAT

If it has a mokutil error, that implies that you are using secure boot and need to enroll dkms into the security model. It is briefly explained in the first post.
  • rodw
  • rodw's Avatar
07 Dec 2024 02:35

Raspberrypi 5 linuxcnc Image' screen resolution and color depth

Category: General LinuxCNC Questions

thanks a lot! can that image used on an raspi 5?

Yes, its made for the Pi 5. I did notice the file name  may not say this.
  • langdons
  • langdons's Avatar
Displaying 20476 - 20490 out of 22505 results.
Time to create page: 0.730 seconds
Powered by Kunena Forum