Lincurve

More
11 Mar 2022 15:59 #236941 by rider-83
Lincurve was created by rider-83
So, I'm having a little play around with 'Lincurve', and I've patched in a bit of sample code from else where and tried to adapt it into my .hal
I don't currently know how to connect it properly, and at the moment I see the error:   pwmgen.0.in does not exist.
I've probably made a complete mess of this, but if someone has got better experience with this, then help is very much appreciated.

(below is just a cutting from my sample .hal):

loadrt stepgen step_type=0,0,0,0
loadrt encoder num_chan=1
loadrt abs count=3
loadrt scale count=3
loadrt lowpass count=1
loadrt pwmgen output_type=1

loadrt near
addf stepgen.make-pulses base-thread
addf pwmgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread

#                         SPINDLE                          #
#THREE SENSOR ARRANGEMENT - WITH SCREW CUTTING
#PHASE 'A' / PHASE 'B' & STROBE PHASE 'Z'
addf abs.0 servo-thread 
addf scale.0 servo-thread 
addf lowpass.0 servo-thread 
 
net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= spindle.0.on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm

setp pwmgen.0.pwm-freq 50
setp pwmgen.0.scale 3000
#setp pwmgen.0.offset 0.0168831168831
#setp pwmgen.0.offset 0.0
#setp pwmgen.0.dither-pwm true

#################LINCURVE STUFF
loadrt lincurve personality=5

addf lincurve.0 servo-thread

setp lincurve.0.x-val-00 0
setp lincurve.0.y-val-00 0
setp lincurve.0.x-val-01 0
setp lincurve.0.y-val-01 100
setp lincurve.0.x-val-02 160
setp lincurve.0.y-val-02 750
setp lincurve.0.x-val-03 780
setp lincurve.0.y-val-03 1500
setp lincurve.0.x-val-04 2974
setp lincurve.0.y-val-04 3000

net spindle-raw motion.spindle-out => lincurve.0.in
net spindle-corrected lincurve.0.out => pwmgen.0.in
###################################

net spindle-cmd-rpm     <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps     <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs

net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse

setp encoder.0.position-scale 400

net spindle-position encoder.0.position => spindle.0.revs
net spindle-velocity-feedback-rps encoder.0.velocity => spindle.0.speed-in
net spindle-index-enable encoder.0.index-enable <=> spindle.0.index-enable
net spindle-phase-a encoder.0.phase-A <= parport.1.pin-10-in
net spindle-phase-b encoder.0.phase-B <= parport.1.pin-12-in
net spindle-index encoder.0.phase-Z <= parport.1.pin-11-in

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

More
12 Mar 2022 11:56 #236987 by rider-83
Replied by rider-83 on topic Lincurve
pwmgen.0.in does not exist.
Why ?

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

More
12 Mar 2022 12:56 - 12 Mar 2022 12:57 #236992 by MaHa
Replied by MaHa on topic Lincurve
I would try to replace
pwmgen.0.in

by
pwmgen.0.value
Last edit: 12 Mar 2022 12:57 by MaHa.

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

More
12 Mar 2022 14:42 #237002 by rider-83
Replied by rider-83 on topic Lincurve
Thank you.
There is no upto date information on this feature, and certainly no examples of simple usage.
I shall apply your suggestion and try to work out how all this works.

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

More
12 Mar 2022 20:13 #237017 by PCW
Replied by PCW on topic Lincurve
Did you look at the pwmgen manual page?

man pwmgen

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

More
13 Mar 2022 07:55 #237082 by rider-83
Replied by rider-83 on topic Lincurve
I did yes. I studied it repeatably, but I got even more frustrated.
Having said that I have managed to sort it out and get it to work, but there is a lack of up to date examples out there. Most of what I could find refers to earlier version of Lcnc and certainly no samples to look at that refer to parallel ports. It turns out to be very simple and logical to set up, but with out simple layman terms on how this work it becomes unnecessarily difficult to the point where it makes you want to just give up.
I'm going to post on here how I understand how to set it up in its simplest form for the benefit of others, but I think LinuxCNC needs some sort of current Idiots Guide on how to setup and importantly understand how the basic functions work, with real world examples, especially for Lathes not just routers & mills. With out the fantastic help from the forum community and experts such as your self (PCW) Lcnc would be a complete dead duck.

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

More
15 Mar 2022 00:53 #237278 by andypugh
Replied by andypugh on topic Lincurve
I don't think there has ever been a pwmgen.0.in pin, it has always been "value". So this isn't a LinuxCNC version problem.

Which example were you copying?

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

More
15 Mar 2022 06:20 #237292 by rider-83
Replied by rider-83 on topic Lincurve

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

More
15 Mar 2022 08:45 #237308 by andypugh
Replied by andypugh on topic Lincurve

Its in the Lincurve post here:

forum.linuxcnc.org/10-advanced-configura...m-output-for-spindle

As I feared, that one is my fault. I write a lot of my replies during the lunch break at work when I don't have access to a LinuxCNC machine, and so the HAL pin names are from memory. It looks like I remembered wrong in that case.
 
The following user(s) said Thank You: tommylight

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

More
19 Mar 2022 13:00 #237714 by rider-83
Replied by rider-83 on topic Lincurve
When I run the spindle CCW (M4) the PWM signal has dissapeared.
Is this because the Lincurve values are + ?

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

Time to create page: 0.159 seconds
Powered by Kunena Forum