Linuxcnc joint 0 following error

So I have Linuxcnc with Mesa 5i25 and 7i77 boards with BE25A20 AMC drives. I have removed the timing belts on the sem DC brushed servo motors. I have wired all...

# Generated by PNCconf at Sat Mar 28 17:57:56 2020
# 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_pci config=» num_encoders=6 num_pwmgens=0 num_stepgens=0 sserial_port_0=000xxx»
setp hm2_5i25.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.s

addf hm2_5i25.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.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_5i25.0.write servo-thread

# external output signals

# external input signals

# — ESTOP-EXT —
net estop-ext <= hm2_5i25.0.7i77.0.0.input-00

# — MIN-HOME-X —
net min-home-x <= hm2_5i25.0.7i77.0.0.input-09

# — MIN-HOME-Y —
net min-home-y <= hm2_5i25.0.7i77.0.0.input-10

# — MAX-HOME-Z —
net max-home-z <= hm2_5i25.0.7i77.0.0.input-11

#*******************
# 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

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

# —PWM Generator signals/setup—

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

net x-output => hm2_5i25.0.7i77.0.1.analogout0
net x-pos-cmd axis.0.motor-pos-cmd
net x-enable axis.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 [AXIS_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 => axis.0.motor-pos-fb
net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts

# —setup home / limit switch signals—

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

#*******************
# AXIS Y
#*******************

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

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

# —PWM Generator signals/setup—

setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT

net y-output => hm2_5i25.0.7i77.0.1.analogout1
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out

# —Encoder feedback signals/setup—

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

net y-pos-fb <= hm2_5i25.0.encoder.01.position
net y-vel-fb <= hm2_5i25.0.encoder.01.velocity
net y-pos-fb => axis.1.motor-pos-fb
net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts

# —setup home / limit switch signals—

net min-home-y => axis.1.home-sw-in
net min-home-y => axis.1.neg-lim-sw-in
net y-pos-limit => axis.1.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

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

# —PWM Generator signals/setup—

setp hm2_5i25.0.7i77.0.1.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT

net z-output => hm2_5i25.0.7i77.0.1.analogout2
net z-pos-cmd axis.2.motor-pos-cmd
net z-enable axis.2.amp-enable-out

# —Encoder feedback signals/setup—

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

net z-pos-fb <= hm2_5i25.0.encoder.02.position
net z-vel-fb <= hm2_5i25.0.encoder.02.velocity
net z-pos-fb => axis.2.motor-pos-fb
net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable
net z-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts

# —setup home / limit switch signals—

net max-home-z => axis.2.home-sw-in
net z-neg-limit => axis.2.neg-lim-sw-in
net max-home-z => 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

# —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-b halui.joint.1.select
net y-is-homed halui.joint.1.is-homed
net jog-y-pos halui.jog.1.plus
net jog-y-neg halui.jog.1.minus
net jog-y-analog halui.jog.1.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-ext => 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

Романов Семен

Почётный участник
Почётный участник
Сообщения: 646
Зарегистрирован: 23 янв 2012, 23:25
Репутация: -80
Откуда: Самара

[linuxcnc] error: joint 0 following error

Присказка:
Станок китайский, благодаря разработкам уважаемого Nick’a смог фрезеровать печатные платы.
Речь не об этом.
Станок стоял, настроенный — прекрасно работал.
И вдруг захотелось мне что-то выточить из дерева.
В край поболававшись на конфиге заточенном под печатные платы — я понял что могу крутое, и начал фрезеровать икону. И с размерами не побоялся: 180мм*250мм
Ну и вообщем медленно это все, и сбился станок по оси Х.
В итоге фрезеровку остановил, и понял. 1680 мм/мин = это маааало.

Внимание вопрос: как подобрать МАКСИМАЛЬНУЮ скорость и УСКОРЕНИЕ?

Вообще китаец заявил что может он 2000мм/мин.
Когда то этот станок по началу цеплял на мач. так я его там раскручивал до 3500 и он не глюкал. причем на более слабом компе.

Сейчасв все чем занимался зимой с линухснс — подзабыл.

Проблема в чем: когда писали компенсацию — по какойто причине снизили максимальную скорость с ранее заявленных 2000 до 1680.
И меня это не пугало — для печатных плат — ЗА ГЛАЗА.

Сейчас хочу попробовать добиться хотя бы 2500.
Но вылетает данная ошибка. При увеличении ускорения. (((пока на оси Х, экспериментирую на ней)))

Вообщем, интересно узнать, кто и как подбирал МАКСИМУМЫ СТАНКА?

billsmith

Опытный
Сообщения: 128
Зарегистрирован: 04 июн 2012, 23:46
Репутация: 5
Контактная информация:

Аватара пользователя

Nick

Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1734
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: [linuxcnc] error: joint 0 following error

Сообщение

Nick » 21 июл 2012, 19:07

Эта ошибка говорит, что станок отклонился от траектории больше чем на значение FERROR. Но у тебя стоят шаговые двигатели без обратной связи поэтому LinuxCNC не знает где на самом деле находится станок. Поэтому используется искусственная обратная связь основанная на количестве шагов посланных драйверам.

В общем, скинь свой конфиг :).

Аватара пользователя

Nick

Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1734
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: [linuxcnc] error: joint 0 following error

Сообщение

Nick » 21 июл 2012, 20:10

А можно было просто увеличить FERROR для осей. Просто станок за время одного servo периода на больших скоростях пробегат больше, и при расчете обратной связи выходит за предельное значение отклонения от траектории.

Аватара пользователя

Nick

Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1734
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Романов Семен

Почётный участник
Почётный участник
Сообщения: 646
Зарегистрирован: 23 янв 2012, 23:25
Репутация: -80
Откуда: Самара

Re: [linuxcnc] error: joint 0 following error

Сообщение

Романов Семен » 21 июл 2012, 20:27

Nick писал(а):Косяки — это пропуск шагов?

Ну похоже на то.

vladimir74 писал(а):А может вообще лучше новый конфиг сделать, для работы с деревом, если с текущим сильно наворочили?

так новый конфиг и сделан, старый не сильно наворочен, он аккурат заточен под печатные платы.
а станок хочу применить еще для деревообработки.

JudasPriest

Мастер
Сообщения: 501
Зарегистрирован: 17 мар 2015, 14:41
Репутация: 202
Настоящее имя: Максим
Откуда: Украина
Контактная информация:

Re: [linuxcnc] error: joint 0 following error

Сообщение

JudasPriest » 25 дек 2017, 08:22

Здравствуйте. Извините, что поднял древнюю тему. Столкнулся с этой проблемой, пытался сам решить, но безуспешно. Стоят шаговики и вылазит постоянно такая ошибка. Игрался со значениями Ferror и Minferror. Если ставить их большие, допустим 10 и 1, то такое ощущение, что станок отходит значительно от траектории, а потом возвращается назад. Детали ещё не грызу, так как не могу нормально УП прогнать. Я уже снизил скорость перемещений до 800мм/мин и все-равно вылезло. Сейчас значения стоят 1 и 0.1 (1/16 деление на маторах, шаг винта 6мм). Может его можно вообще как-то отключить? Заранее благодарю

Аватара пользователя

Serg

Мастер
Сообщения: 21923
Зарегистрирован: 17 апр 2012, 14:58
Репутация: 5179
Заслуга: c781c134843e0c1a3de9
Настоящее имя: Сергей
Откуда: Москва
Контактная информация:

Re: [linuxcnc] error: joint 0 following error

Сообщение

Serg » 25 дек 2017, 13:02

verser писал(а):Желательно увидеть «Max Jitter» < 15000. Можно попробовать рекомендации:

с внешним stepgen (5i25) удовлетворительно работает и при Max Jitter в 100000.

Я не Христос, рыбу не раздаю, но могу научить, как сделать удочку…

JudasPriest

Мастер
Сообщения: 501
Зарегистрирован: 17 мар 2015, 14:41
Репутация: 202
Настоящее имя: Максим
Откуда: Украина
Контактная информация:

Re: [linuxcnc] error: joint 0 following error

Сообщение

JudasPriest » 25 дек 2017, 14:09

UAVpilot писал(а):

verser писал(а):Желательно увидеть «Max Jitter» < 15000. Можно попробовать рекомендации:

с внешним stepgen (5i25) удовлетворительно работает и при Max Jitter в 100000.

Только у меня значения на порядок выше. Может к концу недели будет время и установим с товарищем на стационарный системник Линукс и попробуем привязать 7i92

demyuri

demyuri

Регистрация
31.10.2019
Сообщения
9 080
Реакции
8 092
Баллы
200
Возраст
48
Адрес
РОССИЯ
Веб-сайт
youtu.be
Город
Барнаул
Имя
Юрий
Станок
3018 ПРО, доработанный
Плата
Дятел 3.4
Прошивка
1.1f

Ivankralexan

Регистрация
02.01.2021
Сообщения
23
Реакции
4
Баллы
23
Имя
Иван

  • #3

Если было бы хорошо,я бы не писал об этой проблеме,останавливает процесс с этой ошибкой

demyuri

demyuri

Регистрация
31.10.2019
Сообщения
9 080
Реакции
8 092
Баллы
200
Возраст
48
Адрес
РОССИЯ
Веб-сайт
youtu.be
Город
Барнаул
Имя
Юрий
Станок
3018 ПРО, доработанный
Плата
Дятел 3.4
Прошивка
1.1f

  • #4

Если было бы хорошо,я бы не писал об этой проблеме,останавливает процесс с этой ошибкой

А где написано, что это проблема? И какие пытки к вам нужно применить, чтобы вытянуть ВСЕ подробности??? 10 мин, не будет внятных пояснений, тема пойдет к Ванге.

Ivankralexan

Регистрация
02.01.2021
Сообщения
23
Реакции
4
Баллы
23
Имя
Иван

  • #5

А где написано, что это проблема? И какие пытки к вам нужно применить, чтобы вытянуть ВСЕ подробности??? 10 мин, не будет внятных пояснений, тема пойдет к Ванге.

Извиняюсь,при фрезеровке модели 150 на 65 процесс встает колом(фрезеровка останавливается)

Ошибка Joint 0 following error
При фрезеровке 140 на 65 проблем не возникает

Ваши сообщения автоматически объединены: 13.04.2021

Извиняюсь,при фрезеровке модели 150 на 65 процесс встает колом(фрезеровка останавливается)(Горизонтальная фрезеровка)

Ошибка Joint 0 following error
При фрезеровке 140 на 65 проблем не возникает (вертикальная фрезеровка)

demyuri

demyuri

Регистрация
31.10.2019
Сообщения
9 080
Реакции
8 092
Баллы
200
Возраст
48
Адрес
РОССИЯ
Веб-сайт
youtu.be
Город
Барнаул
Имя
Юрий
Станок
3018 ПРО, доработанный
Плата
Дятел 3.4
Прошивка
1.1f

  • #6

Станок? Плата? Прошивка? Сендер? УП в каком КАМе делали? Размер УП?

Ivankralexan

Регистрация
02.01.2021
Сообщения
23
Реакции
4
Баллы
23
Имя
Иван

  • #7

Станок? Плата? Прошивка? Сендер? УП в каком КАМе делали? Размер УП?

Cтанок кастомный, шаговики nema23,плата TB6600,Арткам,5мб (фрезеровка 3д)

demyuri

demyuri

Регистрация
31.10.2019
Сообщения
9 080
Реакции
8 092
Баллы
200
Возраст
48
Адрес
РОССИЯ
Веб-сайт
youtu.be
Город
Барнаул
Имя
Юрий
Станок
3018 ПРО, доработанный
Плата
Дятел 3.4
Прошивка
1.1f

  • #8

Простите, не понимаю:(

Это плата драйвера. Или я ошибаюсь?
Вот здесь вроде разбирались с этим:

Roger

Roger

Регистрация
02.04.2019
Сообщения
262
Реакции
340
Баллы
138
Возраст
56
Адрес
СССР
Город
Калуга
Имя
Александр

  • #9

При фрезеровке больших деталей,уходит в ошибку joint 0 following error

1618338229190.png

Ivankralexan

Регистрация
02.01.2021
Сообщения
23
Реакции
4
Баллы
23
Имя
Иван

  • #10

Убил двух зайцев сразу
Может быть у кого нибудь будет эта проблема
Joint 0 Following error
Joint 2 Following error
————
Ferror
Min Ferror
——————

увеличив два параметра выше проблема ушла

Содержание

  1. Following Error
  2. Following Error Definition
  3. Following Error Trip Ramp
  4. Following Error and Stepper Driven Machines
  5. cnc-club.ru
  6. ошибка в G коде? axis following error
  7. ошибка в G коде? axis following error
  8. Re: ошибка в G коде? axis following error
  9. Re: ошибка в G коде? axis following error
  10. Re: ошибка в G коде? axis following error
  11. Re: ошибка в G коде? axis following error
  12. Re: ошибка в G коде? axis following error
  13. cnc-club.ru
  14. [linuxcnc] error: joint 0 following error
  15. [linuxcnc] error: joint 0 following error
  16. Strange Joint Following Error
  17. Joint following error
  18. File Attachment:

Following Error

Following Error Definition

While an axis is in motion, LinuxCNC sends commands for the current position. We call this the commanded position. It is where the axis is supposed to be. Whenever a drive receives a velocity command it takes time for it to get up to that velocity and move to the commanded position. The difference between commanded and actual is following error. Commanded and actual position ought to be the same for an ideal machine. Inertia and such get in the way and add to following error.

LinuxCNC checks to see whether the commanded position is within range of the actual position. If this error is out of range, you get an error message something like:

Joint 0 following error.

When this error pops up you can be pretty certain that there are problems with the way your ini file is set.

Following Error Trip Ramp

The LinuxCNC ini file uses two variables, FERROR and MIN_FERROR to define acceptable following error for each axis. Think of MIN_FERROR as the amount of following error (distance) allowed at very low velocity and FERROR as the distance allowed during rapid moves.

The graph shown below approximates what the following error trip line looks like when FERROR is set to 1 and MIN_FERROR is set to 0.01. MAX_Velocity for this graph has been set to 500. I did not set any units here and that is deliberate. The reason is that the meaning of the trip line will follow the units used for velocity, which follows the units that are defined for the axis in the ini. If that unit is inches, then the velocity is in inches per second and the trip line is related to that unit.

You should think of any following error to the left of the diagonal line as acceptable for that velocity . If you look at 250 units velocity (the green lines) any following error less than half way between FERROR and MIN_FERROR is acceptable and will not trip out axis motion. If you increase the velocity to 400 and draw a similar pair of lines there, it will include all acceptable following errors at that velocity.

The units of Ferror and Min_Ferror are the same as the units of length used for that axis. So if your axis is in inches, and your Ferror is 1, that means an error of 1 inch will cause it to trip. Likewise, if Min_Ferror is 0.01, then an error of 0.01 inches will trip it at low speed.

The point of the following error trip as set up in LinuxCNC is to constrain following error and cause the machine to fail if it’s error is greater than some known value. By using both FERROR and MIN_FERROR the integrator is able to define values that are acceptable for their machine.

Following Error and Stepper Driven Machines

The concept of a following error is funny when talking about stepper motors. Since they are an open loop system, there is no position feedback to let you know if you actually are out of range.

Following errors usually have two causes on steppers

1. too little ferror or min_ferror

2. the RT pulsing can’t keep up with the speed needed

2.a. BASE_PERIOD set incorrectly or (requested step rate is not possible at this BASE_PERIOD)

Источник

cnc-club.ru

Статьи, обзоры, цены на станки и комплектующие.

ошибка в G коде? axis following error

ошибка в G коде? axis following error

Сообщение roach » 26 янв 2012, 13:32

Re: ошибка в G коде? axis following error

Сообщение Nick » 26 янв 2012, 13:46

Use the Console, Luke.

Re: ошибка в G коде? axis following error

Сообщение roach » 26 янв 2012, 15:44

Re: ошибка в G коде? axis following error

Сообщение Nick » 26 янв 2012, 16:05

Эта ошибка не зависит от Gкода. Может просто резкий поворот на какой-то оси и он вызывает following error. Может настроены скругления. Хотя они не должны вкладываться в following error. Я думаю, если ехать в режиме exact stop G61.1, то ошибки не будет.

Попробуй прогнать это еще раз и сделай скрин осциллографа, в котором будет ferror по оси и cmd по оси.

Use the Console, Luke.

Re: ошибка в G коде? axis following error

Сообщение roach » 26 янв 2012, 16:11

Nick писал(а): Эта ошибка не зависит от Gкода. Может просто резкий поворот на какой-то оси и он вызывает following error. Может настроены скругления. Хотя они не должны вкладываться в following error. Я думаю, если ехать в режиме exact stop G61.1, то ошибки не будет.

Попробуй прогнать это еще раз и сделай скрин осциллографа, в котором будет ferror по оси и cmd по оси.

Re: ошибка в G коде? axis following error

Сообщение roach » 27 янв 2012, 09:40

УП делаю в SprutCam, может у меня постпроцессор кривой? качал отсюда http://download.sprutcam.com/index.php? . ssors/EMC/

У кого токарник? проверьте пожалуйста

Источник

cnc-club.ru

Статьи, обзоры, цены на станки и комплектующие.

[linuxcnc] error: joint 0 following error

[linuxcnc] error: joint 0 following error

Сообщение Романов Семен » 21 июл 2012, 15:33

Присказка:
Станок китайский, благодаря разработкам уважаемого Nick’a смог фрезеровать печатные платы.
Речь не об этом.
Станок стоял, настроенный — прекрасно работал.
И вдруг захотелось мне что-то выточить из дерева.
В край поболававшись на конфиге заточенном под печатные платы — я понял что могу крутое, и начал фрезеровать икону. И с размерами не побоялся: 180мм*250мм
Ну и вообщем медленно это все, и сбился станок по оси Х.
В итоге фрезеровку остановил, и понял. 1680 мм/мин = это маааало.

Внимание вопрос: как подобрать МАКСИМАЛЬНУЮ скорость и УСКОРЕНИЕ?

Вообще китаец заявил что может он 2000мм/мин.
Когда то этот станок по началу цеплял на мач. так я его там раскручивал до 3500 и он не глюкал. причем на более слабом компе.

Сейчасв все чем занимался зимой с линухснс — подзабыл.

Проблема в чем: когда писали компенсацию — по какойто причине снизили максимальную скорость с ранее заявленных 2000 до 1680.
И меня это не пугало — для печатных плат — ЗА ГЛАЗА.

Сейчас хочу попробовать добиться хотя бы 2500.
Но вылетает данная ошибка. При увеличении ускорения. (((пока на оси Х, экспериментирую на ней)))

Вообщем, интересно узнать, кто и как подбирал МАКСИМУМЫ СТАНКА?

Источник

Strange Joint Following Error

  • Posts: 40
  • Thank you received: 1

Thanks to the fantastic help from this forum, I now have a rotary table running in sync with a lathe spindle for hobbing

I am confused as to why I get a rotary table ‘joint following error’ when I’m running the above hobbing configuration, but not getting it when I load the threading configuration which syncs the spindle to the linear Z axis.

I’m using the Pico-systems USC board, so the step pulsing shouldn’t be an issue. The only thing I can think of is latency could be causing a problem with the sync stuff in the hobbing configuration HAL files.

The computer appears to have high latency — I ran the latency test for 15 mins and messed around with the web browser getting max jitter values of roughly 4,000,000 ns for servo thread and 2,300,000 ns for base thread. This high latency doesn’t seem to affect normal lathe control with the USC board, nor threading, just the newly setup hobbing. I can’t figure out what is going on!

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

  • Posts: 703
  • Thank you received: 132

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

  • llrjt100
  • Offline
  • Senior Member
  • Posts: 40
  • Thank you received: 1

Thanks for the recommendation — I ran Halscope and monitored ferror, which builds linearly until it reaches the FERROR or MIN_FERROR values (both the same) and the joint 1 following error is triggered. This explains nicely why the following error occurs instantaneously with FERROR=MIN_FERROR=1, more slowly when =10, and several seconds when =100.

I’ll take a look at position-cmd and position-fb next.

Working now! — in adapting Andy’s hobbing code, I dropped the final ‘Reset logic’ part of his .hal configuration, so I didn’t have position-fb (pid.1.feedback) connected to scale.0.out! I’ve reset the .ini file FERROR=1 and MIN_FERROR=0.1 and checked the Halscope and all is well.

I’m very relieved I found it, and thank you again for pointing me in the right direction initially

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

  • Posts: 23148
  • Thank you received: 4423

I’ve reset the .ini file FERROR=1 and MIN_FERROR=0.1 and checked the Halscope and all is well.

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

  • llrjt100
  • Offline
  • Senior Member
  • Posts: 40
  • Thank you received: 1

I can probably fine tune FERROR etc. but need to confirm that the spindle (hob) to rotary table (worm wheel blank) electronic gear ratio is correct first — it seems to low, and I’m struggling a little to find a way to measure. I’d be very grateful for a check of my calculations:

I want to hob a 200 tooth worm wheel, so the spindle (hob) needs to revolve 200 times for every 1 turn of the rotary table (worm wheel blank).

The spindle encoder outputs 10,000 pulses per revolution.

The rotary table stepper is 1.8 deg. (200 fullsteps per rev) driven at 1/8 microstep through the 90:1 rotary table — this gives 200 x 8 x 90 = 144,000 microsteps per rotary table revolution (400 microsteps per degree).

I need 200 revs of the rotary table for every 1 rev of the spindle, so the ratio of spindle encoder position to rotary table steps is 144,000 / (200 * 10,000) = 0.072, and I’ve set scale.0.gain to this value.

I’d like to perform a quick gear ratio cross check by comparing spindle and rotary table rpms — with the spindle at 200 rpm, the rotary table should be at 1 rpm.

My top spindle speed is 2,300 rpm, and I have simple potentiometer control over the spindle VFD (not connected to LinuxCNC yet) — this has a 1-10 scale, so when set to 1, the spindle is rotating at approximately 230 rpm. What signal do I need to monitor in Halscope to check this? If the gear ratio is right, the rotary table should rotate at (230/200) x 1 rpm = 1.15 rpm

The problem is the rotary table is turning way to slow at approximately 0.027 rpm (roughly 1/43 of the expected 1 rpm!)

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

Источник

Joint following error

I am using EMC2 with motenc motion control card. Sometimes machines run quite good, but sometimes iam facing two problems.

1. Axis stop but spindle still running during machining.
2. Secondly, when i manually jog machine or try to send machine on home position it gives «joint1 following error». Sometimes it gives «jointo following error».

Can anyone help me out on that issue. Please find the ini file in attachment

File Attachment:

Attachments:

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

  • cncbasher
  • Offline
  • Moderator
  • Posts: 1952
  • Thank you received: 306

at a guess , if the machine is running fine , and then it gives joint errors etc , you may have a number of points to look at

firstly this could be noting more than electrical noise entering the system through the limit switch wiring , or you are directly switching limits without any pullup resistors on the switches
so to cover the first problem Noise ! . do you have your limit switch cables screened and seperate from your motor drive cables , it is best to screen any input signal cables for this reason .

also is it always the same switch giving problems , this could point to nothing more than a faulty switch .

you say also the motor stays running , depending on how this is wired this could happen , do you have a spindle enable relay ? ,
or charge pump fitted .

also this type of problem can also be attributed to Bad Earth wiring or earth loops

if you can give us some more information on the setup and how it’s wired , we can try and narrow it down
in the meantime i’ll look at your configuration files , but i would say it does seem more electrical related

does the pc lock up at the same time ? by any chance

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

Источник

  • Назад
  • 1
  • 2
  • Далее
  • Страница 1 из 2  

Рекомендуемые сообщения

  •  #1

и FERROR=10 (миллиметров!), иначе на рапидах вылетает

А MIN_FERROR сколько?

5мм, не помню откуда оно взялось, с потолка, скорее всего.

но чем выше скорость, тем больше должно быть значение. даже если приводы едут точно по траектории.

гораздо ж интереснее, по-моему, следить за уходом с траектории? а так — пусть хоть на 5 см отстают…

Поделиться сообщением


Ссылка на сообщение

  •  #2

но чем выше скорость, тем больше должно быть значение. даже если приводы едут точно по траектории.

Так когда они точно по траектории идут, тогда и рассогласования нету.. Интересный фефект.

У меня на степдирном токарнике на малых скоростях ferror какие-то микроны, на быстрых в пределах пары десяток, дальше я плюнул биться с настройками.

А система вообще как устроена? Фидбек напрямую с энкодеров, а управление по SSCNET?

Поделиться сообщением


Ссылка на сообщение

  •  #3

фидбэк тоже с sscnet. может он отстает. и я вообще не заморачивался с тюнингом драйвов. задрал какой-то там «servo response» до начала возбуждения и успокоился. вообще, в фидбэке можно получать от драйва «droop pulses» — это самое достоверне значение ошибки рассогласования, насколько я понимаю.

но если отвлечься от конкретных систем. если, скажем, поток координат на выходе linuxcnc буферизируется, задерживается на секунду и только потом отдается драйвам? FERROR становятся бесполезными

Поделиться сообщением


Ссылка на сообщение

  •  #4

если, скажем, поток координат на выходе linuxcnc буферизируется, задерживается на секунду и только потом отдается драйвам? FERROR становятся бесполезными

В таком случае наверное да. Но тогда получается, что за траекторией никто и не следит, справились привода- хорошо, споткнулись где-то — никто и не узнает, пока на 10 мм в сторону не уедем. Т.е. система получается работает практически без ОС.

Поделиться сообщением


Ссылка на сообщение

  •  #5

почемуйто? фидбэк-то мы не задерживаем (в гипотетической системе с буфером)

в моем случае есть вопросы, да. я посмотрю сегодня повнимательнее где там у меня задержки и рассогласования. ведь при скорости 300мм/се

за сервоцикл 1мс проходим 0.3мм. 10мм — перебор с учетом всех возможных задержек. droop pulses там каки-то тысячи мпульсов, а не 2 оборота…

Поделиться сообщением


Ссылка на сообщение

  •  #6

почемуйто? фидбэк-то мы не задерживаем (в гипотетической системе с буфером)

Так в системе с буфером получается, что планировщик едет на секунду впереди железа. Ему приходит текущий фидбек, а он-то считает, что ось уже должна быть на полметра впереди, соответственно получаем ошибку рассогласования. Приходится допустимую ошибку увеличивать до неприличных размеров, что позволяет фрезе безнаказанно уехать в сторону. Понятно, что вряд ли оно куда уедет просто так, это не шаговики, но получается что за следование траектории отвечают только привода, а линуксцнц только передает им благие пожелания куда ехать, без особого контроля результата.

На 100% истину не претендую, я сварщик не настоящий, маску на стройке нашел :)

Поделиться сообщением


Ссылка на сообщение

  •  #7

именно так и получается! и мне не нравится это :)

Поделиться сообщением


Ссылка на сообщение

  •  #8

А откуда такой лаг берется? Частоты же у протокола и линуксцнц вроде похожие?

Поделиться сообщением


Ссылка на сообщение

  •  #9

частоты одинаковые: servo-thread с периодом 0.88ms и контроллер него подстраивается.

раньше, пока оно было на езернете, думал что из-за задержек передачи. сейчас склоняюсь что это приводы.

а вот как бы в axis рядом с бэкплотом нарисовать траекторию, которую планировщик выдает? он ведь тоже модифицирует как-то то, что в g-code написано чтобы в заданные ускорения вписаться? углы там скругляет…

Поделиться сообщением


Ссылка на сообщение

  •  #10

а вот как бы в axis рядом с бэкплотом нарисовать траекторию, которую планировщик выдает?

Это наверное только ковырять код гремлина, но код там тот еще. Программист я правда такой же ) .

он ведь тоже модифицирует как-то то, что в g-code написано чтобы в заданные ускорения вписаться? углы там скругляет…

А это определяется кодами G61 и G64, можно и не скруглять. Сейчас там вроде допилили наконец новый планировщик с предпросмотром и блендингом, но я его еще не щупал.

Поделиться сообщением


Ссылка на сообщение

  •  #11

Как-то тема вынырнула, хоть расскажите где начало и кто от чего отстает.

FERROR нужен для остановки станка в случае столкновения с препятствием или отказа одного из приводов. Поэтому 5мм ставить бы не стал.

А в шаговой системе following error вроде как не имеет большого отношения к реальности.

а вот как бы в axis рядом с бэкплотом нарисовать траекторию, которую планировщик выдает?

Она и рисуется. Показания энкодеров для отрисовки на экране не используются, насколько я знаю.

Поделиться сообщением


Ссылка на сообщение

  •  #12

Она и рисуется. Показания энкодеров для отрисовки на экране не используются, насколько я знаю.

А вот фиг его знает, что именно он там рисует. Это надо с выключенными приводами ось какую-нибудь пошевелить попробовать.

Поделиться сообщением


Ссылка на сообщение

  •  #13

Вот что нашел, но старое от 2006 года:

We chose to use commanded position for the backplot because using actual position would lead to a large growth in the memory used for the backplot, as well as increase the amount of time taken to redraw the plot window, whenever emc displayed «hunting» behavior

Поделиться сообщением


Ссылка на сообщение

  •  #14

Это наверное только ковырять код гремлина

о, ага, гремлин. погляжу, сэнькс. хочу гарантировано видеть куда моторы посылают.

Это надо с выключенными приводами ось какую-нибудь пошевелить попробовать.

пробовал — рисует

Поделиться сообщением


Ссылка на сообщение

  •  #15

Как-то тема вынырнула, хоть расскажите где начало и кто от чего отстает.

в linuxcnc устанавливается лимит following error. это расстояние от заданной до фактической позиции, насколько я понимаю. если приводы управляются по позиции и отрабатывают задание с временной задержкой, то это расстояние становится весьма большим. хотя отклонение от траектории на самом деле может быть невелико. при большой временной задержке контроль превышения FERROR вообще теряет смысл, имхо. почему вместо этого не смотреть на отклонение от траектории?

я меня в конфиге FERROR стоит 10мм. иначе при быстрых перемещениях ошибка вылетает. при этом детальки, вроде, не совсем кривые. вот я и подумал, что, может, едут они по траектории, но с задержкой по времени…

но сейчас уже и в этом сомневаюсь :)

Поделиться сообщением


Ссылка на сообщение

  •  #16

Это рассчитано на управление по скорости, когда ПИД минимизирует following error

Если управлять по положению, ПИД вообще не особо нужен, хотя новые степ конфиги вроде делают через ПИД, в чем смысл — не задумывался.

смотреть на отклонение от траектории

Сие невозможно, имхо.

если приводы управляются по позиции и отрабатывают задание с временной задержкой

То есть временная задержка, вот она и дает отставание по траектории.

Неужели такие большие отставания получаются? К примеру, скорость 100мм/с, задержка 10мс, отставание 1мм… или там по полсекунды задержки?

Поделиться сообщением


Ссылка на сообщение

  •  #17

хотя новые степ конфиги вроде делают через ПИД, в чем смысл — не задумывался.

Смысл в том, чтобы было кому реагировать на потерю шагов, если в цепочке нет регулятора, то возникшая ошибка так и будет болтаться.

Работает оно довольно своеобразно, но — работает.

Поделиться сообщением


Ссылка на сообщение

  •  #18

у меня по положению, но напрямую, без пидов, степгенов и т.д. вот так:

net x-cmd axis.0.motor-pos-cmd => sscii.0.servo.0.cmd

net x-pos-fb axis.0.motor-pos-fb <= sscii.0.servo.0.cmd-fb

драйвам скомандовали куда ехать, дальше они только отчитываются как у них это получается. и если не получилось удержаться на траектории, хочется об это узанть…

Неужели такие большие отставания получаются? К примеру, скорость 100мм/с, задержка 10мс, отставание 1мм… или там по полсекунды задержки?

посмотрел. 100мм/с — 0.8мм, 250мм/с — 1.7мм. чет я напел про 10мм, похоже :-/

вот еще поездил по квадрату 5х5мм. который поквадратней — 2м/мин, круглый — 4м/мин. MAX_ACCELERATION=9800

post-41-049335300_1452799750_thumb.gif

Поделиться сообщением


Ссылка на сообщение

  •  #19

Смысл в том, чтобы было кому реагировать на потерю шагов, если в цепочке нет регулятора, то возникшая ошибка так и будет болтаться.

Если на моторе есть энкодер — понятно. Но обычные шаговые конфиги-то зачем? Откуда там потеря шагов?


Изменено 14.01.2016 19:45 пользователем PKM

Поделиться сообщением


Ссылка на сообщение

  •  #20

Если на моторе есть энкодер — понятно. Но обычные шаговые конфиги-то зачем? Откуда там потеря шагов?

Так ПИД вроде только под энкодерные конфиги и используется, так-то конечно никакого смысла нет.

Поделиться сообщением


Ссылка на сообщение

  •  #21

вот еще поездил по квадрату 5х5мм. который поквадратней — 2м/мин, круглый — 4м/мин. MAX_ACCELERATION=9800

Кругловато как-то на глаз, у приводов видимо ускорения маловато. У меня 4 метра в принципе на лесопилке рабочая подача, но насколько он скругляет сейчас не скажу.

Поделиться сообщением


Ссылка на сообщение

  •  #22

драйвам скомандовали куда ехать, дальше они только отчитываются как у них это получается. и если не получилось удержаться на траектории, хочется об это узанть…

Тогда лучше задать макс. рассогласование в приводах, при превышении будут выдавать ошибку, которую завести на естоп.

А на отставание в линуксе смотреть смысла нет. Главное, что приводы отрабатывают с одинаковой задержкой, значит траектория будет (примерно) заданной.

Хотя… при управлении по скорости отставание скорее всего будет примерно таким же на подобных скоростях. Я как раз на днях собрался подключать 16К20 по аналогу, думаю что и больше окажется…

Так ПИД вроде только под энкодерные конфиги и используется, так-то конечно никакого смысла нет.

Ладно, я не уверен, поэтому не настаиваю :)

Поделиться сообщением


Ссылка на сообщение

  •  #23

Планировщик кстати какой включен? Старый или новый? Параметр ARC_BLEND_ENABLE .

Поделиться сообщением


Ссылка на сообщение

  •  #24

Я как раз на днях собрался подключать 16К20 по аналогу, думаю что и больше окажется…

Не должно, в пределах первых десяток вполне можно настроить. Но на степдире у меня вышло постабильней и поточней, так на нем и работаю. Хотя сейчас возможно получше бы настроил.

Поделиться сообщением


Ссылка на сообщение

  •  #25

на степдире у меня вышло постабильней и поточней

Как определялось? Подключен энкодер?

Насчет моего токарника — сомневаюсь, что китайский привод можно хорошо настроить по степ-дир, поэтому перехожу на аналог… заодно и индекс-метки тспользую для хоуминга.

Поделиться сообщением


Ссылка на сообщение

  • Назад
  • 1
  • 2
  • Далее
  • Страница 1 из 2  

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Войти

Уже есть аккаунт? Войти в систему.

Войти

  1. 05-10-2021, 10:15 PM


    #1

    azant is offline


    Hi All

    I have a problem getting my machine to work with MESA 7i96 and Stepper driver TB6600.i tried changing the step/dir timing with no success. i lowered the velocity and acceleration to 400mm/min, Ii still get the following error with joint xx[/u].

    Hardware:
    — MESA 7i96
    -TB6600 + NEMA23

    Software:
    -LinuxCNC version 2.8.1
    -4.9.0-8-rt-686-pae

    LinuxCNC output

    Code:

    LINUXCNC - 2.8.1
    Machine configuration directory is '/home/taz/linuxcnc/configs/workBee_Base'
    Machine configuration file is 'workBee_Base.ini'
    INIFILE=/home/taz/linuxcnc/configs/workBee_Base/workBee_Base.ini
    VERSION=1.1
    PARAMETER_FILE=linuxcnc.var
    TASK=milltask
    HALUI=halui
    DISPLAY=axis
    COORDINATES=XYYZ
    KINEMATICS=trivkins coordinates=XYYZ kinstype=BOTH
    Starting LinuxCNC...
    Starting LinuxCNC server program: linuxcncsvr
    Loading Real Time OS, RTAPI, and HAL_LIB modules
    Starting LinuxCNC IO program: io
    Starting HAL User Interface program: halui
    Found file(REL): ./workBee_Base.hal
    Found file(REL): ./custom.hal
    Starting TASK program: milltask
    Starting DISPLAY program: axis
    62914563
    joint 0 following error
    emc/task/taskintf.cc 942: Error on joint 0, command number 5063

    here are my config files:

    Code:

    # Generated by PNCconf at Sun May  9 17:06:17 2021
    # Using LinuxCNC version:  2.8
    # If you make changes to this file, they will be
    # overwritten when you run PNCconf again
    
    [EMC]
    MACHINE = workBee_Base
    DEBUG = 0
    VERSION = 1.1
    
    [DISPLAY]
    DISPLAY = axis
    EMBED_TAB_NAME = GladeVCP
    EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -H gvcp_call_list.hal -x {XID} gvcp-panel.ui
    POSITION_OFFSET = RELATIVE
    POSITION_FEEDBACK = ACTUAL
    MAX_FEED_OVERRIDE = 2.000000
    MAX_SPINDLE_OVERRIDE = 1.000000
    MIN_SPINDLE_OVERRIDE = 0.500000
    INTRO_GRAPHIC = linuxcnc.gif
    INTRO_TIME = 5
    PROGRAM_PREFIX = /home/taz/linuxcnc/nc_files
    INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
    POSITION_FEEDBACK = ACTUAL
    DEFAULT_LINEAR_VELOCITY = 8.333333
    MAX_LINEAR_VELOCITY = 25.000000
    MIN_LINEAR_VELOCITY = 0.500000
    DEFAULT_ANGULAR_VELOCITY = 12.000000
    MAX_ANGULAR_VELOCITY = 180.000000
    MIN_ANGULAR_VELOCITY = 1.666667
    EDITOR = gedit
    GEOMETRY = xyz
    
    [FILTER]
    PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
    PROGRAM_EXTENSION = .py Python Script
    png = image-to-gcode
    gif = image-to-gcode
    jpg = image-to-gcode
    py = python
    
    [TASK]
    TASK = milltask
    CYCLE_TIME = 0.010
    
    [RS274NGC]
    PARAMETER_FILE = linuxcnc.var
    
    [EMCMOT]
    EMCMOT = motmod
    COMM_TIMEOUT = 1.0
    SERVO_PERIOD = 1000000
    
    [HMOT]
    # **** This is for info only ****
    CARD0=hm2_7i96.0
    
    [HAL]
    HALUI = halui
    HALFILE = workBee_Base.hal
    HALFILE = custom.hal
    POSTGUI_HALFILE = postgui_call_list.hal
    SHUTDOWN = shutdown.hal
    
    [HALUI]
    MDI_COMMAND = G10 L20 P0 X0 ( Set X to zero )
    MDI_COMMAND = G10 L20 P0 Y0 ( Set Y to zero )
    MDI_COMMAND = G10 L20 P0 Z0 ( Set Z to zero )
    
    [KINS]
    JOINTS = 4
    KINEMATICS = trivkins coordinates=XYYZ kinstype=BOTH
    
    [TRAJ]
    COORDINATES =  XYYZ
    LINEAR_UNITS = mm
    ANGULAR_UNITS = degree
    DEFAULT_LINEAR_VELOCITY = 2.00
    MAX_LINEAR_VELOCITY = 20.00
    
    [EMCIO]
    EMCIO = io
    CYCLE_TIME = 0.100
    TOOL_TABLE = tool.tbl
    TOOL_CHANGE_QUILL_UP = 1
    
    #******************************************
    [AXIS_X]
    MAX_VELOCITY = 16.6666666667
    MAX_ACCELERATION = 10.0
    MIN_LIMIT = -200.0
    MAX_LIMIT = 300.0
    
    [JOINT_0]
    TYPE = LINEAR
    HOME = 0.0
    FERROR = 10.0
    MIN_FERROR = 2.0
    MAX_VELOCITY = 16.6666666667
    MAX_ACCELERATION = 10.0
    # 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 = 20.83
    STEPGEN_MAXACCEL = 12.50
    P = 1000.0
    I = 0.0
    D = 0.0
    FF0 = 0.0
    FF1 = 1.0
    FF2 = 0.0
    BIAS = 0.0
    DEADBAND = 0.0
    MAX_OUTPUT = 0.0
    # these are in nanoseconds
    DIRSETUP   = 10000
    DIRHOLD    = 1500
    STEPLEN    = 7000
    STEPSPACE  = 500
    STEP_SCALE = 200.0
    MIN_LIMIT = -200.0
    MAX_LIMIT = 300.0
    HOME_OFFSET = 0.0
    #******************************************
    
    #******************************************
    [AXIS_Y]
    MAX_VELOCITY = 20.0
    MAX_ACCELERATION = 12.0
    MIN_LIMIT = -400.0
    MAX_LIMIT = 500.0
    
    [JOINT_1]
    TYPE = LINEAR
    HOME = 0.0
    FERROR = 10.0
    MIN_FERROR = 2.0
    MAX_VELOCITY = 20.0
    MAX_ACCELERATION = 12.0
    # 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 = 25.00
    STEPGEN_MAXACCEL = 15.00
    P = 1000.0
    I = 0.0
    D = 0.0
    FF0 = 0.0
    FF1 = 1.0
    FF2 = 0.0
    BIAS = 0.0
    DEADBAND = 0.0
    MAX_OUTPUT = 0.0
    # these are in nanoseconds
    DIRSETUP   = 10000
    DIRHOLD    = 1000
    STEPLEN    = 5000
    STEPSPACE  = 500
    STEP_SCALE = 200.0
    MIN_LIMIT = -400.0
    MAX_LIMIT = 500.0
    HOME_OFFSET = 0.0
    
    [JOINT_2]
    TYPE = LINEAR
    HOME = 0.0
    FERROR = 10.0
    MIN_FERROR = 2.0
    MAX_VELOCITY = 20.0
    MAX_ACCELERATION = 12.0
    # 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 = 25.00
    STEPGEN_MAXACCEL = 15.00
    P = 1000.0
    I = 0.0
    D = 0.0
    FF0 = 0.0
    FF1 = 1.0
    FF2 = 0.0
    BIAS = 0.0
    DEADBAND = 0.0
    MAX_OUTPUT = 0.0
    # these are in nanoseconds
    DIRSETUP   = 10000
    DIRHOLD    = 1000
    STEPLEN    = 5000
    STEPSPACE  = 500
    STEP_SCALE = 200.0
    MIN_LIMIT = -400.0
    MAX_LIMIT = 500.0
    HOME_OFFSET = 0.0
    #******************************************
    
    #******************************************
    [AXIS_Z]
    MAX_VELOCITY = 13.3333333333
    MAX_ACCELERATION = 10.0
    MIN_LIMIT = -30.0
    MAX_LIMIT = 30.0
    
    [JOINT_3]
    TYPE = LINEAR
    HOME = 0.0
    FERROR = 10.0
    MIN_FERROR = 2.0
    MAX_VELOCITY = 13.3333333333
    MAX_ACCELERATION = 10.0
    # 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 = 16.67
    STEPGEN_MAXACCEL = 12.50
    P = 1000.0
    I = 0.0
    D = 0.0
    FF0 = 0.0
    FF1 = 1.0
    FF2 = 0.0
    BIAS = 0.0
    DEADBAND = 0.0
    MAX_OUTPUT = 0.0
    # these are in nanoseconds
    DIRSETUP   = 10000
    DIRHOLD    = 1500
    STEPLEN    = 7000
    STEPSPACE  = 500
    STEP_SCALE = 200.0
    MIN_LIMIT = -30.0
    MAX_LIMIT = 30.0
    HOME_OFFSET = 0.0
    #******************************************
    
    [SPINDLE_0]
    P = 0.0
    I = 0.0
    D = 0.0
    FF0 = 1.0
    FF1 = 0.0
    FF2 = 0.0
    BIAS = 0.0
    DEADBAND = 0.0
    MAX_OUTPUT = 2000.0

    Code:

    # Generated by PNCconf at Sun May  9 17:06:17 2021
    # Using LinuxCNC version:  2.8
    # If you make changes to this file, they will be
    # overwritten when you run PNCconf again
    
    loadrt [KINS]KINEMATICS
    loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
    loadrt hostmot2
    loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=1 num_pwmgens=0 num_stepgens=5 sserial_port_0=00xxxx" 
    setp    hm2_7i96.0.watchdog.timeout_ns 5000000
    loadrt pid names=pid.x,pid.y,pid.y2,pid.z,pid.s
    
    addf hm2_7i96.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.y.do-pid-calcs       servo-thread
    addf pid.y2.do-pid-calcs       servo-thread
    addf pid.z.do-pid-calcs       servo-thread
    addf pid.s.do-pid-calcs       servo-thread
    addf hm2_7i96.0.write         servo-thread
    
    # external output signals
    
    # --- MACHINE-IS-ENABLED ---
    net machine-is-enabled  =>     hm2_7i96.0.ssr.00.out-02
    
    # --- DOUT-00 ---
    net dout-00  =>     hm2_7i96.0.ssr.00.out-03
    
    # --- SPINDLE-ENABLE ---
    net spindle-enable  =>     hm2_7i96.0.ssr.00.out-04
    
    
    # external input signals
    
    # --- PROBE-IN ---
    net probe-in     <=  hm2_7i96.0.gpio.010.in
    
    
    #*******************
    #  AXIS X JOINT 0
    #*******************
    
    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
    # This setting is to limit bogus stepgen
    # velocity corrections caused by position
    # feedback sample time jitter.
    setp   pid.x.maxerror 0.012700
    
    net x-index-enable  <=> pid.x.index-enable
    net x-enable        =>  pid.x.enable
    net x-pos-cmd       =>  pid.x.command
    net x-pos-fb        =>  pid.x.feedback
    net x-output        <=  pid.x.output
    
    # Step Gen signals/setup
    
    setp   hm2_7i96.0.stepgen.00.dirsetup        [JOINT_0]DIRSETUP
    setp   hm2_7i96.0.stepgen.00.dirhold         [JOINT_0]DIRHOLD
    setp   hm2_7i96.0.stepgen.00.steplen         [JOINT_0]STEPLEN
    setp   hm2_7i96.0.stepgen.00.stepspace       [JOINT_0]STEPSPACE
    setp   hm2_7i96.0.stepgen.00.position-scale  [JOINT_0]STEP_SCALE
    setp   hm2_7i96.0.stepgen.00.step_type        0
    setp   hm2_7i96.0.stepgen.00.control-type     1
    setp   hm2_7i96.0.stepgen.00.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
    setp   hm2_7i96.0.stepgen.00.maxvel           [JOINT_0]STEPGEN_MAXVEL
    
    # ---closedloop stepper signals---
    
    net x-pos-cmd    <= joint.0.motor-pos-cmd
    net x-vel-cmd    <= joint.0.vel-cmd
    net x-output     <= hm2_7i96.0.stepgen.00.velocity-cmd
    net x-pos-fb     <= hm2_7i96.0.stepgen.00.position-fb
    net x-pos-fb     => joint.0.motor-pos-fb
    net x-enable     <= joint.0.amp-enable-out
    net x-enable     => hm2_7i96.0.stepgen.00.enable
    
    # ---setup home / limit switch signals---
    
    net x-home-sw     =>  joint.0.home-sw-in
    net x-neg-limit     =>  joint.0.neg-lim-sw-in
    net x-pos-limit     =>  joint.0.pos-lim-sw-in
    
    #*******************
    #  AXIS Y JOINT 1
    #*******************
    
    setp   pid.y.Pgain     [JOINT_1]P
    setp   pid.y.Igain     [JOINT_1]I
    setp   pid.y.Dgain     [JOINT_1]D
    setp   pid.y.bias      [JOINT_1]BIAS
    setp   pid.y.FF0       [JOINT_1]FF0
    setp   pid.y.FF1       [JOINT_1]FF1
    setp   pid.y.FF2       [JOINT_1]FF2
    setp   pid.y.deadband  [JOINT_1]DEADBAND
    setp   pid.y.maxoutput [JOINT_1]MAX_OUTPUT
    setp   pid.y.error-previous-target true
    # This setting is to limit bogus stepgen
    # velocity corrections caused by position
    # feedback sample time jitter.
    setp   pid.y.maxerror 0.012700
    
    net y-index-enable  <=> pid.y.index-enable
    net y-enable        =>  pid.y.enable
    net y-pos-cmd       =>  pid.y.command
    net y-pos-fb        =>  pid.y.feedback
    net y-output        <=  pid.y.output
    
    # Step Gen signals/setup
    
    setp   hm2_7i96.0.stepgen.03.dirsetup        [JOINT_1]DIRSETUP
    setp   hm2_7i96.0.stepgen.03.dirhold         [JOINT_1]DIRHOLD
    setp   hm2_7i96.0.stepgen.03.steplen         [JOINT_1]STEPLEN
    setp   hm2_7i96.0.stepgen.03.stepspace       [JOINT_1]STEPSPACE
    setp   hm2_7i96.0.stepgen.03.position-scale  [JOINT_1]STEP_SCALE
    setp   hm2_7i96.0.stepgen.03.step_type        0
    setp   hm2_7i96.0.stepgen.03.control-type     1
    setp   hm2_7i96.0.stepgen.03.maxaccel         [JOINT_1]STEPGEN_MAXACCEL
    setp   hm2_7i96.0.stepgen.03.maxvel           [JOINT_1]STEPGEN_MAXVEL
    
    # ---closedloop stepper signals---
    
    net y-pos-cmd    <= joint.1.motor-pos-cmd
    net y-vel-cmd    <= joint.1.vel-cmd
    net y-output     <= hm2_7i96.0.stepgen.03.velocity-cmd
    net y-pos-fb     <= hm2_7i96.0.stepgen.03.position-fb
    net y-pos-fb     => joint.1.motor-pos-fb
    net y-enable     <= joint.1.amp-enable-out
    net y-enable     => hm2_7i96.0.stepgen.03.enable
    
    # ---setup home / limit switch signals---
    
    net y-home-sw     =>  joint.1.home-sw-in
    net y-neg-limit     =>  joint.1.neg-lim-sw-in
    net y-pos-limit     =>  joint.1.pos-lim-sw-in
    
    #*******************
    #  Tandem AXIS Y2 JOINT 2
    #*******************
    
    setp   pid.y2.Pgain     [JOINT_2]P
    setp   pid.y2.Igain     [JOINT_2]I
    setp   pid.y2.Dgain     [JOINT_2]D
    setp   pid.y2.bias      [JOINT_2]BIAS
    setp   pid.y2.FF0       [JOINT_2]FF0
    setp   pid.y2.FF1       [JOINT_2]FF1
    setp   pid.y2.FF2       [JOINT_2]FF2
    setp   pid.y2.deadband  [JOINT_2]DEADBAND
    setp   pid.y2.maxoutput [JOINT_2]MAX_OUTPUT
    setp   pid.y2.error-previous-target true
    # This setting is to limit bogus stepgen
    # velocity corrections caused by position
    # feedback sample time jitter.
    setp   pid.y2.maxerror 0.012700
    
    net y2-index-enable  <=> pid.y2.index-enable
    net y2-enable        =>  pid.y2.enable
    net y2-pos-cmd       =>  pid.y2.command
    net y2-pos-fb        =>  pid.y2.feedback
    net y2-output        <=  pid.y2.output
    
    # Step Gen signals/setup for tandem axis
    
    setp   hm2_7i96.0.stepgen.02.dirsetup        [JOINT_2]DIRSETUP
    setp   hm2_7i96.0.stepgen.02.dirhold         [JOINT_2]DIRHOLD
    setp   hm2_7i96.0.stepgen.02.steplen         [JOINT_2]STEPLEN
    setp   hm2_7i96.0.stepgen.02.stepspace       [JOINT_2]STEPSPACE
    setp   hm2_7i96.0.stepgen.02.position-scale  [JOINT_2]STEP_SCALE
    setp   hm2_7i96.0.stepgen.02.step_type        0
    setp   hm2_7i96.0.stepgen.02.control-type     1
    setp   hm2_7i96.0.stepgen.02.maxaccel         [JOINT_2]STEPGEN_MAXACCEL
    setp   hm2_7i96.0.stepgen.02.maxvel           [JOINT_2]STEPGEN_MAXVEL
    
    # ---closedloop stepper signals---
    
    net y2-pos-cmd    <= joint.2.motor-pos-cmd
    net y2-vel-cmd    <= joint.2.vel-cmd
    net y2-output     <= hm2_7i96.0.stepgen.02.velocity-cmd
    net y2-pos-fb     <= hm2_7i96.0.stepgen.02.position-fb
    net y2-pos-fb     => joint.2.motor-pos-fb
    net y2-enable     <= joint.2.amp-enable-out
    net y2-enable     => hm2_7i96.0.stepgen.02.enable
    
    # ---setup home / limit switch signals---
    
    net y2-home-sw     =>  joint.2.home-sw-in
    net y2-neg-limit     =>  joint.2.neg-lim-sw-in
    net y2-pos-limit     =>  joint.2.pos-lim-sw-in
    
    #*******************
    #  AXIS Z JOINT 3
    #*******************
    
    setp   pid.z.Pgain     [JOINT_3]P
    setp   pid.z.Igain     [JOINT_3]I
    setp   pid.z.Dgain     [JOINT_3]D
    setp   pid.z.bias      [JOINT_3]BIAS
    setp   pid.z.FF0       [JOINT_3]FF0
    setp   pid.z.FF1       [JOINT_3]FF1
    setp   pid.z.FF2       [JOINT_3]FF2
    setp   pid.z.deadband  [JOINT_3]DEADBAND
    setp   pid.z.maxoutput [JOINT_3]MAX_OUTPUT
    setp   pid.z.error-previous-target true
    # This setting is to limit bogus stepgen
    # velocity corrections caused by position
    # feedback sample time jitter.
    setp   pid.z.maxerror 0.012700
    
    net z-index-enable  <=> pid.z.index-enable
    net z-enable        =>  pid.z.enable
    net z-pos-cmd       =>  pid.z.command
    net z-pos-fb        =>  pid.z.feedback
    net z-output        <=  pid.z.output
    
    # Step Gen signals/setup
    
    setp   hm2_7i96.0.stepgen.01.dirsetup        [JOINT_3]DIRSETUP
    setp   hm2_7i96.0.stepgen.01.dirhold         [JOINT_3]DIRHOLD
    setp   hm2_7i96.0.stepgen.01.steplen         [JOINT_3]STEPLEN
    setp   hm2_7i96.0.stepgen.01.stepspace       [JOINT_3]STEPSPACE
    setp   hm2_7i96.0.stepgen.01.position-scale  [JOINT_3]STEP_SCALE
    setp   hm2_7i96.0.stepgen.01.step_type        0
    setp   hm2_7i96.0.stepgen.01.control-type     1
    setp   hm2_7i96.0.stepgen.01.maxaccel         [JOINT_3]STEPGEN_MAXACCEL
    setp   hm2_7i96.0.stepgen.01.maxvel           [JOINT_3]STEPGEN_MAXVEL
    setp   hm2_7i96.0.stepgen.01.direction.invert_output   true
    
    # ---closedloop stepper signals---
    
    net z-pos-cmd    <= joint.3.motor-pos-cmd
    net z-vel-cmd    <= joint.3.vel-cmd
    net z-output     <= hm2_7i96.0.stepgen.01.velocity-cmd
    net z-pos-fb     <= hm2_7i96.0.stepgen.01.position-fb
    net z-pos-fb     => joint.3.motor-pos-fb
    net z-enable     <= joint.3.amp-enable-out
    net z-enable     => hm2_7i96.0.stepgen.01.enable
    
    # ---setup home / limit switch signals---
    
    net z-home-sw     =>  joint.3.home-sw-in
    net z-neg-limit     =>  joint.3.neg-lim-sw-in
    net z-pos-limit     =>  joint.3.pos-lim-sw-in
    
    #*******************
    #  SPINDLE
    #*******************
    
    setp   pid.s.Pgain     [SPINDLE_0]P
    setp   pid.s.Igain     [SPINDLE_0]I
    setp   pid.s.Dgain     [SPINDLE_0]D
    setp   pid.s.bias      [SPINDLE_0]BIAS
    setp   pid.s.FF0       [SPINDLE_0]FF0
    setp   pid.s.FF1       [SPINDLE_0]FF1
    setp   pid.s.FF2       [SPINDLE_0]FF2
    setp   pid.s.deadband  [SPINDLE_0]DEADBAND
    setp   pid.s.maxoutput [SPINDLE_0]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
    
    # ---setup spindle control signals---
    
    net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
    net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
    net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
    net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
    net spindle-enable             <=  spindle.0.on
    net spindle-cw                 <=  spindle.0.forward
    net spindle-ccw                <=  spindle.0.reverse
    net spindle-brake              <=  spindle.0.brake
    net spindle-revs               =>  spindle.0.revs
    net spindle-at-speed           =>  spindle.0.at-speed
    net spindle-vel-fb-rps         =>  spindle.0.speed-in
    net spindle-index-enable      <=>  spindle.0.index-enable
    
    # ---Setup spindle at speed signals---
    
    sets spindle-at-speed true
    
    
    #******************************
    # connect miscellaneous signals
    #******************************
    
    #  ---HALUI signals---
    
    net axis-select-x  halui.axis.x.select
    net jog-x-pos      halui.axis.x.plus
    net jog-x-neg      halui.axis.x.minus
    net jog-x-analog   halui.axis.x.analog
    net x-is-homed     halui.joint.0.is-homed
    net axis-select-y  halui.axis.y.select
    net jog-y-pos      halui.axis.y.plus
    net jog-y-neg      halui.axis.y.minus
    net jog-y-analog   halui.axis.y.analog
    net y-is-homed     halui.joint.1.is-homed
    net axis-select-z  halui.axis.z.select
    net jog-z-pos      halui.axis.z.plus
    net jog-z-neg      halui.axis.z.minus
    net jog-z-analog   halui.axis.z.analog
    net z-is-homed     halui.joint.2.is-homed
    net jog-selected-pos      halui.axis.selected.plus
    net jog-selected-neg      halui.axis.selected.minus
    net spindle-manual-cw     halui.spindle.0.forward
    net spindle-manual-ccw    halui.spindle.0.reverse
    net spindle-manual-stop   halui.spindle.0.stop
    net machine-is-on         halui.machine.is-on
    net jog-speed             halui.axis.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---
    
    net dout-00     <=  motion.digital-out-00
    #  ---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

    Thanks
    T


  2. 05-14-2021, 06:21 PM


    #2

    jschmitt is offline


    Registered


    Red face Re: Joint xx following error!

    [QUOTE=azant;2450884]Hi All

    I have a problem getting my machine to work with MESA 7i96 and Stepper driver TB6600.i tried changing the step/dir timing with no success. i lowered the velocity and acceleration to 400mm/min, Ii still get the following error with joint xx[/u].

    this explains better than I can.
    http://www.vdwalle.com/Norte/LinuxCNC%20Following%20Error.htm[/URL]


  3. 05-14-2021, 10:18 PM


    #3

    PCW_MESA is offline


    Registered


    Re: Joint xx following error!

    [QUOTE=jschmitt;2451730]

    Quote Originally Posted by azant
    View Post

    Hi All

    I have a problem getting my machine to work with MESA 7i96 and Stepper driver TB6600.i tried changing the step/dir timing with no success. i lowered the velocity and acceleration to 400mm/min, Ii still get the following error with joint xx[/u].

    this explains better than I can.
    http://www.vdwalle.com/Norte/LinuxCNC%20Following%20Error.htm[/URL]

    That’s a very strange error especially since the following error limits are so wide
    I recall this from the LinuxCNC forum. I could not duplicate your issue on my test
    machine using your hal/ini files. What computer is LinuxCNC running on?
    What kind of Ethernet interface is it using (motherboard, addon, etc)

    It may require plotting the following error with halscope to determine what is happening.
    The only thing I can think of off hand that would cause large following errors would be some large issue
    with the host PCs timebase or corrupted data (but corrupted in the 7I96 or PC, since Ethernet data is all checked)


  • Summary

  • Files

  • Reviews

  • Support

  • Mailing Lists

  • Tickets ▾

    • Archived Feature Requests
    • Archived Bugs
  • News

  • CVS

Menu

From: Andy Pugh <an…@an…> — 2010-06-23 23:23:24

I finally have my kinematics module running as expected. The solution
(at least initially) seems to be to run it in SIM, where everything
works as it should.
Running it on my "real" build I get all sorts of wierd stuff, such as
numeric values coming out just plain wrong:

double fKcount = 0;
*(haldata->rKcount) = rKcount +1;
returning 0.70710678 on the HAL pin (yes, exactly sin(45).).
atan2(0,1) = 0.7586 and, most troublesomely, perfectly normal zeros
being passed to the motion controller (control.c) and becoming NaN
somewhere in one of the called functions.

My kernel is an RTAI SMP kernel I built myself. Visteurs has been
having similar trouble with his SMP Lucid EMC2. I have spent weeks
looking for problems in the kinematics code (and there are some) but
it really looks like the problem might be elsewhere.

The current code is here:
http://pastebin.com/SQJSy0f9
It works OK (ish) in SIM but not at all in my live system. Especially
the pin addressed in line 102 takes on the value 0.7071 (and counts up
in 0.7971s if changed to a ++ assignment or = (rKcount = rKcount + 1)

Stumped, I am.

-- 
atp


From: Kenneth Lerman <Kenne…@se…> — 2010-06-24 12:37:54

On 06/23/2010 07:23 PM, Andy Pugh wrote:
> I finally have my kinematics module running as expected. The solution
> (at least initially) seems to be to run it in SIM, where everything
> works as it should.
> Running it on my "real" build I get all sorts of wierd stuff, such as
> numeric values coming out just plain wrong:
>
> double fKcount = 0;
> *(haldata->rKcount) = rKcount +1;
> returning 0.70710678 on the HAL pin (yes, exactly sin(45).).
> atan2(0,1) = 0.7586 and, most troublesomely, perfectly normal zeros
> being passed to the motion controller (control.c) and becoming NaN
> somewhere in one of the called functions.
>
> My kernel is an RTAI SMP kernel I built myself. Visteurs has been
> having similar trouble with his SMP Lucid EMC2. I have spent weeks
> looking for problems in the kinematics code (and there are some) but
> it really looks like the problem might be elsewhere.
>
> The current code is here:
> http://pastebin.com/SQJSy0f9
> It works OK (ish) in SIM but not at all in my live system. Especially
> the pin addressed in line 102 takes on the value 0.7071 (and counts up
> in 0.7971s if changed to a ++ assignment or = (rKcount = rKcount + 1)
>
> Stumped, I am.
>
>    
Andy,

I see:
==========
static PmCartesian old;
double dx = 0, dy = 0, C = 0;
double fKcount = 0, rKcount = 0;
==========
"static" means that this variable will be visible only from this file.
The lack of the static keyword means that dx, dy, C, fKcount, and 
rKcount will be visible from other files.

That probably isn't what you want since it means that some other 
function might be changing those variables.

In general, you really don't want to pass variables among functions 
other than explicitly in a function call.

Ken

From: Andy Pugh <an…@an…> — 2010-06-24 13:05:00

On 24 June 2010 13:39, Kenneth Lerman <Kenne...@se...> wrote:

> ==========
> static PmCartesian old;
> double dx = 0, dy = 0, C = 0;
> double fKcount = 0, rKcount = 0;
> ==========
> "static" means that this variable will be visible only from this file.
> The lack of the static keyword means that dx, dy, C, fKcount, and rKcount
> will be visible from other files.

Isn't that only the case if the other files "Extern" it? I can
definitely see the scop for that being a problem with dx and dy, but
the timing would have to be very accurate for it to explain the
rKcount behaviour, which increases by exactly 0.7101..... every time
the function is called.

> That probably isn't what you want since it means that some other function
> might be changing those variables.

I think perhaps I should print the values of both and see if the
problem is in the actual value of tKcount, or somewhere in the
transfer of that value to the HAL pin.

(I don't actually need or use rKcount, but it seems to be indicative
of a wider problem, ie variables not taking on anything like the
expected values. I am still baffled that removing a line that had no
link at all to the (unrelated) stepgen function stopped the bizarre
drift in the -fb value. )

-- 
atp


From: Kenneth Lerman <Kenne…@se…> — 2010-06-24 13:24:22

Andy Pugh wrote:
> On 24 June 2010 13:39, Kenneth Lerman <Kenne...@se...> wrote:
>
>   
>> ==========
>> static PmCartesian old;
>> double dx = 0, dy = 0, C = 0;
>> double fKcount = 0, rKcount = 0;
>> ==========
>> "static" means that this variable will be visible only from this file.
>> The lack of the static keyword means that dx, dy, C, fKcount, and rKcount
>> will be visible from other files.
>>     
>
> Isn't that only the case if the other files "Extern" it? I can
> definitely see the scop for that being a problem with dx and dy, but
> the timing would have to be very accurate for it to explain the
> rKcount behaviour, which increases by exactly 0.7101..... every time
> the function is called.
>
>   
No. The modern ANSI C  lets you:

f1.c:
---
int a = 1;
---

f2.c
--
int a;
--

This is sometimes referred to the "COMMON" model of storage by analogy 
with the FORTRAN usage. In the above example, the variable 'a' may only 
be initialized in one of the locations.
>> That probably isn't what you want since it means that some other function
>> might be changing those variables.
>>     
>
> I think perhaps I should print the values of both and see if the
> problem is in the actual value of tKcount, or somewhere in the
> transfer of that value to the HAL pin.
>
> (I don't actually need or use rKcount, but it seems to be indicative
> of a wider problem, ie variables not taking on anything like the
> expected values. I am still baffled that removing a line that had no
> link at all to the (unrelated) stepgen function stopped the bizarre
> drift in the -fb value. )
>
>   
Even if that isn't the problem, you should probably declare those 
variables static so that future readers of the code don't have to go 
looking to find out where else the variables might be used or changed.

Ken

From: Stephen Wille Padnos <sp…@so…> — 2010-06-24 13:46:40

[snip]
> Even if that isn't the problem, you should probably declare those 
> variables static so that future readers of the code don't have to go 
> looking to find out where else the variables might be used or changed.
Although I agree that static declarations are a better idea, it's 
unlikely to be relevant to the problem at hand.

The code in question is a kernel module, which means two things 
regarding variable scope: 1) the symbol isn't available to other modules 
unless explicitly exported with EXPORT_SYMBOL; 2) it's a kernel module, 
which means that it can scribble on anything, or be scribbled on by any 
other kernel module.

That is somewhat different in sim though, which could be at least a part 
of why it works differently in sim vs. RT.

- Steve



From: Neil Baylis <neil….@gm…> — 2010-06-24 14:03:18

If changing/removing some unrelated line of code fixes a problem, then I
usually suspect one of two things: a) It's a race condition, and you changed
the timing, or b) You changed the memory layout, and corruption (e.g. due to
wild pointer) that was occurring at a vital location is now occurring at an
innocuous location.

Neil

On Thu, Jun 24, 2010 at 6:04 AM, Andy Pugh <an...@an...>wrote:

> On 24 June 2010 13:39, Kenneth Lerman <Kenne...@se...> wrote:
>
> > ==========
> > static PmCartesian old;
> > double dx = 0, dy = 0, C = 0;
> > double fKcount = 0, rKcount = 0;
> > ==========
> > "static" means that this variable will be visible only from this file.
> > The lack of the static keyword means that dx, dy, C, fKcount, and rKcount
> > will be visible from other files.
>
> Isn't that only the case if the other files "Extern" it? I can
> definitely see the scop for that being a problem with dx and dy, but
> the timing would have to be very accurate for it to explain the
> rKcount behaviour, which increases by exactly 0.7101..... every time
> the function is called.
>
> > That probably isn't what you want since it means that some other function
> > might be changing those variables.
>
> I think perhaps I should print the values of both and see if the
> problem is in the actual value of tKcount, or somewhere in the
> transfer of that value to the HAL pin.
>
> (I don't actually need or use rKcount, but it seems to be indicative
> of a wider problem, ie variables not taking on anything like the
> expected values. I am still baffled that removing a line that had no
> link at all to the (unrelated) stepgen function stopped the bizarre
> drift in the -fb value. )
>
> --
> atp
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Emc-developers mailing list
> Emc-d...@li...
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
http://www.pixpopuli.com

From: Andy Pugh <an…@an…> — 2010-06-24 14:36:31

On 24 June 2010 15:03, Neil Baylis <neil....@gm...> wrote:
>  b) You changed the memory layout, and corruption (e.g. due to
> wild pointer) that was occurring at a vital location is now occurring at an
> innocuous location.

This has been my working hypothesis, but I have looked and looked at
my code and not spotted the wild pointer yet.
But then, I wouldn't, as I find pointers baffling (I have spent the
last several years working with a pass-by-reference language)

-- 
atp


From: Andy Pugh <an…@an…> — 2010-06-25 00:54:06

On 24 June 2010 15:03, Neil Baylis <neil....@gm...> wrote:
> If changing/removing some unrelated line of code fixes a problem, then I
> usually suspect one of two things: a) It's a race condition, and you changed
> the timing, or b) You changed the memory layout, and corruption (e.g. due to
> wild pointer) that was occurring at a vital location is now occurring at an
> innocuous location.

I have been up till 2am or later for about the last week staring at
the same 200 lines of code, and I am losing heart.

Could somebody else look at it please ( http://www.pastebin.org/357256
) and see if you can spot where I have a pointer wrong? (or, indeed,
where I might be causing a race condition).

It is probably worth reiterating that it works exactly as expected on
a sim configuration.

Note that line 53 is commented out as that causes the
stepgen.0.feedback to drift. (even with the stepgen.0.position-dmd
left unconnected in HAL. All the more odd as the C axis doesn't have a
stepgen, I only included it so that the AXIS preview would look right)

I am printing the joint positions as they come back into control.c
from from inversekins, but as fowardkins is running all the time I am
(hopefully) only printing that if it comes back as a NaN and I am not
seeing that.

(I am assuming that the RT delay is not the problem, that is because I
need the SMI patch, but that seems to disappear from rtapi.conf every
time you re-compile, and I can't be bothered putting it back)

Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
RTAPI: ERROR: Unexpected realtime delay on task 1
This Message will only display once per session.
Run the Latency Test and resolve before continuing.

Unexpected realtime delay: check dmesg for details.

j0 -0.001341 j1 -0.001341 j2 -0.001162 j3 0.000018 j4 0.000000 j5 3.141587

emc/task/taskintf.cc 611: Error on axis 0, command number 184
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.000358

joint 0 following error
j0 140.260302 j1 140.260302 j2 -0.008184 j3 -106.717689 j4 0.777232 j5 3.141547

emc/task/taskintf.cc 611: Error on axis 0, command number 202
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.000537

joint 0 following error
j0 101.772044 j1 101.772044 j2 -0.002109 j3 -10.853862 j4 0.533877 j5 3.141572

emc/task/taskintf.cc 611: Error on axis 0, command number 220
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.000716

joint 0 following error
j0 101.770702 j1 101.770702 j2 -0.003164 j3 -10.853880 j4 0.533877 j5 3.141562

emc/task/taskintf.cc 611: Error on axis 0, command number 238
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.000896

joint 0 following error
j0 101.769361 j1 101.769361 j2 -0.004218 j3 -10.853898 j4 0.533877 j5 3.141552

emc/task/taskintf.cc 611: Error on axis 0, command number 256
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.001075

joint 0 following error
j0 101.768020 j1 101.768020 j2 -0.005273 j3 -10.853916 j4 0.533877 j5 3.141542

emc/task/taskintf.cc 611: Error on axis 0, command number 274
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.001254

joint 0 following error
j0 101.766679 j1 101.766679 j2 -0.006328 j3 -10.853934 j4 0.533877 j5 3.141532

emc/task/taskintf.cc 611: Error on axis 0, command number 292
Exceeded positive soft limit on joint 0
abs_ferror = nan and ferror_limit = nan. joint = -0.001433

joint 0 following error



-- 
atp


From: Alexey Starikovskiy <aysta…@gm…> — 2010-06-25 01:07:27

Hi Andy,

please make "struct haldata_t {} *haldata = 0;" static too.

You don't want duplicates:
--------------------------------------
result = hal_pin_float_new("taperkins.fKcount", HAL_OUT,
&(haldata->fKcount), comp_id);
if(result < 0) goto error;
result = hal_pin_float_new("taperkins.rKcount", HAL_OUT,
&(haldata->rKcount), comp_id);
if(result < 0) goto error;
-----------------------------------

Good luck,
Alex.


25.06.2010 04:53, Andy Pugh пишет:
> On 24 June 2010 15:03, Neil Baylis <neil....@gm...> wrote:
>   
>> If changing/removing some unrelated line of code fixes a problem, then I
>> usually suspect one of two things: a) It's a race condition, and you changed
>> the timing, or b) You changed the memory layout, and corruption (e.g. due to
>> wild pointer) that was occurring at a vital location is now occurring at an
>> innocuous location.
>>     
> I have been up till 2am or later for about the last week staring at
> the same 200 lines of code, and I am losing heart.
>
> Could somebody else look at it please ( http://www.pastebin.org/357256
> ) and see if you can spot where I have a pointer wrong? (or, indeed,
> where I might be causing a race condition).
>
> It is probably worth reiterating that it works exactly as expected on
> a sim configuration.
>
> Note that line 53 is commented out as that causes the
> stepgen.0.feedback to drift. (even with the stepgen.0.position-dmd
> left unconnected in HAL. All the more odd as the C axis doesn't have a
> stepgen, I only included it so that the AXIS preview would look right)
>
> I am printing the joint positions as they come back into control.c
> from from inversekins, but as fowardkins is running all the time I am
> (hopefully) only printing that if it comes back as a NaN and I am not
> seeing that.
>
> (I am assuming that the RT delay is not the problem, that is because I
> need the SMI patch, but that seems to disappear from rtapi.conf every
> time you re-compile, and I can't be bothered putting it back)
>
> Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
> RTAPI: ERROR: Unexpected realtime delay on task 1
> This Message will only display once per session.
> Run the Latency Test and resolve before continuing.
>
> Unexpected realtime delay: check dmesg for details.
>
> j0 -0.001341 j1 -0.001341 j2 -0.001162 j3 0.000018 j4 0.000000 j5 3.141587
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 184
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.000358
>
> joint 0 following error
> j0 140.260302 j1 140.260302 j2 -0.008184 j3 -106.717689 j4 0.777232 j5 3.141547
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 202
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.000537
>
> joint 0 following error
> j0 101.772044 j1 101.772044 j2 -0.002109 j3 -10.853862 j4 0.533877 j5 3.141572
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 220
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.000716
>
> joint 0 following error
> j0 101.770702 j1 101.770702 j2 -0.003164 j3 -10.853880 j4 0.533877 j5 3.141562
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 238
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.000896
>
> joint 0 following error
> j0 101.769361 j1 101.769361 j2 -0.004218 j3 -10.853898 j4 0.533877 j5 3.141552
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 256
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.001075
>
> joint 0 following error
> j0 101.768020 j1 101.768020 j2 -0.005273 j3 -10.853916 j4 0.533877 j5 3.141542
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 274
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.001254
>
> joint 0 following error
> j0 101.766679 j1 101.766679 j2 -0.006328 j3 -10.853934 j4 0.533877 j5 3.141532
>
> emc/task/taskintf.cc 611: Error on axis 0, command number 292
> Exceeded positive soft limit on joint 0
> abs_ferror = nan and ferror_limit = nan. joint = -0.001433
>
> joint 0 following error
>
>
>
>   



From: Andy Pugh <an…@an…> — 2010-06-25 08:53:38

On 25 June 2010 02:07, Alexey Starikovskiy <aysta...@gm...> wrote:

> please make "struct haldata_t {} *haldata = 0;" static too.

I will certainly give this a try, and I would be interested to see if
it clears up some of the wierdness in the HAL pins. However, as the
HAL pins are only present for debug  purposes (the only one that is
actually meant to be there is the head_offset) and the remainder are
only written to I doubt that is the root cause.
Is it safe to "static" a structure and then hal_malloc it in the init
function a bit later in the code?
Isn't malloc-ing the structure making it static anyway?


-- 
atp


From: Andy Pugh <an…@an…> — 2010-06-25 09:10:35

On 25 June 2010 03:14, Alexey Starikovskiy <aysta...@gm...> wrote:

> I think real problem is here:
>
> dy = pos->tran.y - old.y;
> dx = pos->tran.x - old.x;
> if (dx != 0 || dy != 0) {
> C = atan2(dx, dy);
> }
> C should be set to zero before if.
> dx == 0 and dy == 0 may be not what you want. fabs(dx)>eps will be more
> appropriate.

I agree that might give incorrect results from a mathematical point of
view (and I could probably afford to go a lot bigger than eps in
practice) but it seems to be an unlikely cause of the underlying
problem (unconnected stepgen function moving for no good reason,
numbers not incrementing by the requested amount).
I am pretty sure that atan2(0,0) returns zero rather than NaN, that is
certainly all I have seen on the linked HAL pin unless HAL translates
NaN to zero?

> and dx, dy and C and rKcount really belong to this function and not the
> global context.

Good point, this is true now, but hasn't always been so.

> Only 'old' is shared between two functions and needs to be global.

And that doesn't need to be, I moved the code that sets it  to the
other function and forgot to move the debug HAL pin at the same time.

-- 
atp


From: Alexey Starikovskiy <aysta…@gm…> — 2010-06-25 02:14:09

Forget duplicates... I just can't read.

I think real problem is here:


dy = pos->tran.y - old.y;
dx = pos->tran.x - old.x;
if (dx != 0 || dy != 0) {
C = atan2(dx, dy);
}
C should be set to zero before if.
dx == 0 and dy == 0 may be not what you want. fabs(dx)>eps will be more
appropriate.
and dx, dy and C and rKcount really belong to this function and not the
global context.
Only 'old' is shared between two functions and needs to be global.

Regards,
Alex.

25.06.2010 05:07, Alexey Starikovskiy пишет:
> Hi Andy,
>
> please make "struct haldata_t {} *haldata = 0;" static too.
>
> You don't want duplicates:
> --------------------------------------
> result = hal_pin_float_new("taperkins.fKcount", HAL_OUT,
> &(haldata->fKcount), comp_id);
> if(result < 0) goto error;
> result = hal_pin_float_new("taperkins.rKcount", HAL_OUT,
> &(haldata->rKcount), comp_id);
> if(result < 0) goto error;
> -----------------------------------
>
> Good luck,
> Alex.
>
>
> 25.06.2010 04:53, Andy Pugh пишет:
>   
>> On 24 June 2010 15:03, Neil Baylis <neil....@gm...> wrote:
>>   
>>     
>>> If changing/removing some unrelated line of code fixes a problem, then I
>>> usually suspect one of two things: a) It's a race condition, and you changed
>>> the timing, or b) You changed the memory layout, and corruption (e.g. due to
>>> wild pointer) that was occurring at a vital location is now occurring at an
>>> innocuous location.
>>>     
>>>       
>> I have been up till 2am or later for about the last week staring at
>> the same 200 lines of code, and I am losing heart.
>>
>> Could somebody else look at it please ( http://www.pastebin.org/357256
>> ) and see if you can spot where I have a pointer wrong? (or, indeed,
>> where I might be causing a race condition).
>>
>> It is probably worth reiterating that it works exactly as expected on
>> a sim configuration.
>>
>> Note that line 53 is commented out as that causes the
>> stepgen.0.feedback to drift. (even with the stepgen.0.position-dmd
>> left unconnected in HAL. All the more odd as the C axis doesn't have a
>> stepgen, I only included it so that the AXIS preview would look right)
>>
>> I am printing the joint positions as they come back into control.c
>> from from inversekins, but as fowardkins is running all the time I am
>> (hopefully) only printing that if it comes back as a NaN and I am not
>> seeing that.
>>
>> (I am assuming that the RT delay is not the problem, that is because I
>> need the SMI patch, but that seems to disappear from rtapi.conf every
>> time you re-compile, and I can't be bothered putting it back)
>>
>> Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
>> RTAPI: ERROR: Unexpected realtime delay on task 1
>> This Message will only display once per session.
>> Run the Latency Test and resolve before continuing.
>>
>> Unexpected realtime delay: check dmesg for details.
>>
>> j0 -0.001341 j1 -0.001341 j2 -0.001162 j3 0.000018 j4 0.000000 j5 3.141587
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 184
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.000358
>>
>> joint 0 following error
>> j0 140.260302 j1 140.260302 j2 -0.008184 j3 -106.717689 j4 0.777232 j5 3.141547
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 202
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.000537
>>
>> joint 0 following error
>> j0 101.772044 j1 101.772044 j2 -0.002109 j3 -10.853862 j4 0.533877 j5 3.141572
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 220
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.000716
>>
>> joint 0 following error
>> j0 101.770702 j1 101.770702 j2 -0.003164 j3 -10.853880 j4 0.533877 j5 3.141562
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 238
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.000896
>>
>> joint 0 following error
>> j0 101.769361 j1 101.769361 j2 -0.004218 j3 -10.853898 j4 0.533877 j5 3.141552
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 256
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.001075
>>
>> joint 0 following error
>> j0 101.768020 j1 101.768020 j2 -0.005273 j3 -10.853916 j4 0.533877 j5 3.141542
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 274
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.001254
>>
>> joint 0 following error
>> j0 101.766679 j1 101.766679 j2 -0.006328 j3 -10.853934 j4 0.533877 j5 3.141532
>>
>> emc/task/taskintf.cc 611: Error on axis 0, command number 292
>> Exceeded positive soft limit on joint 0
>> abs_ferror = nan and ferror_limit = nan. joint = -0.001433
>>
>> joint 0 following error
>>
>>
>>
>>   
>>     
>   



From: Alexey Starikovskiy <aysta…@gm…> — 2010-06-25 09:18:18

25.06.2010 13:10, Andy Pugh пишет:
> On 25 June 2010 03:14, Alexey Starikovskiy <aysta...@gm...> wrote:
>
>   
>> I think real problem is here:
>>
>> dy = pos->tran.y - old.y;
>> dx = pos->tran.x - old.x;
>> if (dx != 0 || dy != 0) {
>> C = atan2(dx, dy);
>> }
>> C should be set to zero before if.
>> dx == 0 and dy == 0 may be not what you want. fabs(dx)>eps will be more
>> appropriate.
>>     
> I agree that might give incorrect results from a mathematical point of
> view (and I could probably afford to go a lot bigger than eps in
> practice) but it seems to be an unlikely cause of the underlying
> problem (unconnected stepgen function moving for no good reason,
> numbers not incrementing by the requested amount).
> I am pretty sure that atan2(0,0) returns zero rather than NaN, that is
> certainly all I have seen on the linked HAL pin unless HAL translates
> NaN to zero?
>   
You use C from previous call in case of dx=0 and dy=0.
It could be anything and could move you anywhere.
>   
>> and dx, dy and C and rKcount really belong to this function and not the
>> global context.
>>     
> Good point, this is true now, but hasn't always been so.
>
>   
>> Only 'old' is shared between two functions and needs to be global.
>>     
> And that doesn't need to be, I moved the code that sets it  to the
> other function and forgot to move the debug HAL pin at the same time.
>
>   



From: Andy Pugh <an…@an…> — 2010-06-25 09:54:03

On 25 June 2010 10:18, Alexey Starikovskiy <aysta...@gm...> wrote:

Firstly, many thanks for looking at my module.

> You use C from previous call in case of dx=0 and dy=0.
> It could be anything and could move you anywhere.

That is intentional. "C" represents the direction that the cutting
head is moving in, and should hold its value if the axis stops.
I might add code at a later point that limits the speed that C can
swing at and enforces a cw/ccw  direction, but for the moment it seems
to work.

Mathematically the module works exactly as expected and desired in a
"sim" configuration, it is only when running on a "live" RTAI
installation that problems occur, and the problems seem to be separate
from the kinematics mathematics. No matter how wrong my calculations
are, I don't understand why stepgen.0.position-fb increases every time
the forwards kinematics function runs, even though there is no signal
connected to its input. Then, when I remove line 53 (which refers to a
C-axis which is not connected to any stepgen at all in the HAL) the
problem goes away.
I am almost tempted to add another stepgen and just not use stepgen.0,
but that would only solve one of the problems.

Something in my module appears to be writing "out of bounds" into the
memory occupied by the stepgen. Also, though I have not managed to
track down where yet, valid numerical values from my module are giving
NaN values in downstream calculations

Something I haven't tried yet is changing the order in which functions
are declared and added to threads in the HAL file (and, in fact, I
didn't write the HAL file)

-- 
atp


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

The home inputs of the PIC32 are to 5v permanently , I don’t have limit switches and I send this inputs to HIGH, this could be the problem??


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 12:41 am

JASM123 wrote:The home inputs of the PIC32 are to 5v permanently , I don’t have limit switches and I send this inputs to HIGH, this could be the problem??

The limit switches are not enabled on the sample config.

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 1:46 am

Hi kinsa thank you for the responding
this is the result for the commands:
halcmd show picnc.ready
halcmd show picnc.spi_fault
what could be the problem??

Attachments
comandresult.gif
comandresult.gif (15.77 KiB) Viewed 5642 times


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 2:10 am

Right now I have connected the pin 6 (Enable) with the Driver, and I want to move the motor whit the JOG X (+/-) but the pin 6 only sends 3.3 volts to my Driver for this my motor doesn’t move, I already don’t have the error but the motor doesn’t move the step and the direction signal are correct but the pin 6 don’t change to Low (0v) to activate my stepper.

thank you for your help


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 3:47 am

JASM123 wrote:Hi kinsa thank you for the responding
this is the result for the commands:
halcmd show picnc.ready
halcmd show picnc.spi_fault
what could be the problem??

Run the commands when linuxcnc ia running.

42


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 3:55 am

JASM123 wrote:Right now I have connected the pin 6 (Enable) with the Driver, and I want to move the motor whit the JOG X (+/-) but the pin 6 only sends 3.3 volts to my Driver for this my motor doesn’t move, I already don’t have the error but the motor doesn’t move the step and the direction signal are correct but the pin 6 don’t change to Low (0v) to activate my stepper.

thank you for your help

Sorry I made a mistake here :)

The sample config only drives the step/dir outputs. The extra inputs and outputs are never used.

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 4:14 am

Thank you kinsa for the answer, for this I have to connect the Enable pin of the driver to Ground? and disable the driver for the pin 6 of pic32?
thank you and regards


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 4:38 am

JASM123 wrote:Thank you kinsa for the answer, for this I have to connect the Enable pin of the driver to Ground? and disable the driver for the pin 6 of pic32?
thank you and regards

You can for testing purposes. Connect it later once you’ve finalized your setup.

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 5:05 am

Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 5:12 am

JASM123 wrote:Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards

What is the status of spi_fault when that happens?

I never get that unless the communication between rpi and picnc is disrupted.

42


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 12:54 pm

JASM123 wrote:Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards

Note that there is a lag between pressing the keyboard//screen buttons on the mini display. This is specially true if the continuous motion is selected instead of incremental jogging.

You can also use G-Code command (G0) using the MDI page.

42


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 2:41 pm

Does the error happen if the motors are not connected? If it doesn’t then most likely the problem is due to electrical noise.

To easily catch SPI communication errors, replace the following lines on your HAL file:

Code: Select all

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

with these:

Code: Select all

# estop
loadrt estop_latch
loadrt not

addf estop-latch.0 servo-thread
addf not.0 servo-thread

net estop-loopout iocontrol.0.emc-enable-in <= estop-latch.0.ok-out
net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in
net estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset
net inv_fault not.0.in <= picnc.ready
net remote-estop estop-latch.0.fault-in <= not.0.out

This will assert e-stop whenever there’s a problem with the SPI communication.

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 6:17 pm

Hi kinsa
I implement the modification in the HAL file but the error persist, after I move the stepper motor, during many time (increment or continuous mode) the pic32 enters in an infinite cycle and my motor turns without stopping. I seem that is a motor noise, how can eliminate this noise for my circuit??

thank you and regards


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 11:26 pm

Hi kinsa I solve the problem, I modified the INI file for axis 0 I change the FERROR, that previously has a number 1, I change to 4 but the problem didn’t solve for this I change this number to 40, I the error solved, but I have a question I read that the FERROR is the distance allowed by rapid moves, for this I don’t understand this number would you please explain me how works this variable??.

Thank you and regards


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 11:37 pm

Can you post a pic of your setup?

It’s strange that your motor still runs after you shutdown linuxcnc. The firmware has a code that shutdown the stepgen if it doesn’t receive a valid data from rpi.

42


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 11:38 pm

JASM123 wrote:Hi kinsa I solve the problem, I modified the INI file for axis 0 I change the FERROR, that previously has a number 1, I change to 4 but the problem didn’t solve for this I change this number to 40, I the error solved, but I have a question I read that the FERROR is the distance allowed by rapid moves, for this I don’t understand this number would you please explain me how works this variable??.

Thank you and regards

http://wiki.linuxcnc.org/cgi-bin/wiki.p … wing_Error

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 4:32 am

kinsa wrote:Can you post a pic of your setup?

It’s strange that your motor still runs after you shutdown linuxcnc. The firmware has a code that shutdown the stepgen if it doesn’t receive a valid data from rpi.

Hi kinsa, the stepper motor stops after I shutdown linuxcnc. I successful move the X axis without problem, but if whe want to run other stepper motor with the same driver it gives me the same error, the interesting for this is that when I tried to run an axis with a high friction (mechanically hard to move), it produces a lot of electrical noise that affect my circuit. I put all coupling capacitors but the problem persist, for the test of my stepper motor I used a voltage source of 7.5 volts for this I don’t obtain the correct current for my stepper motor, could be this the problem??

thank you and regards


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sun Nov 16, 2014 9:03 am

It could be the power supply. Try separating the stepper supply from rpi and picnc. Also observe proper grounding and keep the spi signal cables short.

Do you happen to use a breadboard?

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 6:56 pm

I will try your suggestions, for the PIC32 I used a soldered PCB, but for the driver for testing conditions I using a protoboard to testing the motor and the driver. I joined the ground and I don’t know if I can to separate the voltage of the motor and the logic because, the pololu driver (A4988) has internally joined the ground of logic and the ground of the motor supply how can separate this parts??

thank you so much


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 8:56 pm

The optocouplers connected between the Dir and step signal whit the Drivers will solve the problem???

thankyou and regards


kinsa

Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sun Nov 16, 2014 11:30 pm

JASM123 wrote:Hi kinsa
I implement the modification in the HAL file but the error persist, after I move the stepper motor, during many time (increment or continuous mode) the pic32 enters in an infinite cycle and my motor turns without stopping. I seem that is a motor noise, how can eliminate this noise for my circuit??

thank you and regards

I’m confused with this one.

PICnc will never go into continuous loop on its own as there are checks in the firmware to halt what it’s doing if the SPI communication gets disrupted. Are you sure linuxcnc has not commanded the motors to move a certain distance that takes a while to reach? Monitor the commanded and feedback positions. The halscope program is useful in this instance.

Hi kinsa, the stepper motor stops after I shutdown linuxcnc. I successful move the X axis without problem, but if whe want to run other stepper motor with the same driver it gives me the same error, the interesting for this is that when I tried to run an axis with a high friction (mechanically hard to move), it produces a lot of electrical noise that affect my circuit. I put all coupling capacitors but the problem persist, for the test of my stepper motor I used a voltage source of 7.5 volts for this I don’t obtain the correct current for my stepper motor, could be this the problem??

Steppers are open loop, there’s no feedback on whether the load is light or heavy.

Noise should latch the spi_fault pin. The other possible reason is that the pic32 goes into reset, but it is unlikely as the hal driver will catch the disruption on the SPI communication…

The optocouplers connected between the Dir and step signal whit the Drivers will solve the problem???

Maybe, only if the problem happens when the motors are attached to the drivers.

42


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Mon Nov 17, 2014 7:58 pm

HI kinsa
I solved the problem!!!!, I bought a 4N25 optocouplers and it solved I move the motor without errors,I tried to buy the 6N135 which is a fast optocoupler but I didn’t find , now I have a question related with the stepper and the driver, I put the driver in microsteping mode (1/16) to obtain the precision of the interface, for example if I move 5 mm in the interface the axis moves 5mm, but in the microsteping mode I lost force (Ncm) of the motor, for this I want to change to full step mode (to obtain plus force) but I don’t know What I have to change in the INI or in the HAL file to calibrate this.
which variable I have to change in the ini file or hal fiel to obtain this.

thank you so much and regards


Wire

Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Mon Nov 17, 2014 8:27 pm

would avoid full stepping and go with half for smoothest operation.

As for the hal updates if you were at 1/16 and move to 1/2 stepping take your steps per inch/mm number and divide by 8 since it takes less steps to go the same distance. Math:

([old steps per inch/mm]*[old micro step setting])/[new micro step setting] = [new steps per inch/mm]

example going from 1/16 to 1/2 stepping with 1280 steps per mm with the old setting

(1280 * 0.0625)/0.5 = 160


Wire

Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Mon Nov 17, 2014 8:33 pm

I think the line you want to edit is «SCALE = 1200.0» under each of the [AXIS_x] statements in the .ini file. Have not played with that part yet so may be off.


JASM123

Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Mon Nov 17, 2014 8:39 pm

Hi kinsa thank you for responding,
Ok I see, but this new configuration in which variable of the INI or in the HAL file have to change,in the INI file there are variables such as Base period, Servo period, in which variable I have to change to obtain this new resolution (1/2)??


Return to “Automation, sensing and robotics”

Moderator: Moderators

diepchess

Berichten: 1444
Lid geworden op: 02 jul 2013 11:02
Locatie: Veenendaal
Contacteer:

Following error joint 0

hallo, na wat frezen — hij raakte werkstuk nog nauwelijks op het moment — krijg ik een «following error» bij linuxcnc.
Kreeg ik gisteren ook.

Gisteren was het een following limb 1 error. Nu een limb 2 eerst. Overnieuw klus gestart en nu is het na minuut of 2 een following joint 0 error.

Geen idee wat het is. Heb erop gegoogled maar kan er de vinger niet onder krijgen.

Had acceleratie en snelheid wat omlaaggezet vandaag (zelfde klus als gisteren die dus niet gelukt was vanzelfsprekend).
Zo snel staat hij niet overigens. 0.3 mm/s^2 op de X en Y qua acceleratie en 1.5 mm/s (90 mm/minuut) qua lineaire snelheid.

Toch wel matig trage snelheden als je mij vraagt. 786 rpm stond hij op, 0.75mm afname per diepte. 4 tandig scherp HSS freesje van 6mm.

Niet waarvan ik zeg: «goh». De ventilators van alle steppers werken dus worden goed gekoeld.

diepchess

Berichten: 1444
Lid geworden op: 02 jul 2013 11:02
Locatie: Veenendaal
Contacteer:

Re: Following error joint 0

Bericht

door diepchess » 20 apr 2022 19:53

3 fotootjes

P1050754.JPG

P1050755.JPG

P1050756.JPG

Je hebt niet voldoende permissies om de bijlagen van dit bericht te bekijken.

diepchess

Berichten: 1444
Lid geworden op: 02 jul 2013 11:02
Locatie: Veenendaal
Contacteer:

Re: Following error joint 0

Bericht

door diepchess » 20 apr 2022 19:54

De foto is van de 2e keer. Precies op zelfde plek kapt hij er weer mee met zelfde error.

«joint 0 following error»

Als ik erop google wat de foutmelding veroorzaakt zie ik ook geen heldere antwoorden.

Gebruikersavatar

Sven

Berichten: 5683
Lid geworden op: 24 sep 2008 09:13
Locatie: Arnhem
Contacteer:

Goudgele

Berichten: 563
Lid geworden op: 21 jul 2020 12:56

Re: Following error joint 0

Bericht

door Goudgele » 20 apr 2022 20:16

Hier onderaan de pagina een lijstje met 5 dingen die het kunnen veroorzaken. ik zou beginnen eens te kijken wat de instelling van FERROR en MIN_FERROR zijn bij jou. Daarnaast bekijken welke pulsfrequentie je vraagt bij de snelheid waarmee je beweegt. Als die te hoog is kan het dus ook voorkomen, omdat je controller het niet bij kan houden. Kan je oplossen door snelheid te verlagen of microstepping wat lager te zetten.

http://wiki.linuxcnc.org/cgi-bin/wiki.p … 20is%20set.

Aangezien je snelheid al erg laag is, lijkt het mij een probleem met die FERROR settings of een veel te hoge microstep setting op je drivers

diepchess

Berichten: 1444
Lid geworden op: 02 jul 2013 11:02
Locatie: Veenendaal
Contacteer:

Re: Following error joint 0

Bericht

door diepchess » 20 apr 2022 22:35

Aha met dank aan linuxcnc forum — ik had natuurlijk die snelheden zitten opkrikken van de assen met vallen en opstaan. De STEPGEN_MAXACCEL moet stevig hoger staan dan de maximum acceleratie waarom linuxcnc mag bewegen en dat voor elke as dan natuurlijk. Die stond bij mij gelijk in bf25.ini

Kjelt

Donateur
Berichten: 5665
Lid geworden op: 14 jun 2007 21:51
Locatie: Eindhoven

Re: Following error joint 0

Bericht

door Kjelt » 21 apr 2022 16:04

Pfff wat een ellende, kroonsteentjes, geen trekontlasting, afscherming kabels (indien aanwezig) niet geaard,
230V aanraakbaar en kabels over en door elkaar.
Hopelijk zijn er geen kinderen in de buurt.
Dit kan ook allerlei onverwachte issues opleveren vooral bij hogere frequenties.
Je zou zo’n geweldige programmeur zijn, wel dit is het elektrotechnische equivalent van spaghetti code, oftewel hoe het niet moet.

Goudgele

Berichten: 563
Lid geworden op: 21 jul 2020 12:56

Re: Following error joint 0

Bericht

door Goudgele » 21 apr 2022 16:33

Eens. Ik meen ook te zien dat de microsteps op maximaal staan. Kan het niet met zekerheid zeggen.
Als dat idd het geval is vind ik het niet gek dat je maar zo’n lage snelheid haalt. Zet maar eens op 800 of 1600ppr en kijk wat je dan haalt. Durf te wedden zeker 2000-3000 mm/min, afhankelijk van je motoren.

Понравилась статья? Поделить с друзьями:
  • Lpksetup exe ошибка
  • Linux проверка файловой системы на ошибки
  • Lp2dx9 exe lost planet 2 как исправить
  • Linux проверка диска на ошибки fsck
  • Linux проверка ssd диска на ошибки