These are chat archives for machinekit/machinekit

27th
Jun 2016
zhivko
@zhivko
Jun 27 2016 06:11

Hi guys! Another linuxcnc Q: I am trying to read motion.spindle-on pin with MT_HALRCOMMAND_DESCRIBE command.
I am using this in .hal:

### Spindle ###
net spindleEnable <= motion.spindle-on
net spindleEnable => bb_gpio.p8.out-11

But I always receive value as false

I am activating spindle with gcode like M3 and M5 commands
Maybe somebody knows why I do not read spindle-on like (true) ?
Michael Haberler
@mhaberler
Jun 27 2016 06:14
we already discussed this: you MUST define a remote component, subscribe to it, and link pins
scubscribing to a non-remote component does not work
you do not "read" a pin by MT_HALRCOMMAND_DESCRIBE
zhivko
@zhivko
Jun 27 2016 06:15
hmmm why then motion.program-line can be read with MT_HALRCOMMAND_DESCRIBE ?
Michael Haberler
@mhaberler
Jun 27 2016 06:15
because it is a snapshot of ALL of HAL?
zhivko
@zhivko
Jun 27 2016 06:16
you mean haltalk has snapshot subset of pins of which it makes snapshot ?
and motion.program-line is part of this snapshot and motion.spindle-on is not?
Michael Haberler
@mhaberler
Jun 27 2016 06:16
I mean you should follow the recipe: define a remote comp, subscribe to it, link pins to it
this is how it works
getting around this by using describe is a kludge - you send a seriously huge message just to inspect a pin
zhivko
@zhivko
Jun 27 2016 06:17
Ah ok... I tended to have as low as possible zmq clients - but I see now I need to have another zmq client
Yes your remark is right about huge message...
Michael Haberler
@mhaberler
Jun 27 2016 06:18
please follow the example in hal_glib.py - it is not very complex
zhivko
@zhivko
Jun 27 2016 06:18
will do like you suggest...
Michael Haberler
@mhaberler
Jun 27 2016 06:18
aja
zhivko
@zhivko
Jun 27 2016 06:19
I disconected feedback for axis lik:
#net motor.00.pos-fb <= hpg.stepgen.00.position-fb
#net motor.00.pos-fb => axis.0.motor-pos-fb
net emcmot.00.pos-cmd => axis.0.motor-pos-fb
ANd from then on - no joint following errors anymore
Michael Haberler
@mhaberler
Jun 27 2016 06:19
hahaha
unmount wheel from car, no flat tires anymore
zhivko
@zhivko
Jun 27 2016 06:19
however I am afraid that now something iss not under control ;)
I could get larg ferror_min now with not knowing
I do not like this.
I think only fpga board could help me
Michael Haberler
@mhaberler
Jun 27 2016 06:20
do you understand the concept of a servo loop ? and what happens if you break the feedback signal?
sorry this is plain nonsense
zhivko
@zhivko
Jun 27 2016 06:21
and I didn't have large speeds - 100mm/s
yes it could happen that axis are not in coordinated mode anymore
they could be in "unpredicted" positions
Michael Haberler
@mhaberler
Jun 27 2016 06:22
look, if your solutions to following error are to disconnect the feedback signal then I am unable to help you until you understand what you are doing
zhivko
@zhivko
Jun 27 2016 06:22
no - this swas not my solution - it was just curring symptoms - I know it is not correct way -
Michael Haberler
@mhaberler
Jun 27 2016 06:22
oh really, and now guess why
zhivko
@zhivko
Jun 27 2016 06:22
I just followed advice from Alex
to see would i get complaints still - but really my question regarding which axis is hitting the ferror limit - to have this info written in console or debug log - is this possible ?
can you enlighten me - why?
Michael Haberler
@mhaberler
Jun 27 2016 06:24
try halscope
this is how you track signals over time
no need to "log"
zhivko
@zhivko
Jun 27 2016 06:25
is there ferror_min pin ?
Michael Haberler
@mhaberler
Jun 27 2016 06:25
man motion?
zhivko
@zhivko
Jun 27 2016 06:25
or ferror_min for axis pin ?
Michael Haberler
@mhaberler
Jun 27 2016 06:25
if you need any such function, either create it out of existing comps and connect it to ferror or write your own
that is what HAL is all about
zhivko
@zhivko
Jun 27 2016 06:28
Oh there is: axis.N.f-error OUT FLOAT :)
So I calculated actual velocities that can be reached with my steplen timings - have you maybe seen the table? I pasted it above.
From it I could tell that I have plenty space to reach max possible velocities...
How can I then troubleshoot jog following errors?
Michael Haberler
@mhaberler
Jun 27 2016 06:31
well if your machine can travel straight at high speeds and decels in corners, then how possibly the problem in a corner can be the max speed of the stepper? just does not add up
zhivko
@zhivko
Jun 27 2016 06:33
so accel is problem? I raised accels also...
but - I lack real filling what is acceptable accel - from machine point of view...
I mean it is easy to imagine vel, but for accel I do not have right "AugenmaƟ"
Maybe my best shot is to plot axis.N.f-error pins - to see what is actual error...?
Michael Haberler
@mhaberler
Jun 27 2016 06:37
good idea
zhivko
@zhivko
Jun 27 2016 10:45

Triying to viualize spindle-on - I ammended my .hal as:

newcomp mymotion timer=100
newpin mymotion  mymotion.program-line    s32 in
newpin mymotion  mymotion.spindle-on      bit in
ready  mymotion

net spindle-enable      motion.spindle-on => bb_gpio.p8.out-11
net spindle-enable      motion.spindle-on => mymotion.spindle-on

net net_program-line    mymotion.program-line <=  motion.program-line

motion.program-line keeps updating, but motion.spindle-on is constantly 0. I also used halscope to check value of motion.spindle-on - but it is constantly 0

ANy idea what I am missing?
Michael Haberler
@mhaberler
Jun 27 2016 10:46
have you turned on the spindle ?
zhivko
@zhivko
Jun 27 2016 10:46
yes
with M3
and I am turning it of with M5 in gcode
i have idea - I will remove mymotion.program-line from pin list - and see...
MAybe some nasty feature of myy code - that I poll only first fame...
hmmm. will try that
Michael Haberler
@mhaberler
Jun 27 2016 10:49
show the motion.spindle* pins
zhivko
@zhivko
Jun 27 2016 10:49
dont understsand
Michael Haberler
@mhaberler
Jun 27 2016 10:49
halcmd show motion.spin*
zhivko
@zhivko
Jun 27 2016 10:49
aha
ok
sec
Michael Haberler
@mhaberler
Jun 27 2016 10:53
97        bit   OUT         FALSE  motion.spindle-on                    0 ==> spindle-enable
that should become true on m3
zhivko
@zhivko
Jun 27 2016 10:54
so can I do watch halcmd show motion.spindle-on, to constantly monitor pin?
I need to monitor this and rerun simuation at the same time
Michael Haberler
@mhaberler
Jun 27 2016 10:56
open a terminal window, run halcmd -f and observe the pins
while your config is running
or use the options within axis or whatever you are using
zhivko
@zhivko
Jun 27 2016 10:59
ok i did - it stays FALSE all the time :(
Michael Haberler
@mhaberler
Jun 27 2016 11:01
what about setting a spindle speed, like M3 S300
zhivko
@zhivko
Jun 27 2016 11:01
aa
for a second I thougth I saw:
97 bit OUT TRUE motion.spindle-brake 0
yes
motion.spindle-brake in action
it is flashing 0 -1
it seems I need to release break?
this channel is not a replacement for reading, and I think what you are doing is abusive
zhivko
@zhivko
Jun 27 2016 11:05
I appologize but it seemed fr me that M3 M5 should work from start... but obviously there is more to be configured there
Michael Haberler
@mhaberler
Jun 27 2016 11:06
no there is to be read the manual: turn on spindle and set speed, and no I am not going to point you to it
sorry, but that is not OK
zhivko
@zhivko
Jun 27 2016 11:08
ughhh what can I do now seems - to me I need to go to linuxcnc irc channel maybe they will find compasion for novice users
Michael Haberler
@mhaberler
Jun 27 2016 11:10
no you can read the damn gcode manual, but if you think you will have it read to you over IRC - give it a try; and dont be surprised if nobody there is enthusiastic
zhivko
@zhivko
Jun 27 2016 11:10
ok but sinc eI am trying to use plasma isn't it little silly to have spindle speed there ?
OK I know I could see referenc eimplementation for plasma cutter...
I bet it is there...
You don't need to comment sorry ;)
zhivko
@zhivko
Jun 27 2016 14:22
Hmmm interesting - I got "joint 2 following error" but on halscope axis.2.f-error is all the time 0
zhivko
@zhivko
Jun 27 2016 14:38

but halcmd shows this values quite ok

halcmd show pin *.f-error

zhivko
@zhivko
Jun 27 2016 14:47

OK I tried to output this values to file and this values was last ones: They all seems pretty low for my taste... but certainly in F_ERROR_MIN and F_ERROR range

Component Pins:
  Comp   Inst Type  Dir         Value  Name                             Epsilon         Flags
    97        float OUT             0  axis.0.f-error                    0.000010    0
    97        float OUT  1.358459e-07  axis.1.f-error                    0.000010    0
    97        float OUT             0  axis.2.f-error                    0.000010    0
    97        float OUT  0.0003321184  axis.3.f-error                    0.000010    0
    97        float OUT  0.0001649614  axis.4.f-error                    0.000010    0

but possibly last error that ended in joint following error is not logged... :(

zhivko
@zhivko
Jun 27 2016 14:59
OK 1s captured f-error on all axes - here is result: http://pastebin.com/hgDm9YNT. I know that maybe 1s could be not enough frequent - but all this values show very small f-error - certainly within limits... I have no clew what to check more...