HURCO KMB-1 Control Update

More
8 months 2 weeks ago #343112 by PCW
Replied by PCW on topic HURCO KMB-1 Control Update
If it's open loop, the question becomes what is changing the analog out command?

(bottom trace second plot)

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

More
8 months 2 weeks ago - 8 months 2 weeks ago #343117 by PCW
Replied by PCW on topic HURCO KMB-1 Control Update
Crumbs I was sure that the angle used in M19, was the angle after an index pulse, but can see now its after the enable edge.

The spindle position after an index pulse is the angle relative to the index pulse, not the enable.
The enable arms the hardware to detect the index and when index has  been detected by the
hardware, signal the driver that index has been detected. The counter hardware also either latches
the count at index (Mesa hardware does this) or clears  the count at index so that the spindle position
is set to 0 at the index position.
Last edit: 8 months 2 weeks ago by PCW.
The following user(s) said Thank You: NT4Boy

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

More
8 months 2 weeks ago #343138 by NT4Boy
Replied by NT4Boy on topic HURCO KMB-1 Control Update
Ok Peter, so that is resetting my original understanding. But I have been unable to get the index pulse, which is clearly present in halscope to trigger the position reset. The sensors I am using for both the toothed wheel (a pair in quadrature) and a separaste index tooth, is ATS616LSG by Allegro. Datasheet
Just wondering if there is some magic in the devices that makes them unsuitable here. ( a straw to clutch at).

Re the speed variation, then I don't think there is anything in the config that is altering the analogout.
I have these:- But I think they are only used for the pyvcp speed display bar and at speed led. Can the act of processing them anyway do something?  I guess the thing to try is a minimum basic clean build and see what goes from there.

setp lowpass.spindle.gain 1.000000
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
net spindle-fb-rpm-abs-filtered lowpass.spindle.out



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

#sets spindle-at-speed true
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb-rps => near.0.in2
net spindle-at-speed  <= near.0.out
#net spindle-at-speed spindle.0.at-speed <= near.0.out
setp near.0.scale 1.000000
setp near.0.difference 1.666667
 

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

More
8 months 2 weeks ago - 8 months 2 weeks ago #343156 by NT4Boy
Replied by NT4Boy on topic HURCO KMB-1 Control Update
I'd forgotten what a mission I'd had at the start of my linuxcnc adventure with limit switches, so building a config from scratch was a sufficient challenge. Anyway after copying in just the essential parts from the working hal, was able to home it and run the spindle. Runs, of course, without any hiccups at all. Will start adding in the complications and see which one is the bad guy. Will report back.
Last edit: 8 months 2 weeks ago by NT4Boy.

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

More
8 months 2 weeks ago #343181 by PCW
Replied by PCW on topic HURCO KMB-1 Control Update
Ok Peter, so that is resetting my original understanding. But I have been unable to get the index pulse, which is clearly present in halscope to trigger the position reset.

The way index works on LinuxCNC with quadrature encoders is that when LinuxCNC (or some hal component)
wants a encoder reset at the next index occurrence, it sets the index-enable pin. This arms the encoder counter
hardware so at the next index, two things happen, the encoder position is reset to 0, and the index enable pin
is set false, so LinuxCNC or the controlling hal component knows that the index has been detected (and position zeroed)
The following user(s) said Thank You: NT4Boy

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

More
8 months 1 week ago #343196 by NT4Boy
Replied by NT4Boy on topic HURCO KMB-1 Control Update
I've ended up fighting the hal loader.

#
# M19 ORIENT – single driver / multi‑sink form
#

loadrt orient count=1
addf orient.0 servo-thread

loadrt pid names=pid.o
addf pid.o.do-pid-calcs servo-thread

loadrt mux2 count=1
addf mux2.0 servo-thread
loadrt or2 count=1
addf or2.0 servo-thread

# --- Orient PID tuning ---
setp pid.o.Pgain 0.05
setp pid.o.Igain 0.0005
setp pid.o.Dgain 0.0002
setp pid.o.maxoutput 60
setp pid.o.error-previous-target true
setp orient.0.tolerance 0.05
setp orient.0.angle 0

# --- One signal name, declared once and fanned out ---
net orient-bit spindle.0.orient => orient.0.enable
net orient-bit => or2.0.in1
net orient-bit => mux2.0.sel
# separate signal drives the encoder’s index enable input
net orient-arm-index orient-bit => hm2_7i92.0.encoder.05.index-enable

# --- Run enable OR gate ---
net run-enable or2.0.out => hm2_7i92.0.7i77.0.1.spinena
net spindle-enable => or2.0.in0

# --- Orient angle / feedback wiring ---
net orient-angle spindle.0.orient-angle => orient.0.angle
net spindle-revs hm2_7i92.0.encoder.05.position => orient.0.position

# --- Orient PID loop ---
net orient-cmd orient.0.command => pid.o.command
net orient-fb hm2_7i92.0.encoder.05.velocity-rpm => pid.o.feedback
net orient-out pid.o.output => mux2.0.in1

# --- Normal spindle path and output switch ---
net spindle-output pid.s.output => mux2.0.in0
net spindle-vfd-out mux2.0.out => hm2_7i92.0.7i77.0.1.analogout5

# --- Completion flag back to controller ---
net orient-done orient.0.is-oriented => spindle.0.is-oriented

#Error in file ./spindlecontrol.hal:
# Pin 'orient-bit' does not exist
#Shutting down and cleaning up LinuxCNC…

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

Time to create page: 0.325 seconds
Powered by Kunena Forum