[solved]scara-switch-kins

More
29 Apr 2020 21:32 - 18 May 2020 14:17 #166149 by bkt
****these is the initial problem, plus modified kins give me other problem .... see my solution at the end****

Because my scara have motor of j0 and j1 in same location, i need to add some function for right foward and invers calc ..... using standard 2.8 linuxcnc rip-install all work good.

But I promised a video to dgarret so i've install switch kins and I copy that scarakins and add one pin and calc needed.

Original file here: github.com/LinuxCNC/linuxcnc/blob/dgarr/...nematics/scarakins.c

My file add pin for added reduction because belt from motor of j1 to real position of j1 and j1 adictional calc. No other. After there I ry to launch halcompile of modified scarakins.c (no change name ... but if I change it obtain the same error), and I have these error:
bkt@bkt-Demo1:~/linuxcnc-skins$ halcompile --compile '/home/bkt/linuxcnc-dgskins/scarakins.c' 
Compiling realtime scarakins.c
Linking scarakins.so
/usr/bin/ld:scarakins.ver:2: syntax error in VERSION script
collect2: error: ld returned 1 exit status
/home/bkt/linuxcnc-dgskins/src/Makefile.modinc:118: recipe for target 'scarakins.so' failed
make: *** [scarakins.so] Error 1

not understand why really ..... because other rip-installa (standard linuxcnc-dev folder) work well.

Yeas I have 2 folder: linuxcnc-dev for rip-install of standard linuxcnc 2.8, an other folder linuxcnc-dgskins for dgarret fork switgh_kins rip-install ....

I don’t think the problem comes from my file. but the shape of the file is different from what I was used to ... so I can’t exclude it ... I attach it as it is ....
Warning: Spoiler!


thanks in advances for how can suggest me the problem ...

regards
bkt
Attachments:
Last edit: 18 May 2020 14:17 by bkt.

Please Log in or Create an account to join the conversation.

More
29 Apr 2020 22:44 - 29 Apr 2020 22:45 #166155 by dgarrett
Replied by dgarrett on topic scara-switch-kins
I can reproduce the "VERSION script" error message using
halcompile -- but note that halcompile is primarily aimed at
making hal components from .comp files. Making a hal
component or a custom kinematics module from a .c file will
require additional work and maybe some undocumented methods.
I'm not familiar with the details to make halcompile work
for arbitrary c files implementing a kinematics module.

#=============================================
Instead (Method1), recommend to just copy over (replace) the
in-tree file in your rip-install, example:
$ cd src/emc/kinematics
$ cp your_scarakins.c scarakins.c # replace in-tree file
$ cd ../.. # src dir
$ make && sudo make setuid

#=============================================
Alternatively (Method2), in the dgarr/s_kins branch on a RIP install
using rt-preempt, you can use the in-tree scarakins.c but
specify an additional user kinematics type as described in the
docs section on "User kinematics provisions".

See:
asciidoc: github.com/LinuxCNC/linuxcnc/blob/dgarr/...otion/switchkins.txt
html: www.panix.com/~dgarrett/stuff/switchkins.html

An example custom in-tree kinematics file is provided at
github.com/LinuxCNC/linuxcnc/blob/dgarr/...ematics/userkfuncs.c

So you could put your modified kinematics routines in a
similar file using the expected and required function naming
(userkKinematicsSetup, userkKinematicsForward,
userkKinematicsInverse) and invoke make as described in the
docs:
$ userkfuncs=/home/myname/kins/mykins.c make && sudo make setuid

With this method, the kinematics types available when loading
scarakins will be:
type0: in-tree scarakins
type1: identity
type2: your-user-custom-kins

#=============================================
A third method (Method3) would be to add your custom kinematics file
(with a unique name like myscarakins.c) to
the src/emc/kinematics directory and modify the src/Makefile
following the pattern used for other kinematics modules.
Last edit: 29 Apr 2020 22:45 by dgarrett.

Please Log in or Create an account to join the conversation.

More
30 Apr 2020 01:29 - 30 Apr 2020 02:07 #166182 by dgarrett
Replied by dgarrett on topic scara-switch-kins
i did some more tests and see that you can use halcompile for the
scarakins.c in the master branch but not in the s_kins branch
-- the latter links in several object modules besides scarakins.o

i've looked at it a bit -- halcompile and/or src/Makefile.inc would
need some serious work to handle the multiple object files that
are used in the s_kins branch i think.

i recommend the methods mentioned earlier using make.
Last edit: 30 Apr 2020 02:07 by dgarrett.
The following user(s) said Thank You: bkt

Please Log in or Create an account to join the conversation.

More
30 Apr 2020 06:28 #166190 by bkt
Replied by bkt on topic scara-switch-kins
On the mailing I asked andy to insert s_kins in the next master .... obviously there is work to do here .... I would be happy to continue this, obviously for now on a separate branch on github, although I know that I will have to delegate a lot to collaborators because I have difficulty, because of my job, to find the time to make some healthy sleep.

In any case, I too had thought of replacing the kinematics and compiling again .... but I needed confirmation, I have not studied the / blob / dgarr / s_kins / branch well yet ... in fact you have never answered me.

So I ask you here for permission to work on it. I don't like to take and run. I don't think anyone will take me to the FBI :laugh: (from the movie "Catch Me If You Can" 2001).

Please Log in or Create an account to join the conversation.

More
30 Apr 2020 06:30 #166191 by bkt
Replied by bkt on topic scara-switch-kins
PLUS I use version of 20-03-2020 ... i need to download last one or is the same?

Thanks
bkt

Please Log in or Create an account to join the conversation.

More
15 May 2020 17:34 - 15 May 2020 18:17 #167881 by bkt
Replied by bkt on topic scara-switch-kins
Sorry DGarret ... but I ry to start My Scara machine ... Axis interface start right, I can move joint before homing, I can make homing in a right way but when homing end -> Y axis show on screen 360 instead 0 (0mm is correct, 360 is wrong), X axis show 1267 (these is ok), Z axis show 2000 (these is right), A B and C show the correct value = 0 ... than machine goes in following error of 0 and 3 joint ... I think because wrong value of Y axis .... not understand. These is mine X axis declaration in Hal file:
#*******************
#  AXIS X
#*******************

setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
#setp   pid.x.maxerror .0005

net x-index-enable  <=> pid.x.index-enable
net x-enable        =>  pid.x.enable
net x-pos-cmd       =>  pid.x.command #mult2.0.in0
#setp   mult2.0.in1  0.01
#net my-offset0 offset.0.offset <= mult2.0.out
net x-vel-cmd       =>  pid.x.command-deriv
net x-pos-fb        =>  pid.x.feedback
net x-output        =>  pid.x.output

# ---PWM Generator signals/setup---

setp   hm2_5i25.0.7i77.0.1.analogout0-scalemax  [JOINT_0]OUTPUT_SCALE
setp   hm2_5i25.0.7i77.0.1.analogout0-minlim    [JOINT_0]OUTPUT_MIN_LIMIT
setp   hm2_5i25.0.7i77.0.1.analogout0-maxlim    [JOINT_0]OUTPUT_MAX_LIMIT

net x-output                             => hm2_5i25.0.7i77.0.1.analogout0
net x-pos-cmd    joint.0.motor-pos-cmd
net x-enable     joint.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable   hm2_5i25.0.7i77.0.1.analogena

# ---Encoder feedback signals/setup---

setp    hm2_5i25.0.encoder.00.counter-mode 0
setp    hm2_5i25.0.encoder.00.filter 1
setp    hm2_5i25.0.encoder.00.index-invert 0
setp    hm2_5i25.0.encoder.00.index-mask 0
setp    hm2_5i25.0.encoder.00.index-mask-invert 0
setp    hm2_5i25.0.encoder.00.scale  [JOINT_0]ENCODER_SCALE

net x-pos-fb               <=  hm2_5i25.0.encoder.00.position
net x-vel-fb               <=  hm2_5i25.0.encoder.00.velocity
net x-pos-fb               =>  joint.0.motor-pos-fb  #mux2.0.in0
net x-index-enable    joint.0.index-enable  <=>  hm2_5i25.0.encoder.00.index-enable
net x-pos-rawcounts        <=  hm2_5i25.0.encoder.00.rawcounts

after these joint.0 = X axis, joint.1 = Y axis, joint.2 = Z axis, joint.3 = A axis, joint.4 = B axis and joint.5 = C axis.

these problem came from confusion from C axis to joint.5 instead joint.3??


here the terminal error:
Found file(REL): ./n.hal
Note: Using POSIX realtime

!!! switchkins-type 0 is scarakins

identityKinematicsSetup: coordinates:xyzc
   Joint 0 ==> Axis X
   Joint 1 ==> Axis Y
   Joint 2 ==> Axis Z
   Joint 3 ==> Axis C


userkKinematicsSetup:
   emc/kinematics/userkfuncs.c <xyzc> max_joints=4 allow_duplicates=0  /* THESE CAN BE THE ERROR? I HAVE AND USE 6 AXSIS ANDA MAX JOINT = 4 ??  IN THESE CASE CORRECTION MAYBE KINEMATICS .. SEE END OF MESSAGES*/

...
...
...
hm2/hm2_5i25.0:     IO Pin 033 (P2-13): IOPort
hm2/hm2_5i25.0: registered
hm2_5i25.0: initialized AnyIO board at 0000:05:00.0
note: MAXV     max: 1000.000 units/sec 60000.000 units/min
note: LJOG     max: 1000.000 units/sec 60000.000 units/min
note: LJOG default: 10.000 units/sec 600.000 units/min
note: AJOG     max: 200.000 units/sec 12000.000 units/min
note: AJOG default: 5.000 units/sec 300.000 units/min
note: jog_order='XYZABC'
note: jog_invert=set([])
following error axis 0
emc/task/taskintf.cc 947: Error on joint 0, command number 156
emc/task/taskintf.cc 947: Error on joint 3, command number 156
following error axis 3
following error axis 0
emc/task/taskintf.cc 947: Error on joint 0, command number 199
emc/task/taskintf.cc 947: Error on joint 3, command number 199
following error axis 3
following error axis 0
emc/task/taskintf.cc 947: Error on joint 0, command number 224
emc/task/taskintf.cc 947: Error on joint 3, command number 224
following error axis 3
Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script
task: 12217 cycles, min=0.000007, max=0.064676, avg=0.010048, 0 latency excursions (> 10x expected cycle time of 0.010000s)
hm2_5i25.0: dropping AnyIO board at 0000:05:00.0
hm2/hm2_5i25.0: unregistered
RTAPI_PCI: Unmapped 65536 bytes at 0x7fcbef489000
hm2_pci: driver unloaded
hm2: unloading
Note: Using POSIX realtime

In your branch kins (github.com/LinuxCNC/linuxcnc/blob/dgarr/...nematics/scarakins.c) at row 217:
    kp->required_coordinates = "xyzc";
    kp->allow_duplicates     = 0;
    kp->max_joints = strlen(kp->required_coordinates);

can be :
kp->required_coordinates = "xyzabc";
    kp->allow_duplicates     = 0;
    kp->max_joints = strlen(kp->required_coordinates);

these can work??

regards
Last edit: 15 May 2020 18:17 by bkt.

Please Log in or Create an account to join the conversation.

More
18 May 2020 14:27 - 18 May 2020 18:40 #168153 by bkt
Replied by bkt on topic [solved]scara-switch-kins
after the kind reply of dgarret, i copied his branch from github ... sorry i'm not practical and i don't have time ... so i made a new one in my github adding alter 3 scarakins ... scarakins4, scarakins10 and scarakins11. ... then I modified the makefile and some other points (the grep -Iri 'scarakins' 'path / s_kins' command helped me with this) .... then I committed my version and then downloaded and installed it. .. now my scara resets correctly even if I use 6 axes .... the problem was just that ... in order not to make a mistake I matched the joints and the kinematics (the C axis of the scara is now the joint [5 ] so that there is no sequence error in the XYZABC string) ... I have yet to start it at work, but at least it homing correctly. If then the rest is correct too .... I will make a nice video so as to honor a promise. I put the link to my github just verified that the download runs correctly. For now I am happy with this result.

*** ok it is working code for me pourpose ****

so promised link ... github.com/bkt-it/linuxcnc_s_kins_bkt

Thanks a lot for dgarret suggestion and works!!!
Last edit: 18 May 2020 18:40 by bkt.
The following user(s) said Thank You: Aciera

Please Log in or Create an account to join the conversation.

More
18 May 2020 22:28 #168198 by bkt
Replied by bkt on topic [solved]scara-switch-kins
the short video of machinery ... note 2 added axis:



regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.297 seconds
Powered by Kunena Forum