Spindle RPM

More
03 May 2021 23:31 #207768 by Jeff_in_Wa
Spindle RPM was created by Jeff_in_Wa
I am using gmoccapy for my UI
Spindle control is working in part. When I load a jobs gcode and start the job, the spindle goes to 6000 rpm even though the spindle command in the gcode is S12000 M3"

I can't override the speed in the UI, so I'm sure there is a min max component missing in one of the config files

Here is my vfd.hal content:

#loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600
# Replace ttyUSB0 with the address of your adapter

setp vfd.enable 1 # This enables the VFD in the driver

net spindle-speed spindle.0.speed-out => vfd.speed-command
net spindle-cw spindle.0.forward => vfd.spindle-forward
net spindle-ccw spindle.0.reverse => vfd.spindle-reverse
net spindle-on spindle.0.on => vfd.spindle-on
net spindle-speed-fb => vfd.spindle-speed-fb
net spindle-current <= vfd.OutA
net spindle-comm-ok <= vfd.hycomm-ok

net spindle-at-speed => vfd.spindle-at-speed
net spindle-at-speed <= spindle.0.at-speed

Here is my .ini config:

[EMC]
MACHINE = PrintNC
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = gmoccapy
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 3.0
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 3.0
DEFAULT_LINEAR_VELOCITY = 100.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 200.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 3
PROGRAM_PREFIX = /home/jeff/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
PYVCP = custompanel.xml

[KINS]
JOINTS = 4
#Joints is changed from 3 to 4. This will define the second motor that is used for the Y axis.
KINEMATICS = trivkins coordinates=XYYZ
#Kinematics is changed from XYZ to XYYZ. This will define the second motor that is used for the Y axis.

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .nc,.tap G-Code File
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
BASE_PERIOD = 50000
SERVO_PERIOD = 1000000

[HAL]
HALFILE = PrintNC.hal
HALFILE = custom.hal
HALFILE = vfd.hal
POSTGUI_HALFILE = custom_postgui.hal
POSTGUI_HALFILE = postgui_call_list.hal

Here is my machine.hal file content:

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0,0

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
#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-at-speed => spindle.0.at-speed

Here is my custom.postgui content:

net spindle-speed-fb <= gmoccapy.spindle_feedback_bar
net spindle-at-speed <= gmoccapy.spindle_at_speed_led

As far as the VFD, I have confirmed the min/max values are set properly. The max is set for 400hz.

Thanks a ton for the help

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

More
03 May 2021 23:52 #207770 by Jeff_in_Wa
Replied by Jeff_in_Wa on topic Spindle RPM
In continuing on with this UI, I think I have figured out that the 6000 is my min spindle speed. And that I need to override that with the slider in gmaccopy before starting the job.

Shouldn't the gcode decide what the spindle speed should be?

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

More
04 May 2021 00:52 #207775 by Michael
Replied by Michael on topic Spindle RPM
There should be a spindle min, max and scale in your ini file to control speed ranges

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

More
04 May 2021 01:05 - 04 May 2021 01:48 #207777 by BeagleBrainz
Replied by BeagleBrainz on topic Spindle RPM
Once again reading the docs has the answer.
The devs spend a lot of time on the docs.
Just recently I switched from axis to gmoccapy, rather than get caught out I printed out the gmoccapy section and read through it a few times before making any changes then referenced it as I went along. Without a good read of the docs how would you if something is a good idea and what extra features are available ? It’s amazing what you will find.

The MIN & MAX values are to set the values for the spindle bar.
If you set your spindle speed to 6000 rpm and then set the spindle to 12000 rpm the bar will show 6000 rpm in both cases but there should be a notable difference in actual speed.
It is only the bar level that is wrong not the actual spindle speed.
If the spindle is not responding to the commanded speed, this would require measuring with a tachometer, then that would be an issue external to the user interface.

Bottom of this page:
linuxcnc.org/docs/2.8/pdf/LinuxCNC_Documentation.pdf#page=200
Last edit: 04 May 2021 01:48 by BeagleBrainz.

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

More
04 May 2021 03:08 #207783 by Jeff_in_Wa
Replied by Jeff_in_Wa on topic Spindle RPM
Thank you BeagleBrainz...

I have been through the gmoccapy docs, comparing my settings and understanding what you said to be true.

What isn't true is when I start a job, the spindle was defaulting to the min 6000 rpms. I made a change to the .ini file by adding a missing line.
PREFERENCE_FILE_PATH = gmoccapy.preferences

I don't know how I missed it but it was in the doc so I added it

Now the gcode is starting at the right rpm. But if I click on the + to override the speed, the rpms drop to the min 6000 again.

In your description above, you are saying, if I override the speed to a higher speed, the rpm bar will show 6000 rpms. That it does. But it also drops the rpms back down. I don't need to have a tach to hear the speed difference.

If it is normal to see the rpm displayed back to the default min when I click on the + override, then I surely don't get what the override is for.

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

More
04 May 2021 03:24 #207786 by Jeff_in_Wa
Replied by Jeff_in_Wa on topic Spindle RPM
I found the issue. It was in gmoccapy settings in the ui. Appreciate you all.

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

Time to create page: 0.117 seconds
Powered by Kunena Forum