New to me CNC toy mill - Taig
- Mike_Eitel
- Offline
- Platinum Member
Less
More
- Posts: 1150
- Thank you received: 184
24 Mar 2019 09:34 #129460
by Mike_Eitel
Replied by Mike_Eitel on topic New to me CNC toy mill - Taig
Maybe somebody else can chime in.
I wonder if this can be archived in hal around siggen module??
I wonder if this can be archived in hal around siggen module??
Please Log in or Create an account to join the conversation.
24 Mar 2019 09:59 #129462
by Vinito
Replied by Vinito on topic New to me CNC toy mill - Taig
Holy cow and doggammit!
Apparently it can be done in German.
Foiled again!
Apparently it can be done in German.
Foiled again!
Please Log in or Create an account to join the conversation.
24 Mar 2019 16:32 #129489
by pl7i92
Replied by pl7i92 on topic New to me CNC toy mill - Taig
yes German is a Great Language to do Servo Tuning
Here is also a tread that Face this kind of problem
forum.linuxcnc.org/30-cnc-machines/28187...g-a-dc-brushed-motor
Here is also a tread that Face this kind of problem
forum.linuxcnc.org/30-cnc-machines/28187...g-a-dc-brushed-motor
Please Log in or Create an account to join the conversation.
24 Mar 2019 16:46 - 24 Mar 2019 18:25 #129491
by Vinito
I give up.
edit to add:
OK maybe not. If I just keep ignoring suggestions to purchase hardware that uses 1) reference voltage or 2) PWM rather than 3) step/dir signal with my already owned and verified working hardware, I might prevail.
I have been reading up a bit on HAL and studying my own stepconf generated file, and I physically felt some new understanding happening in my brain. I guess I haven't tried to learn anything new in too long, hehe.
I don't know if I'll eventually get it actually working or not, but I think I'm beginning to understand some pieces of the puzzle anyway.
In short (and I'm sure you veterans already know this) I evidently need to set up a new axis to work with step/direction and shuffle around a bit of code so it will be in the correct mode and obey spindle g-code commands. Easy to say I guess.
Replied by Vinito on topic New to me CNC toy mill - Taig
I give up.
edit to add:
OK maybe not. If I just keep ignoring suggestions to purchase hardware that uses 1) reference voltage or 2) PWM rather than 3) step/dir signal with my already owned and verified working hardware, I might prevail.
I have been reading up a bit on HAL and studying my own stepconf generated file, and I physically felt some new understanding happening in my brain. I guess I haven't tried to learn anything new in too long, hehe.
I don't know if I'll eventually get it actually working or not, but I think I'm beginning to understand some pieces of the puzzle anyway.
In short (and I'm sure you veterans already know this) I evidently need to set up a new axis to work with step/direction and shuffle around a bit of code so it will be in the correct mode and obey spindle g-code commands. Easy to say I guess.
Last edit: 24 Mar 2019 18:25 by Vinito.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19203
- Thank you received: 6437
24 Mar 2019 19:11 #129501
by tommylight
Replied by tommylight on topic New to me CNC toy mill - Taig
Well you can also have Linuxcnc output velocity pulse/dir, not just position.evidently need to set up a new axis to work with step/direction and shuffle around a bit of code so it will be in the correct mode and obey spindle g-code commands. Easy to say I guess.
Please Log in or Create an account to join the conversation.
24 Mar 2019 20:20 - 24 Mar 2019 20:26 #129515
by Vinito
Replied by Vinito on topic New to me CNC toy mill - Taig
Thanks.
I saw this post and have been trying to follow it:
Link
I've tried pasting and editing but what I've done doesn't work yet - I get errors so it won't start up.
I could try attaching what I've got if anybody was interested in taking a look.
I assume I just need to customize the main hal and the main ini file. Is that right or is there more?
Is there a place I could look to study up on velocity pulse/dir output configuration? I've been trying to find stuff in the documentation but so far it's either 1) so vast I can't find it or 2) vague and not explained such that I don't understand it. One problem I have when looking at the documentation is that the syntax which should be verbatim and the stuff which varies per specific configuration all looks the same to me and I don't know what I need to edit vs. what needs to be pasted as-is.
Anyway, I get an idea that I need to configure for a velocity type of output but don't know quite how to do that I guess.
I will try to figure this out but it's hard to know where to start. A systematic approach would be wise I'm sure, but so far it's been just jumping around here and there.
Should I:
First edit the .ini to suit my machine then...
configure for step type (i.e. velocity) somewhere then...
do I really need a scale module (as per the advice in the linked post)...
do I need to activate a relay (as per the advice in the linked post)... (I suspect not)
Any helpful nudges are appreciated. Feel free to feed me baby steps rather than tackling this all in one whack. I'm in no burning rush - as long as I can make some steady progress I'd be thrilled.
The attached .ini and .hal files will successfully control the motor/driver I've got via a-axis commands (I just set it up like a standard rotary 4th axis to test function) - this is just the stock files generated via stepconf to keep things uncomplicated to start with .I've physically connected the step and direction outputs to parallel port pins 16 and 17 respectively.
I named the configuration "4_axis"
I saw this post and have been trying to follow it:
Link
I've tried pasting and editing but what I've done doesn't work yet - I get errors so it won't start up.
I could try attaching what I've got if anybody was interested in taking a look.
I assume I just need to customize the main hal and the main ini file. Is that right or is there more?
Is there a place I could look to study up on velocity pulse/dir output configuration? I've been trying to find stuff in the documentation but so far it's either 1) so vast I can't find it or 2) vague and not explained such that I don't understand it. One problem I have when looking at the documentation is that the syntax which should be verbatim and the stuff which varies per specific configuration all looks the same to me and I don't know what I need to edit vs. what needs to be pasted as-is.
Anyway, I get an idea that I need to configure for a velocity type of output but don't know quite how to do that I guess.
I will try to figure this out but it's hard to know where to start. A systematic approach would be wise I'm sure, but so far it's been just jumping around here and there.
Should I:
First edit the .ini to suit my machine then...
configure for step type (i.e. velocity) somewhere then...
do I really need a scale module (as per the advice in the linked post)...
do I need to activate a relay (as per the advice in the linked post)... (I suspect not)
Any helpful nudges are appreciated. Feel free to feed me baby steps rather than tackling this all in one whack. I'm in no burning rush - as long as I can make some steady progress I'd be thrilled.
The attached .ini and .hal files will successfully control the motor/driver I've got via a-axis commands (I just set it up like a standard rotary 4th axis to test function) - this is just the stock files generated via stepconf to keep things uncomplicated to start with .I've physically connected the step and direction outputs to parallel port pins 16 and 17 respectively.
I named the configuration "4_axis"
Last edit: 24 Mar 2019 20:26 by Vinito.
Please Log in or Create an account to join the conversation.
24 Mar 2019 21:46 - 24 Mar 2019 21:47 #129524
by PCW
Replied by PCW on topic New to me CNC toy mill - Taig
A couple things:
1. This is not a 4 axis configuration (a spindle is not an axis)
2. Since stepconf does not have a spindle step/dir option its probably best
to create a hal/ini file set using a PWM spindle so the ini/hal spindle boilerplate is there
and then change the PWM output to step/dir (which is pretty straightforward)
1. This is not a 4 axis configuration (a spindle is not an axis)
2. Since stepconf does not have a spindle step/dir option its probably best
to create a hal/ini file set using a PWM spindle so the ini/hal spindle boilerplate is there
and then change the PWM output to step/dir (which is pretty straightforward)
Last edit: 24 Mar 2019 21:47 by PCW.
Please Log in or Create an account to join the conversation.
24 Mar 2019 21:58 #129526
by Vinito
Replied by Vinito on topic New to me CNC toy mill - Taig
Ahhh!. That totally makes sense! Appreciate the tip.
I'll go do another stepconf PWM setup and try that. I can maybe compare that to the other one for a few hints, especially while comparing those to the other snippets I've been able to find.
Been reading up on how HAL works and I'm kinda starting to scratch the surface on how it goes together. Got a ways to go, but...
Thanks again. That feels more "eureka" to me than you think.
I'll go do another stepconf PWM setup and try that. I can maybe compare that to the other one for a few hints, especially while comparing those to the other snippets I've been able to find.
Been reading up on how HAL works and I'm kinda starting to scratch the surface on how it goes together. Got a ways to go, but...
Thanks again. That feels more "eureka" to me than you think.
Please Log in or Create an account to join the conversation.
24 Mar 2019 23:40 - 24 Mar 2019 23:42 #129535
by Vinito
Replied by Vinito on topic New to me CNC toy mill - Taig
If anybody feels generous enough to help me take another step or two it is greatly appreciated. I'll buy you a beer!
I generated a pwm spindle .hal file. The new generated .ini file doesn't appear to refer to anything about spindle stuff, so apparently I can ignore that and focus only on configuring .hal. Let me know if I'm mistaken.
I've attached two files.
3S.hal is the unmolested stock generated .hal file and 3Sedit.hal I'm calling the "working copy".
I deleted lines 9,13 & 21 as it seemed appropriate.
I've marked lines 23-25, 47 & 48 with a + sign as I see they obviously need editing
and I've marked lines 26-29 with a triple ### which I suspect can be deleted (I might be incorrect about that and they rather may need editing instead).
I'm guessing I likely need additional tidbits too.
The only change I made which I halfway feel confident about is line #8 which I edited to add one additional stepgen channel and set the ctrl_type on the spindle channel to v (velocity).
I read a pertinent post which mentioned using a "scale module" for offsetting and scaling of the stepgen. I'm not sure what that is or does, but will post what he wrote if you feel inclined to explain to me where he's going with that. The actual values will likely be different and determined by calculation and testing later.
Actually I'll just post his entire suggested code outline here (obviously my machine will be different, possibly by a lot):
Thanks a muchly for any help!
I generated a pwm spindle .hal file. The new generated .ini file doesn't appear to refer to anything about spindle stuff, so apparently I can ignore that and focus only on configuring .hal. Let me know if I'm mistaken.
I've attached two files.
3S.hal is the unmolested stock generated .hal file and 3Sedit.hal I'm calling the "working copy".
I deleted lines 9,13 & 21 as it seemed appropriate.
I've marked lines 23-25, 47 & 48 with a + sign as I see they obviously need editing
and I've marked lines 26-29 with a triple ### which I suspect can be deleted (I might be incorrect about that and they rather may need editing instead).
I'm guessing I likely need additional tidbits too.
The only change I made which I halfway feel confident about is line #8 which I edited to add one additional stepgen channel and set the ctrl_type on the spindle channel to v (velocity).
I read a pertinent post which mentioned using a "scale module" for offsetting and scaling of the stepgen. I'm not sure what that is or does, but will post what he wrote if you feel inclined to explain to me where he's going with that. The actual values will likely be different and determined by calculation and testing later.
Actually I'll just post his entire suggested code outline here (obviously my machine will be different, possibly by a lot):
Thanks a muchly for any help!
#################################################################
# 5th stepgen for controlling the spindle.
# Type must be set to velocity
# Stepgens must be declared to match the ini declarations
# even if not used, hence there is
# one for Y even though it does not exist
#################################################################
loadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v
addf stepgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf stepgen.update-freq servo-thread
####################################################################
# This section enables the DIYCNC Spindle2 board to produce
# 0-10v scaled upon steps from axis4 and direction of
# rotation from Dir signal
####################################################################
# Use a scale module for offset and scaling of the stepgen
# Offset and scale are determined by first calculating and testing
#
setp scale.0.in 0
setp scale.0.gain 1.26 # GIVES TRUE 600 RPM in M4
setp scale.0.offset 0
addf scale.0 servo-thread
#
# Initialise the stepgen for the spindle
#
setp stepgen.4.position-scale 1
setp stepgen.4.maxvel 2400
setp stepgen.4.steplen 1
setp stepgen.4.stepspace 0
setp stepgen.4.dirhold 20000
setp stepgen.4.dirsetup 20000
setp stepgen.4.maxaccel 200
# Enable it
net spindle-enable <= motion.spindle-on => stepgen.4.enable
# Connect spindle speed to scaler
net spindle-cmd motion.spindle-speed-out => scale.0.in
# Connect scaler output to stepgen velocity
net spindle-freq <= scale.0.out => stepgen.4.velocity-cmd
# Connect output to the pin for the analog voltage of spindle2 board
net spindle-out <= stepgen.4.step => parport.0.pin-09-out
# Activate relay to power spindle GEC controller
net spindle-enable => parport.0.pin-16-out
## Connect DIR pin to inverted DIR signal from stepgen.4 which gives correct relay switching for CCW and CW
setp parport.0.pin-08-out-invert 1
# Some problems setting up logic to match the reversing contactor
## This works, connecting CCW to stepgen DIR to Spindle2 DIR
net spindle-ccw <= stepgen.4.dir => parport.0.pin-08-out
Attachments:
Last edit: 24 Mar 2019 23:42 by Vinito.
Please Log in or Create an account to join the conversation.
25 Mar 2019 04:57 #129556
by Vinito
Replied by Vinito on topic New to me CNC toy mill - Taig
Bahh!.
Maybe I'm just tired and burned out, but I kinda feel like giving up and selling the machine off at the moment.
No matter what I edit in the hal file, once I paste the file into its directory and try to start LinuxCNC, it doesn't start but pops up the error window instead.
I wish there was a systematic way to work this out. The documentation jerks me from one location to another and any examples I find only give hints added to a ton of unrelated lines of code and I can't determine between the hints and the rest.
I need a course in HAL, like start from the top and work my way through to a basic working configuration learning what the hell the stuff actually means. Maybe I'd know something by now.
Tonight, what I know is a bunch of disconnected fragments that don't fit together.
Anybody want to buy a toy mill?
Maybe I'm just tired and burned out, but I kinda feel like giving up and selling the machine off at the moment.
No matter what I edit in the hal file, once I paste the file into its directory and try to start LinuxCNC, it doesn't start but pops up the error window instead.
I wish there was a systematic way to work this out. The documentation jerks me from one location to another and any examples I find only give hints added to a ton of unrelated lines of code and I can't determine between the hints and the rest.
I need a course in HAL, like start from the top and work my way through to a basic working configuration learning what the hell the stuff actually means. Maybe I'd know something by now.
Tonight, what I know is a bunch of disconnected fragments that don't fit together.
Anybody want to buy a toy mill?
Please Log in or Create an account to join the conversation.
Moderators: cncbasher
Time to create page: 0.110 seconds