[SOLVED] axes follow other axes
I search for suggestion about these situation ... with some type of command (python, bash or c++) I need to make sure that an axis chase another axis ..... the leader axes have an pid and encoder command, the follow axes have stepgen command. Sometime in my gcode (or mdi command if the program that pilot is c++) the first axes follow the second one. sometime the first is free to move and directly command by normal gcode (or mdi command if the program that pilot is c++).
There are some doc about??
Please Log in or Create an account to join the conversation.
There are some doc about??
Almost certainly not, for this particular application.
You want a stepper axis to chase a servo axis?
I would configure the stepgen in velocity mode, and then configure a second PID to control the stepgen velocity. It could either take the same command value as the servo axis, or it could literlay "chase" it by following the encoder feedback.
Depending on the application you might be able to simply net the stepgen position command (of a position-mode stepgen) to the encoder feedback or position command.
You can change the linkages around in HAL either by driving "mux" components, or actually re-wiring the hal components.
Please Log in or Create an account to join the conversation.
You want a stepper axis to chase a
servo axis?
yes .... exactly i wont to chase only an encoder signal with an stepper axes... there is only a motor+inverter+encoder without PID control.
do I understand correcly? you suggest to create a NET signal (connect to digital input for example?) this signal starts or stops the chase process......
thank a lot for Any reply you would give
Please Log in or Create an account to join the conversation.
do I understand correcly? you suggest to create a NET signal (connect to digital input for example?) this signal starts or stops the chase process.
As always, the devil is in the detail.
Do you actually want the stepper to "catch" the other motor, or just match speed?
You can probably use the built-in velocity and accel limits of the stepgen component to make things rather simpler.
In theory, if you simply
net catch-me-if-you-can encoder.0.position => stepgen.0.position-cmd
Then as soon as you
setp stepgen.0.enable 1
setp encoder.0.reset 1
setp stepgen.0.enable 1
I am not 100% sure how you set HAL pin values from inside code, but you could simply copy how halcmd does it:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...0aca31d;hb=HEAD#l691
Or, for that matter, shell out to halcmd.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I think is possibile to use encoder-ratio isn't it?
Ah, yes, well spotted. I had wondered what that was for!
Yes, you should be able to let that do most of the work.
Please Log in or Create an account to join the conversation.
if i use sum2 I have this error : stepgen.0.position-fb invalid for float
if try to open new thread on hal it close whit -1 error because unable to read thread
yes...
As always, the devil is in the detail.
Please Log in or Create an account to join the conversation.
if i use sum2 I have this error : stepgen.0.position-fb invalid for float
Hmm.
At times like this I head for "Documentation" at the top of the page, and from there to html, to this page: linuxcnc.org/docs/html/
Specifically, in this case linuxcnc.org/docs/html/man/man9/stepgen.9.html
And there we see that stepgen.N.position-fb is an output, and so is encoder.N.position. You can't connect together two outputs.
You might want to be using stepgen.N.position-cmd
Please Log in or Create an account to join the conversation.
I very much appreciate your guide ..
Please Log in or Create an account to join the conversation.
but now the problem is sum axis.0.motor-pos-cmd with encoder.0.position
my mistake to write .... problem is sum stepgen.N.position-cmd with encoder.0.position ..... encoder.0.position is out value and operation is not permitted ... there are other way to do these?
Please Log in or Create an account to join the conversation.