Adding a C6 Speed control board

More
04 Jul 2011 18:02 - 28 Dec 2015 23:18 #11151 by BigJohnT
CNC4PC has a C6 speed control board and the example shown on their web site is flawed.

To convert a 2 axis stepper lathe:


Add a 3th stepgen for controlling the spindle by modifiying your hal flie.
Type must be set to velocity as show in this example.

loadrt stepgen step_type=0,0,0 ctrl_type=p,p,v


Add a scale module for offset and scaling of the stepgen
Offset and scale are determined by first calculating and testing

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

setp scale.0.in 0
setp scale.0.gain 0.36
setp scale.0.offset 60.0
addf scale.0 servo-thread

# initialize the stepgen for the spindle
setp stepgen.2.position-scale 1
setp stepgen.2.maxvel 1300
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 20000
setp stepgen.2.dirsetup 20000
setp stepgen.2.maxaccel 200

# Enable
net spindle-enable <= motion.spindle-on => stepgen.2.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.2.velocity-cmd

# Connect output to the pin for the analog voltage of cnc4pc board
net spindle-out <= stepgen.4.step => parport.0.pin-14-out

# Control of spindle on/off (I1/I2 of KBIC speed controller over the
# relay instead of triac
net spindle-cw motion.spindle-forward => parport.0.pin-16-out

John
Last edit: 28 Dec 2015 23:18 by BigJohnT.

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

More
08 Jul 2011 17:46 - 08 Jul 2011 18:10 #11277 by willburrrr2003
IT"S WORKING, IT'S WORKING :woohoo: :woohoo:

Below (and attached too) is my Hal file for my now working and calibrated spindle speed control using the C6 speed control board, took a little playing to get itworking right, but was worth the effort ! Thanks for posting the above file, it along with the integrators manual and the folks on the IRC channel were a big help in not only getting it to work, but also mostly understanding what I did to make it work.

link to pic of C6 is : cnc4pc.com/images/C6R5A.jpg
link to c6 board's webpage: www.cnc4pc.com/Store/osc/product_info.php?products_id=58
The manual for the board is at the bottom of it's page.


Regards,

Will R. Everett, WA.


# willburrrr2003’s Hal file for CNC Mini-Lathe
# My config file for My Harbor Freight Mini-Lathe adding C6 speed board
# started with just 2-axis on my stepgen, and added the
# third one, with scaling feature for freq output
# I had to tweek my C6 adjustment pot, and my Scaling gain
# until my output voltage from the C6 was 4.35vdc
# (Which was the voltage measured across my speed
# pot) when I set speed (s1250) to max lathe speed
# and made sure that no speed settings above 1250 raised
# the C6 output voltage above the 4.35vdc, so I don’t
# fry my mini-lathe speed board.

loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out "
setp parport.0.reset-time 5000

#added the 3rd axis here for my my spindle, set to velocity mode
loadrt stepgen step_type=0,0,0 ctrl_type=p,p,v
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10

#load the scaling module to use on my spindle speed
loadrt scale count=1

#connect scale to servo clock thread
addf scale.0 servo-thread

#setup for scaling
setp scale.0.in 0
setp scale.0.gain 0.92 #final setting after several tweaks to C6 and gain
setp scale.0.offset 0.0 #no offset needed

#setup for stepgen to drive spindle
setp stepgen.2.position-scale 1
setp stepgen.2.maxvel 1250 #max RPM for my HF minilathe

# set steplen so it gives max frequency of 25khz
# (servo-thread/(steplen+stepspace)=maxfreq output)
# so for me was 1000000/40000=25khz with 25khz full speed for the C6
setp stepgen.2.steplen 40000
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 20000
setp stepgen.2.dirsetup 20000
setp stepgen.2.maxaccel 200 #set max acceleration for spindle

#enable stepgen for spindle, when EMC calls for spindle on
net spindle-enable <= motion.spindle-on stepgen.2.enable

#sends the speed request from EMC to scale module
net spindle-cmd motion.spindle-speed-out => scale.0.in

#sends scaled spindle speed to EMC and spindle stepgen for requested speed
net spindle-freq <= scale.0.out => stepgen.2.velocity-cmd

#Sends frequency out to parallel port pin 1 and to EMC
net spindle-out <= stepgen.2.step => parport.0.pin-01-out

#when spindle turned on send on signal to parallel port pin 14, which

#I used to drive C6 relay board for on off control
net spindle-enable => parport.0.pin-14-out


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 classicladder.0.refresh servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd <= motion.spindle-speed-out

net xdir => parport.0.pin-02-out
net xstep => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1
setp parport.0.pin-06-out-invert 1
net zdir => parport.0.pin-06-out
net zstep => parport.0.pin-07-out
setp parport.0.pin-07-out-reset 1


net min-z <= parport.0.pin-10-in
net max-home-z <= parport.0.pin-11-in
net max-home-x <= parport.0.pin-12-in


setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net max-home-x => axis.0.home-sw-in


setp stepgen.1.position-scale [AXIS_2]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.1.position-cmd
net zpos-fb stepgen.1.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.1.step
net zdir <= stepgen.1.dir
net zenable axis.2.amp-enable-out => stepgen.1.enable
net max-home-z => axis.2.home-sw-in



net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

# Load Classicladder with modbus master included (GUI must run for Modbus)
loadusr classicladder --modmaster custom.clp

:woohoo:
Last edit: 08 Jul 2011 18:10 by willburrrr2003.

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

More
17 Apr 2014 01:37 #45999 by comjon
Will,

I am trying to get my EMC2/C6 set up and finding few demonstrations or documentation where others have tried to do this. Some of the issues are basic to even attempting to supply power to the C6 board. I need to add a fuse bewtween the C6 and DC motor and am finding getting the fuse rating tricky :huh:

I'd consider sending the C6 back if I could find a well documented and straightforward example how I can add Gcode driven spindle speed control to my EMC2 Sherline. Is you C6 still performing correctly? Have you tried it on a 3 axis mill ?

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

More
17 Apr 2014 13:23 - 17 Apr 2014 13:24 #46020 by ArcEye

Some of the issues are basic to even attempting to supply power to the C6 board. I need to add a fuse bewtween the C6 and DC motor and am finding getting the fuse rating tricky :huh:


The question makes me suspect that you have misunderstood the use of speed boards like the C6.

They take a step pulse stream and convert it into a 0 - 10v output, the faster the pulses the higher the voltage.

They replace a potentiometer control with VFDs, DC speed controllers etc.

The notion of inserting a fuse between the board and DC motor, suggests you think it supplies power to the motor, it does not, just a low amperage signal voltage.

The output from the C6 board for a DC motor typically goes to whatever connections the current 'speed dial' uses, but you would have to be specific as to your machine to be precise.

regards
Last edit: 17 Apr 2014 13:24 by ArcEye.

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

More
19 Apr 2014 04:04 - 19 Apr 2014 04:09 #46095 by willburrrr2003

Will,

I am trying to get my EMC2/C6 set up and finding few demonstrations or documentation where others have tried to do this. Some of the issues are basic to even attempting to supply power to the C6 board. I need to add a fuse bewtween the C6 and DC motor and am finding getting the fuse rating tricky :huh:

I'd consider sending the C6 back if I could find a well documented and straightforward example how I can add Gcode driven spindle speed control to my EMC2 Sherline. Is you C6 still performing correctly? Have you tried it on a 3 axis mill ?



comjon,

Yes My C6 is still controlling my spindle on my lathe. it makes no difference how many axis you have on your machine, as long as your interface controller has the I/O for adding the spindle as an axis. With the C6 speed control board you can write code to run your spindle (start/stop, and speed control). As Arceye stated, it also seems to me that you misunderstand what the c6 speed control board is and how it works.

1) the C6 board does not hook directly to the motor .

2) the c6 board does replace the speed pot on your mini lathe

3) the c6 board does hook to the wires that were hooked to your speed pot

4) the c6 speed board has to hook to a power supply either 12vdc or 15-24vdc

5) the C6 speed controller needs two input signals from your cnc controller, step and dir

6) the C6 speed controller requires you to generate a frequency on the step pin

7) you need to modify your hal file to add the motor speed control

8) you need to use the relay on the C6 speed controller to kill power to the motor ( I replace the toggle switch on the lathe by tying the wires that were
connected to this switch to the relay on the c6.) this enabled me to turn my spindle on and off with linuxcnc.

9) you will need to adjust the output power (0-10vdc signal) to match the voltage you get when you measure across the speed pot.
for me it was 4.37 vdc. if you do not do this, you will fry your lathes speed controller.

10) you need to download and read the entire manual for the C6 card. cnc4pc.com/Tech_Docs/C6R6_User_Manual.pdf

I would happily offer advice as you go if you wish to continue with using the C6 speed controller, as it is a perfectly viable method of controlling your spindle.


Regards,

Will
Last edit: 19 Apr 2014 04:09 by willburrrr2003.

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

More
05 May 2014 07:37 #46597 by comjon
Thank you for your input. :)

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

More
05 May 2014 07:41 #46598 by comjon
I have a Spectralight mill center with a Minarik controller board, so I am following the diagram diagram for wiring the C6 provided by Arturo Duncan.

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

More
05 May 2014 07:59 #46599 by comjon
Will,

Thanks again for your input :) .

I can answer your list of questions from your last reply:

1) The Minarik board and solid state relay are in the circuit between the C6 and DC motor. The C6 is not wired to the DC motor directly.
2) My intent is to replace the pot with the C6, and as of now the pot is not wired in.
3) The C6 is wired into the Minarik board, and the potentiometer wires I *think* should be left out of the circuit.
4) I have 12vdc powering the C6 and have tested this successfully.
5) My C6 has an RJ45, and if I read the manual correctly, the STEP and DIRECTION will receive this signal from the ethernet card of the PC running LinuxCNC.
6) If I am correct, the step pin will receive this signal from the LinuxCNC PC and this will be configured in stepconf.
7) I have modified the HAL file. It throws and error, but I will double check it and deal with it later as necessary.
8) If I understand the manual, both RELAY 1 and 2 can be controlled through the RJ45 and ethernet cable from the PC.
9) I understand about adjusting the C6 pot. I checked out a video on Google from Hoss Machine . If only I could see the wiring up close :pinch:
10) Got the manual, thanks.

Thank you for your time. (IANAEE) I am not an electrical engineer only a hobbyist machinist hacker. :laugh:

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

More
05 May 2014 15:22 #46607 by cncbasher
the c6 only uses the rj45 as a suitable connector it is NOT ethernet ,
you need to wire the step and direction pins of the connector to your controller interface to the step and direction pins allocated to spindle

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

More
28 May 2014 09:24 #47433 by comjon
I have a Sherline Controller box through which I route my 25 pin serial output from my PC for 3 axis control. As I work through LinuxCNC StepConf and read other documentation, I am led to believe I should select a specific set of pins to wire into the C6 controller from this parallel cable communications. What I hope to do is use my A axis 5 pin DIN cable to supply the GND/STEP/RELAY1/RELAY2 inputs to my C6 board. Once I do this, the only remaining modification would be to the HAL file. Does anyone know if the is detailed documentation which specific A axis pins on the DIN go to the GND/STEP/RELAY1/RELAY2 (green/white. green, blue, brown) wires of the ethernet cable ?

Thanks.

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

Time to create page: 0.119 seconds
Powered by Kunena Forum