Mesa 7i76e - Joint 0/2 following error

More
16 Jul 2017 11:23 - 16 Jul 2017 12:31 #95839 by JackBerkhout
Hi,
I'm new to LinuxCNC. I try to use it for an Emco Compact 5 (CNC) Latthe, where the existing electronics were destroyed.

For this, I got a Mesa 7i76e board.
In PncConf, I selected Latthe and the board and kept everything else on default, as I have no clue yet what I should look for in the wizard.
So now I have my ini and hal file.
I connected one (open-loop) stepper driver and stepper motor, just to see if it would turn while running the gcode "EMC2 AXIS", and it does! (I think it is a bit strange example gcode for the lathe configuration, but it lets me nicely try this.)

However I randomly get these errors (all four at once):
1.
Unexpected realtime delay on task 0
This message will only display once per session.
Run the latency Test and resolve before continuing.

I run it, but running that doesn't resolve it. Maybe I have to do something with the vales, but it doesn't tell what to do with each reading.
For me it not really a helpful message.

2.
hm2/hm2_7i76e.0: error finishing read!
iter=312321

Honestly, I have no clue what this tells me.

3.
Joint 0 following error
4.
Joint 2 following error

I couldn't find a solution for the joint following error. Somebody solved the same error, but didn't tell how he did it.

After this nothing works anymore, except quiting LinuxCNC.

The PC is not particular fast (A Zotac ZBOX Nano 320, AMD 1GHz)

What could be the problem of all these problems?

First checking here would be the best approach to solve the problem.
Otherwise I would maybe better of with EdingCNC?

If it helps, my hal file looks like this (Note, the IP address have been changed, so I can experiment with LinuxCNC on my existing network, and that's why I can post the hal file here):

# Generated by PNCconf at Sat Jul 8 01:50:45 2017
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hostmot2
loadrt hm2_eth board_ip="192.168.2.130" config="firmware=hm2/7i76/7i76e.BIT num_encoders=1 num_pwmgens=0 num_stepgens=5 sserial_port_0=00xxxx"
setp hm2_7i76e.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s

addf hm2_7i76e.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_7i76e.0.write servo-thread
setp hm2_7i76e.0.dpll.01.timer-us -50
setp hm2_7i76e.0.stepgen.timer-number 1

# external output signals


# external input signals


#*******************
# AXIS X
#*******************

setp pid.x.Pgain [AXIS_0]P
setp pid.x.Igain [AXIS_0]I
setp pid.x.Dgain [AXIS_0]D
setp pid.x.bias [AXIS_0]BIAS
setp pid.x.FF0 [AXIS_0]FF0
setp pid.x.FF1 [AXIS_0]FF1
setp pid.x.FF2 [AXIS_0]FF2
setp pid.x.deadband [AXIS_0]DEADBAND
setp pid.x.maxoutput [AXIS_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
net x-vel-cmd => pid.x.command-deriv
net x-pos-fb => pid.x.feedback
net x-output => pid.x.output

# Step Gen signals/setup

setp hm2_7i76e.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_7i76e.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_7i76e.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_7i76e.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_7i76e.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
setp hm2_7i76e.0.stepgen.00.step_type 0
setp hm2_7i76e.0.stepgen.00.control-type 1
setp hm2_7i76e.0.stepgen.00.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp hm2_7i76e.0.stepgen.00.maxvel [AXIS_0]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net x-pos-cmd <= axis.0.motor-pos-cmd
net x-vel-cmd <= axis.0.joint-vel-cmd
net x-output <= hm2_7i76e.0.stepgen.00.velocity-cmd
net x-pos-fb <= hm2_7i76e.0.stepgen.00.position-fb
net x-pos-fb => axis.0.motor-pos-fb
net x-enable <= axis.0.amp-enable-out
net x-enable => hm2_7i76e.0.stepgen.00.enable

# ---setup home / limit switch signals---

net x-home-sw => axis.0.home-sw-in
net x-neg-limit => axis.0.neg-lim-sw-in
net x-pos-limit => axis.0.pos-lim-sw-in

#*******************
# AXIS Z
#*******************

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

net z-index-enable <=> pid.z.index-enable
net z-enable => pid.z.enable
net z-pos-cmd => pid.z.command
net z-vel-cmd => pid.z.command-deriv
net z-pos-fb => pid.z.feedback
net z-output => pid.z.output

# Step Gen signals/setup

setp hm2_7i76e.0.stepgen.01.dirsetup [AXIS_2]DIRSETUP
setp hm2_7i76e.0.stepgen.01.dirhold [AXIS_2]DIRHOLD
setp hm2_7i76e.0.stepgen.01.steplen [AXIS_2]STEPLEN
setp hm2_7i76e.0.stepgen.01.stepspace [AXIS_2]STEPSPACE
setp hm2_7i76e.0.stepgen.01.position-scale [AXIS_2]STEP_SCALE
setp hm2_7i76e.0.stepgen.01.step_type 0
setp hm2_7i76e.0.stepgen.01.control-type 1
setp hm2_7i76e.0.stepgen.01.maxaccel [AXIS_2]STEPGEN_MAXACCEL
setp hm2_7i76e.0.stepgen.01.maxvel [AXIS_2]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net z-pos-cmd <= axis.2.motor-pos-cmd
net z-vel-cmd <= axis.2.joint-vel-cmd
net z-output <= hm2_7i76e.0.stepgen.01.velocity-cmd
net z-pos-fb <= hm2_7i76e.0.stepgen.01.position-fb
net z-pos-fb => axis.2.motor-pos-fb
net z-enable <= axis.2.amp-enable-out
net z-enable => hm2_7i76e.0.stepgen.01.enable

# ---setup home / limit switch signals---

net z-home-sw => axis.2.home-sw-in
net z-neg-limit => axis.2.neg-lim-sw-in
net z-pos-limit => axis.2.pos-lim-sw-in

#*******************
# SPINDLE S
#*******************

setp pid.s.Pgain [SPINDLE_9]P
setp pid.s.Igain [SPINDLE_9]I
setp pid.s.Dgain [SPINDLE_9]D
setp pid.s.bias [SPINDLE_9]BIAS
setp pid.s.FF0 [SPINDLE_9]FF0
setp pid.s.FF1 [SPINDLE_9]FF1
setp pid.s.FF2 [SPINDLE_9]FF2
setp pid.s.deadband [SPINDLE_9]DEADBAND
setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp pid.s.error-previous-target true

net spindle-index-enable <=> pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output

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

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

net spindle-revs <= hm2_7i76e.0.encoder.00.position
net spindle-vel-fb-rps <= hm2_7i76e.0.encoder.00.velocity
net spindle-index-enable <=> hm2_7i76e.0.encoder.00.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb-rps => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true


#******************************
# connect miscellaneous signals
#******************************

# ---HALUI signals---

net joint-select-a halui.joint.0.select
net x-is-homed halui.joint.0.is-homed
net jog-x-pos halui.jog.0.plus
net jog-x-neg halui.jog.0.minus
net jog-x-analog halui.jog.0.analog
net joint-select-c halui.joint.2.select
net z-is-homed halui.joint.2.is-homed
net jog-z-pos halui.jog.2.plus
net jog-z-neg halui.jog.2.minus
net jog-z-analog halui.jog.2.analog
net jog-selected-pos halui.jog.selected.plus
net jog-selected-neg halui.jog.selected.minus
net spindle-manual-cw halui.spindle.forward
net spindle-manual-ccw halui.spindle.reverse
net spindle-manual-stop halui.spindle.stop
net machine-is-on halui.machine.is-on
net jog-speed halui.jog-speed
net MDI-mode halui.mode.is-mdi

# ---coolant signals---

net coolant-mist <= iocontrol.0.coolant-mist
net coolant-flood <= iocontrol.0.coolant-flood

# ---probe signal---

net probe-in => motion.probe-input

# ---motion control signals---

net in-position <= motion.in-position
net machine-is-enabled <= motion.motion-enabled

# ---digital in / out signals---

# ---estop signals---

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

# ---manual tool change signals---

loadusr -W hal_manualtoolchange
net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared



Kind regards,
Jack.
Last edit: 16 Jul 2017 12:31 by JackBerkhout.

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

More
16 Jul 2017 11:58 #95842 by rodw
Jack, I had a bit of this happening when I set up my 7i76e.

These settings in my .ini file were the what was causing it for me..
MAX_VELOCITY = 300
MAX_ACCELERATION = 1500
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 700
STEPGEN_MAXACCEL = 2000

Increasing these I mean
STEPGEN_MAXVEL = 700
STEPGEN_MAXACCEL = 2000

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

More
16 Jul 2017 12:12 - 16 Jul 2017 12:27 #95843 by JackBerkhout
Hi Rodw,
thank you very much for your quick response:
I had these values in my ini file for Axis X and Axis Z, by default:
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXVEL = 31.25
STEPGEN_MAXACCEL = 937.50

I changed those to

MAX_VELOCITY = 300
MAX_ACCELERATION = 1500
STEPGEN_MAXVEL = 700
STEPGEN_MAXACCEL = 2000

After testing, I quickly got the same messages, except joint 0 following error was not there, only jont 2 following error.
And of course the other two errors. They all pop-up at the same time.
Could my barebone PC be too slow?



Kind regards,
Jack.
Attachments:
Last edit: 16 Jul 2017 12:27 by JackBerkhout.

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

More
16 Jul 2017 12:44 #95844 by rodw
Jack, I'm not sure about the "error finishing read". Perhaps someone like PCW can be clearer in his response.

Perhaps attach your .ini file and report your stepper motor driver model and it specifications in relation to step timings so others can review. Also report your latency results.

I'm using a USFF pc with a Celeron N3160 in it and I've had no troubles. Yours might be a bit slower.

If you are using the internal wifi card, remove it as they are massive latency hogs. Use a USB wifi dongle instead. PCW has spoken about this a few times. I tried mine and he was right!

I wondered if you have a motor on joint 2 on a lathe. Are you sure you are not using joint 0 & 1? How did you wire them in on the 7i76e? (eg. which stepgens did you use?)

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

More
16 Jul 2017 13:55 - 16 Jul 2017 13:56 #95846 by PCW
It appears that your main issue is that your host PC has poor latency

All subsequent errors are caused by the real time delay, the "error finishing read" means that LinuxCNC sent out a request to the 7I76e to read data but nothing was returned before linuxCNC timed out the request and gave up. The
following error happens because of lack of up-to-date position feedback

Have you run a latency test or better latency-histogram on your PC?
To do this, type
latency-histogram --nobase

And run it for at least an hour or so while doing other normal computer things

Are _all_ power management options disabled in the BIOS?
This means all "cool and quiet", C-state, turbo speed options etc
Last edit: 16 Jul 2017 13:56 by PCW.

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

More
16 Jul 2017 14:28 #95848 by JackBerkhout
Basically, I run PncConf with default, but for "lathe" and Mesa 7i76e board.
Then for test, I connected one stepperdriver and NEMA17 motor, just for test.
The lathe which is going to be converted is in another city, I would like to get the configuration right on the "test-bench", before heading there.

I run thee gcode that is loaded at startup and measured with a scope where the step and dir signals resided.
Those happen on TB2.
My board doesn't have pin numbers near those connectors, but in the manual I only see a black dot at the bottom, when holding the Ethernet connector to the left-top side (board in landscape).
For now I assume numbering starts from the bottom.

So I connected just one cheap Chinese (open-loop) stepperdriver to TB2
www.aliexpress.com/item/TB6600-4A-9-42V-...xes/32702091551.html

Step on pins 8 and 9
Dir on pins 10 and 11

The signals also appear on pins 2, 3, 4,, and 5. For the there are two axis: X and Z, right?

Though, I didn't find where those pins are configured in the hal or ini file, that's why I used a oscilloscope, to find out.

You see I'm totally new on LinuxCNC, and having a bit hard time to advance.
I have to study it much more, before giving up on it.
Maybe we can get things right,

There are no step timings stated for this stepper driver. But since I do not use any movement feedback, that probably doesn't matter, as long as the motor turns reliable, which it seems to me.
The board would if I connected a stepper driver to one of its outputs I guess.
In the hal file I can make up we have joint 0 and joint 2, and only those seem to give errors.
I don't know what joints are, yet.

The I7i76e does not seem to have a WiFi on-board, as far as I can see, and the manual doesn't talk about WiFi.
Because I didn't configure WiFi, it shouldn't be the problem, right?

After 5 minutes of running the latency test, the bold values are:
Servo thread (1ms) 78998607
Base thread (25us): 123410

Attached the ini and hal file.

File Attachment:

File Name: my_LinuxCN...hine.ini
File Size:3 KB

File Attachment:

File Name: my_LinuxCN...hine.hal
File Size:8 KB
Attachments:

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

More
16 Jul 2017 14:37 #95849 by PCW
This is _not_ a hal/ini file issue, this is a latency issue our your PC which can likely
be resolved by BIOS setup

Try running the latency-test or latency-histogram with the base thread disabled
as the stock base thread period will cause issues on your relatively slow PC
preventing accurate latency measurement

For the latency histogram you do this with:

latency-histogram --nobase

for the latency test:

latency-test 1ms 1ms

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

More
16 Jul 2017 14:40 - 16 Jul 2017 15:10 #95850 by JackBerkhout
Hi PCW, it's running...

So far, after 20 minutes, to give an impression.
I have no clue if it looks good.

Regards,
Jack.
Attachments:
Last edit: 16 Jul 2017 15:10 by JackBerkhout.

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

More
16 Jul 2017 15:49 - 16 Jul 2017 15:51 #95851 by PCW
That looks OK though not great
Have you disabled all power management options in the BIOS?

Have you tried running normal PC applications, moving windows around, playing videos etc while the latency test is running?

Also what Ethernet hardware is used on your PC? (may need the results of dmesg to check)

Also as rodw mentioned ,disable any internal WIFI cards as some of those are notoriously bad for latency
(Broadcom anything is a disaster)
Last edit: 16 Jul 2017 15:51 by PCW.

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

More
16 Jul 2017 16:38 - 16 Jul 2017 16:59 #95852 by JackBerkhout
Thank you very much PCW!!!

Maybe I found something.
The Ethernet interface in the barebone didn't work after LinuxCNC installation, so I used a USB-to-Ethernet adapter.
I removed it and tried the Ethernet port again and it now works, probably because of updates.
Such an adapter is far from ideal, I guess.
I disabled the power options in the BIOS, but could not find the WiFi disable option.

Testing sofar, that seems to make the difference!

Kind regards,
Jack.
Last edit: 16 Jul 2017 16:59 by JackBerkhout.

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

Moderators: PCWjmelson
Time to create page: 0.130 seconds
Powered by Kunena Forum