error on a modified component
03 Jan 2024 20:17 - 03 Jan 2024 20:18 #289693
by bobwolf
error on a modified component was created by bobwolf
Hello everyone and happy new year
I modified the pwmgen.c component to be able to easily control an rc servo...
like pwmgen it has 3 possible configurations and I can load multiple configurations at the same time
despite the countless compilation errors I managed to create a valid compilation... after which the errors that linuxcnc gave me at startup arrived... using the terminal and halrun I reset all the messages it gave me and from the terminal the component runs with all configurations
when I try to start it from linuxcnc it only works with configuration 1 and gives me the error of the attached report
why does he do this?
how can I fix it?
ps.
then I have to see if it works on a logical level... but that's another story
ciao
Roberto
I modified the pwmgen.c component to be able to easily control an rc servo...
like pwmgen it has 3 possible configurations and I can load multiple configurations at the same time
despite the countless compilation errors I managed to create a valid compilation... after which the errors that linuxcnc gave me at startup arrived... using the terminal and halrun I reset all the messages it gave me and from the terminal the component runs with all configurations
when I try to start it from linuxcnc it only works with configuration 1 and gives me the error of the attached report
why does he do this?
how can I fix it?
ps.
then I have to see if it works on a logical level... but that's another story
ciao
Roberto
Attachments:
Last edit: 03 Jan 2024 20:18 by bobwolf.
Please Log in or Create an account to join the conversation.
03 Jan 2024 21:34 #289699
by PCW
Replied by PCW on topic error on a modified component
It might be a little easier for debugging to just load the component
with halcmd -kf rather then running a full LinuxCNC installation
halcmd -fk
halcmd: loadrt pwmgen output_type=0
halcmd: addf pwmgen.update servo-thread
halcmd: addf pwmgen.make-pulses base-thread
Note: You seem to be using a Mesa card so using the hardware
RCPWMGEN is a possibility.
with halcmd -kf rather then running a full LinuxCNC installation
halcmd -fk
halcmd: loadrt pwmgen output_type=0
halcmd: addf pwmgen.update servo-thread
halcmd: addf pwmgen.make-pulses base-thread
Note: You seem to be using a Mesa card so using the hardware
RCPWMGEN is a possibility.
Please Log in or Create an account to join the conversation.
04 Jan 2024 11:01 #289754
by bobwolf
Replied by bobwolf on topic error on a modified component
i've do your command
bobwolf@fresacnc:~$ halcmd -fk
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: addf rc_gen.update servo-thread
HAL: ERROR: thread 'servo-thread' not found
<stdin>:2: addf failed
halcmd: addf rc_gen.make-pulses base-thread
HAL: ERROR: thread 'base-thread' not found
<stdin>:3: addf failed
halcmd:
bobwolf@fresacnc:~$ halcmd -fk
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: addf rc_gen.update servo-thread
HAL: ERROR: thread 'servo-thread' not found
<stdin>:2: addf failed
halcmd: addf rc_gen.make-pulses base-thread
HAL: ERROR: thread 'base-thread' not found
<stdin>:3: addf failed
halcmd:
Please Log in or Create an account to join the conversation.
04 Jan 2024 11:07 #289758
by bobwolf
Replied by bobwolf on topic error on a modified component
and this if i put in the .hal file
loadrt -fk rc_gen output_type=2
Debug file information:
./custom.hal:20: waitpid failed /usr/bin/rtapi_app -fk
./custom.hal:20: /usr/bin/rtapi_app exited without becoming ready
./custom.hal:20: insmod for -fk failed, returned -1
3443
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
loadrt -fk rc_gen output_type=2
Debug file information:
./custom.hal:20: waitpid failed /usr/bin/rtapi_app -fk
./custom.hal:20: /usr/bin/rtapi_app exited without becoming ready
./custom.hal:20: insmod for -fk failed, returned -1
3443
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
Please Log in or Create an account to join the conversation.
04 Jan 2024 11:35 #289762
by bobwolf
Replied by bobwolf on topic error on a modified component
I tried to comment (exclude), in the .hal file the lines of my component and if I exclude the line
addf rc_gen.update servo-thread
linuxcnc starts normally
Is there maybe some problem with that part of my program?
addf rc_gen.update servo-thread
linuxcnc starts normally
Is there maybe some problem with that part of my program?
Please Log in or Create an account to join the conversation.
04 Jan 2024 12:06 #289768
by Aciera
Replied by Aciera on topic error on a modified component
Could you post the contents of your component?
Please Log in or Create an account to join the conversation.
04 Jan 2024 12:21 #289769
by bobwolf
Replied by bobwolf on topic error on a modified component
here is my file...
I'm not a programmer and I'm self-taught
the file is a modification of the pwmgen.c file
I'm not a programmer and I'm self-taught
the file is a modification of the pwmgen.c file
Attachments:
Please Log in or Create an account to join the conversation.
04 Jan 2024 12:45 #289773
by PCW
A stand alone example would be:
halcmd -fk
halcmd: loadrt pwmgen output_type=0
halcmd: loadrt threads
halcmd: start
halcmd: addf pwmgen.update thread1
halcmd: addf pwmgen.make-pulses thread1
Have you considered using the hardware RCPWM?
It would have much better resolution than a software PWMgen
especially since the full scale RC PWM range is only 1 ms
Replied by PCW on topic error on a modified component
Sorry my example assumed LinuxCNC was runningi've do your command
bobwolf@fresacnc:~$ halcmd -fk
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: addf rc_gen.update servo-thread
HAL: ERROR: thread 'servo-thread' not found
<stdin>:2: addf failed
halcmd: addf rc_gen.make-pulses base-thread
HAL: ERROR: thread 'base-thread' not found
<stdin>:3: addf failed
halcmd:
A stand alone example would be:
halcmd -fk
halcmd: loadrt pwmgen output_type=0
halcmd: loadrt threads
halcmd: start
halcmd: addf pwmgen.update thread1
halcmd: addf pwmgen.make-pulses thread1
Have you considered using the hardware RCPWM?
It would have much better resolution than a software PWMgen
especially since the full scale RC PWM range is only 1 ms
Please Log in or Create an account to join the conversation.
04 Jan 2024 14:03 #289778
by bobwolf
Replied by bobwolf on topic error on a modified component
if I start linuxcnc my program with configuration 1 everything is fine and it doesn't give me errors
if I set 0 or 2 in my program linuxcnc doesn't start
below is the terminal if I follow the steps you told me:
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: loadrt threads
halcmd: start
halcmd: addf rc_gen.update thread1
halcmd: rtapi_app: caught signal 11 - dumping core
halcmd: addf rc_gen make-pulses thread1
HAL: ERROR: bad position: 0
<stdin>:12: addf failed
halcmd: unloadrt rc_gen
Waited 3 seconds for master. giving up.
Note: Using POSIX realtime
rc_gen: not loaded
<stdin>:13: exit value: 255
<stdin>:13: rmmod failed, returned -1
<stdin>:13: unloadrt failed
halcmd: unloadrt rc_gen
<stdin>:14: component 'rc_gen' is not loaded
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: loadrt threads
halcmd: start
halcmd: addf rc_gen make-pulses thread1
HAL: ERROR: bad position: 0
<stdin>:18: addf failed
halcmd:
if I set 0 or 2 in my program linuxcnc doesn't start
below is the terminal if I follow the steps you told me:
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: loadrt threads
halcmd: start
halcmd: addf rc_gen.update thread1
halcmd: rtapi_app: caught signal 11 - dumping core
halcmd: addf rc_gen make-pulses thread1
HAL: ERROR: bad position: 0
<stdin>:12: addf failed
halcmd: unloadrt rc_gen
Waited 3 seconds for master. giving up.
Note: Using POSIX realtime
rc_gen: not loaded
<stdin>:13: exit value: 255
<stdin>:13: rmmod failed, returned -1
<stdin>:13: unloadrt failed
halcmd: unloadrt rc_gen
<stdin>:14: component 'rc_gen' is not loaded
halcmd: loadrt rc_gen output_type=0
Note: Using POSIX realtime
halcmd: loadrt threads
halcmd: start
halcmd: addf rc_gen make-pulses thread1
HAL: ERROR: bad position: 0
<stdin>:18: addf failed
halcmd:
Please Log in or Create an account to join the conversation.
04 Jan 2024 14:27 #289780
by bobwolf
i've open halcmd -fk on terminal
i've run linuxcnc from the desktop icon
halcmd exit from terminal with no message
bobwolf@fresacnc:~$ halcmd -fk
halcmd: bobwolf@fresacnc:~$
Replied by bobwolf on topic error on a modified component
ok i haven't understand...if I start linuxcnc my program with configuration 1 everything is fine and it doesn't give me errors
if I set 0 or 2 in my program linuxcnc doesn't start
i've open halcmd -fk on terminal
i've run linuxcnc from the desktop icon
halcmd exit from terminal with no message
bobwolf@fresacnc:~$ halcmd -fk
halcmd: bobwolf@fresacnc:~$
Please Log in or Create an account to join the conversation.
Time to create page: 0.122 seconds