Advanced Search

Search Results (Searched for: )

  • jaro_p
  • jaro_p's Avatar
Today 13:41

Changes in configuration files generated in pncconfig for 7i76 to 7i78

Category: PnCConf Wizard

Ok mea culpa, SPI was not enabled. As an apology, after about the fourth OS change I forgot about it out of nervousness.
Thank you, I hope it will be without problems.
  • unknown
  • unknown
Today 12:51

Changes in configuration files generated in pncconfig for 7i76 to 7i78

Category: PnCConf Wizard

What RPi model are you using and what image are you using.

spi hasn't been enabled in config.txt
  • opw
  • opw
Today 12:13
Replied by opw on topic PoKeys57CNC HAL component

PoKeys57CNC HAL component

Category: HAL

This is very interesting. I recently purchased a Ozaki CNC lathe with mach3 control. I don't really liked the mach3 too much, but it worked well enough. Then my HDD crashed and this seemed to be a very good opportunity to go ahead and convert it to Linuxcnc...

But then, what about the used Pokeys 56U? Then I found this. Hope it connects with the 56U too, really good to find this.
  • RaspII
  • RaspII
Today 11:42 - Today 11:44

MESA 7i76EU - Pinzuordnung (z.B. Endschalter)

Category: Deutsch

ok, I made the sink configuration for output01 with setp now within custom.hal:
hm2_7i76e.0.7i76.0.0.output_source 0xFFFD
setp hm2_7i76e.0.7i76.0.0.output_sink 0x0002

-> works as expected, thanks a lot
  • jaro_p
  • jaro_p's Avatar
Today 11:20

Changes in configuration files generated in pncconfig for 7i76 to 7i78

Category: PnCConf Wizard

cnc@raspberrypi:~$ ls /dev/spidev*

ls: cannot access '/dev/spidev*': No such file or directory
  • unknown
  • unknown
  • Hakan
  • Hakan
Today 09:44 - Today 10:05

Ethercat compatible Encoder board tentative STM32F4 + LAN9252

Category: EtherCAT

Dc synchronization for the slave is at the same time very simple and complex.
Your slave is now running in free run mode. As fast and frequently as possible it executes the ecat_slv()
void loop(void)
{
  ecat_slv();
}
This function does the following
void ecat_slv(void)
{
  ecat_slv_poll();
  DIG_process(ESC_ALeventread(), DIG_PROCESS_WD_FLAG | DIG_PROCESS_OUTPUTS_FLAG |                                      DIG_PROCESS_APP_HOOK_FLAG | DIG_PROCESS_INPUTS_FLAG);
}
  
ecat_slv_poll() checks with the LAN9252 for events, mailboxes and other housekeeping things.
DIG_process() reads from the LAN9252 all pdos, sets user variables to the value of the pdos in cb_set_outputs(), calls a processing function if defined in application_hook, and finally captures user variables into pdos cb_get_inputs() and uploads them to the LAN9252. 
The data is then sent to the ethercat master with the next packet passing by.

In free-run this happens at the speed of the processor and one can expect the read value to have been read inside some 0-300 microseconds of the packet passing by. Sometime this is enough, sometimes not. For my plasma cutter it is definitely enough with a voltage reading every so often. For precise motion control this normally is not enough. Predictability of exactly when the value is read is important here.

That's where DC synchronization comes in. In DC sync the LAN9252 will tell you the exact reference time by setting the SYNC0 line high (or low).

That's all actually.

It is now up to you to do something useful with that signal.
There isn't one and only one way to handle this. For the stepper generator cards I have a somewhat elaborate time measurement built in and there is quite a bit of processing at every cycle when the target position changes.

In this case though I think it is as easy as it can be. Just read the encoder counter, store it in a value. Kick off the DIG_process are quickly as possible to have the data sent over to linuxcnc. Hal should have the read value next servo cycle.

To do this, set up an interrupt handler on the SYNC0 line and read the encoder value. Set a flag to start the DIG_process.

Start with the config structure
static esc_cfg_t config = {
.user_arg = NULL,
.use_interrupt = 0,
.watchdog_cnt = 150,
.set_defaults_hook = NULL,
.pre_state_change_hook = NULL,
.post_state_change_hook = NULL,
.application_hook = NULL,
.safeoutput_override = NULL,
.pre_object_download_hook = NULL,
.post_object_download_hook = NULL,
.rxpdo_override = NULL,
.txpdo_override = NULL,
.esc_hw_interrupt_enable = ESC_interrupt_enable,
.esc_hw_interrupt_disable = ESC_interrupt_disable,
.esc_hw_eep_handler = NULL,
.esc_check_dc_handler = dc_checker,
};
// Enable interrupts
void ESC_interrupt_enable(uint32_t mask)
{
  // Enable interrupt for SYNC0 or SM2 or SM3
  uint32_t user_int_mask =      ESCREG_ALEVENT_DC_SYNC0 | ESCREG_ALEVENT_SM2 | ESCREG_ALEVENT_SM3;
  if (mask & user_int_mask) {
    ESC_ALeventmaskwrite(ESC_ALeventmaskread() | (mask & user_int_mask));
    ESC_ALeventmaskwrite(ESC_ALeventmaskread() &
                         ~(ESCREG_ALEVENT_DC_SYNC0 | ESCREG_ALEVENT_SM3));
    attachInterrupt(digitalPinToInterrupt(SYNC0), sync0Handler, RISING);

    // Set LAN9252 interrupt pin driver as push-pull active high
    uint32_t bits = 0x00000111;
    ESC_write(0x54, &bits, 4);

    // Enable LAN9252 interrupt
    bits = 0x00000001;
    ESC_write(0x5c, &bits, 4);
  }
}
// Disable interrupts
void ESC_interrupt_disable(uint32_t mask)
{
  // Enable interrupt for SYNC0 or SM2 or SM3
  uint32_t user_int_mask =      ESCREG_ALEVENT_DC_SYNC0 | ESCREG_ALEVENT_SM2 | ESCREG_ALEVENT_SM3;
  if (mask & user_int_mask) {    // Disable interrupt from SYNC0 etc
    ESC_ALeventmaskwrite(ESC_ALeventmaskread() & ~(mask & user_int_mask));
    detachInterrupt(digitalPinToInterrupt(SYNC0));
    // Disable LAN9252 interrupt
    uint32_t bits = 0x00000000;
    ESC_write(0x5c, &bits, 4);
  }
}
// Setup of DC
uint16_t dc_checker(void)
{
  // Indicate we run DC
  ESCvar.dcsync = 1;
  return 0;
}
void sync0Handler(void)
{
  ALEventIRQ = ESC_ALeventread();
  serveIRQ = 1;
  encoderCounter = <read encoder counter value here>;
}
void loop(void)
{
  uint64_t dTime;
  if (serveIRQ) {
    DIG_process(DIG_PROCESS_WD_FLAG | DIG_PROCESS_OUTPUTS_FLAG |
                DIG_PROCESS_APP_HOOK_FLAG | DIG_PROCESS_INPUTS_FLAG);
    serveIRQ = 0;
    ESCvar.PrevTime = ESCvar.Time;
    ecat_slv_poll();
  }
  dTime = longTime.extendTime(micros()) - irqTime;
  if (dTime > 5000)  // Don't run ecat_slv_poll when expecting to serve interrupt
    ecat_slv();
 }

So there are many changes. Make good use of git so you can come back.
In loop() I have tried to make it work with both Dc sync and free run by waiting for 5 cycles without sync0 interrupts and then start polling.

You can find this code in E3000 main.cpp that's where I copied it from.
 
  • RotarySMP
  • RotarySMP's Avatar
Today 09:31

Considering a Full Rewire on a Working Schaublin 125 CNC

Category: Turning

Wow, you hit the ground running on this one Martin. Great progress.

I also thought my cabinet had lots of space... until I mounted everything and started wiring it up. Ended up having to stack a relay board (soon to be replaced by the second 7i84) above the 7i92 as I ran out of space. I guess I have taken a lot of space with the spindle VFD, pre and post filters and brake module.
  • jaro_p
  • jaro_p's Avatar
Today 09:15

Changes in configuration files generated in pncconfig for 7i76 to 7i78

Category: PnCConf Wizard

Unfortunately, the situation is anything but simple… I reinstalled Bookworm, but the command:
`sudo mesaflash --spi --addr /dev/spidev0.0 --device 7c81 --readhmid`

doesn't work:

- open: No such file or directory
- No 7C81 board found

The following works:

`halcmd -kf`

`halcmd: loadrt hostmot2`

`halcmd: loadrt hm2_rpspi`

`halcmd: show all hm2`

However, I don't know how to write a new bitfile. That is, the equivalent of:

`sudo mesaflash --spi --addr /dev/spidev0.0 --device 7c81 --fallback --write bitfile-name`

I tried installing an older version of LinuxCNC – Buster. However, the libraries for installing mesaflash are missing and cannot be installed because the repositories for this version no longer exist.
  • Hakan
  • Hakan
Today 09:04

Ethercat compatible Encoder board tentative STM32F4 + LAN9252

Category: EtherCAT

You can drown in documentation here github.com/linuxcnc-ethercat/linuxcnc-ethercat

But you should treat is any new EtherCAT board, no-one knows you made it.
lcec_configgen
usually gives a good starting point. And then you add pdos and sdos 
as you progress with the project. The naming/numbering scheme is pretty obvious when you see one.

Some general items you should have is 
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000" syncToRefClock="True">
or if syncToRefClock isn't recognized
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1000">
That "1000" is how frequent the clocks in the DC slaves are synchronized by the master. I use every 1000 cycle ( 1 sec)
In between the slaves calculate drift and offset themselves and run pretty darn accurate so it isn't necessary to do it more often than that. I Haven't seen a penalty for too seldom or too often so the important thing it's there.

And when you use DC sync for the slave, which you soon can do, you add this line to the slave.
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
300 is the important, means DC synchronization. 000 means free-run, as does removing the dcConf statetment, and 200 means SM2 synchronization. Those are the common modes, there are also 700, 100 and other modes, but the manual or the ESI file will tell you. 

 
  • Aciera
  • Aciera's Avatar
Today 08:39 - Today 09:01
Replied by Aciera on topic MVO to RO

MVO to RO

Category: Gmoccapy

Seems you are looking at 'gmoccapy' documentation for using 'halui' pins.

Halui documentation is here:
linuxcnc.org/docs/html/man/man1/halui.1.html#Rapid%20Override

However you should really be using the pins provided by gmoccapy for this purpose.
If unsure comment all lines in your hal files that give errors and use the 'Halshow' tool on the Settings page of Gmoccpy.
Using 2.9.7 I get this (which seems to agree with the documentation for Gmoccapy):
 
  • Sekai
  • Sekai
Today 08:31 - Today 10:36

Error when opening sim configuration gmoccapy 3.4.8

Category: Gmoccapy

I configured a step configuration with the wizard

 RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-5.4.258-rtai-amd64/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.3
Machine configuration directory is '/home/cnc/linuxcnc/configs/my-mill'
Machine configuration file is 'my-mill.ini'
INIFILE=/home/cnc/linuxcnc/configs/my-mill/my-mill.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=
DISPLAY=gmoccapy
COORDINATES=X Y Z
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Found file(REL): ./my-mill.hal
Found file(REL): ./custom.hal
Starting TASK program: milltask
Starting DISPLAY program: gmoccapy
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
ERROR: Can't remove RTAI modules, kill the following process(es) first
1563Removing NML shared memory segments

Debug file information:
Exception ignored error evaluating path:
Traceback (most recent call last):
File "<frozen getpath>", line 575, in <module>
File "<frozen getpath>", line 210, in search_up
File "<frozen getpath>", line 210, in <genexpr>
ValueError: embedded null character
Fatal Python error: error evaluating path
Python runtime state: core initialized

Current thread 0x00007fb818429040 (most recent call first):
<no Python frame>
/usr/bin/linuxcnc: line 665: 1572 Segmentation fault $PIDOF $KILL_TASK >> $DEBUG_FILE
Traceback (most recent call last):
File "/usr/bin/axis-remote", line 26, in <module>
import sys, getopt, os
import sys, getopt, os
File "/usr/lib/python3.11/getopt.py", line 38, in <module>
from gettext import gettext as _
File "/usr/lib/python3.11/gettext.py", line 50, in <module>
import re
File "/usr/lib/python3.11/re/__init__.py", line 124, in <module>
import enum
File "/usr/lib/python3.11/enum.py", line 3, in <module>
from types import MappingProxyType, DynamicClassAttribute
SystemError: error return without exception set
1511
/usr/bin/linuxcnc: line 620: [: -gt: unary operator expected
1567
malloc(): unsorted double linked list corrupted
Stopping realtime threads
Unloading hal components
Waiting for component 'inihal' to become ready...................... USER PID ACCESS COMMAND
/dev/rtai_shm: cnc ....m halcmd
................
Kernel message information:
[ 511.133992] I-pipe: head domain RTAI registered.
[ 511.133998] RTAI[hal]: mounted. ISOL_CPUS_MASK: 0.
[ 511.134006] SYSINFO - # CPUs: 1, TIMER NAME: 'lapic', TIMER IRQ: 4355, TIMER FREQ: 10390249, CLOCK NAME: 'tsc', CLOCK FREQ: 1662499000, CPU FREQ: 1662499000, LINUX TIMER IRQ: 4355.
[ 511.186056] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 511.186122] kstacks pool size = 524288 bytes
[ 511.186133] RTAI[sched]: hard timer type/freq = lapic/10390249(Hz)
[ 511.186136] linear timed lists.
[ 511.186139] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1662499000 hz.
[ 511.186142] RTAI[sched]: timer setup = 96 ns, resched latency = 0 ns.
[ 511.222685] USERMODE CHECK: OK.
[ 511.222690] USERMODE CHECK PROVIDED (ns): KernelLatency 4491, UserLatency 1954.
[ 511.222694] FINAL CALIBRATION SUMMARY (ns): KernelLatency 4491, UserLatency 1954.
[ 511.361573] RTAI[math]: loaded integrated musl libm version 1.2.3.
[ 511.767184] config string '0 out'
[ 512.090484] hal_manualtoolc[1557]: segfault at ab ip 0000000000561d90 sp 00007ffc12846810 error 4 in python3.11[41f000+2b3000]
[ 512.090506] Code: 40 08 48 85 c0 0f 85 7f 00 00 00 49 81 ff c0 9c 95 00 74 09 4d 85 ff 0f 85 9c 00 00 00 48 85 db 0f 84 1c 02 00 00 48 8b 43 08 <f6> 80 ab 00 00 00 40 0f 85 83 01 00 00 4d 85 ed 74 05 49 83 45 00
[ 512.189738] pidof[1572]: segfault at 18 ip 00007f6219198087 sp 00007ffe7fc3ec70 error 4 in libc.so.6[7f6219129000+156000]
[ 512.189756] Code: 1f 40 00 48 83 ec 08 48 8b 4f 08 48 89 c8 48 83 e0 f8 48 3b 04 07 0f 85 a9 00 00 00 f3 0f 6f 47 10 48 8b 57 18 66 48 0f 7e c0 <48> 3b 78 18 75 7b 48 3b 7a 10 75 75 48 8b 77 10 48 89 50 18 66 0f

Edit: i ran the command halrun -U
I think the rtapi module is not loaded
 
 
  • zz912
  • zz912's Avatar
Today 07:59

Error when opening sim configuration gmoccapy 3.4.8

Category: Gmoccapy

Mayby some GTK, GDK, Python3 package is missing.
  • Sekai
  • Sekai
Today 07:39 - Today 07:41

Error when opening sim configuration gmoccapy 3.4.8

Category: Gmoccapy

Hi i'm trying to open a sim config on 12 inch monitor with 1024x768 at 4:3 but gmoccapy gives and error with every sim config.
I tried even the 800x600 but the same error.
I tried axis and it works but the windows is bigger than the display.
The system is debian 12 si linux cnc 2.9.3 and rtai kernel 5.4.258
btw why the forum gives me and error when i try to put the code ?(You have too many links in your message, please decrease them! )
I uploaded the error code.
 

File Attachment:

File Name: gmoccapy_error.txt
File Size:4 KB
Displaying 1 - 15 out of 280881 results.
Time to create page: 1.713 seconds
Powered by Kunena Forum