Passing a speed value to an interface card
flood on/off => output from LinuxCNC
spindle on/off => output from LinuxCNC
Estop <= Input to LinuxCNC
I was thinking about calling a custom M1xx code to do this:
Pass value from part file to Mcode
re-purpose the Estop as an acknowledge input
use flood as 1 bit data and spindle as clock
clock out the "value" for the speed, waiting for an ACK between each bit
when done, fix Estop back to Estop function
Return from Mcode.
I can do most of this, but I have a few questions. (imagine!!!)
1) how would I shift the value to determine flood bit value?
2) how do I "wait" for the ACK before clocking the next bit?
3) Better ideas are MOST welcome!!
I do not have to have the built in spindle function working, but it would be a plus. Basically I want to be able to transmit a speed, then turn it on and off back in the main program.
But I think for now, I will use m64/65 along with m66 for the ack.
So the new question is this: is there a way to pass a value 0-100 or 0-255, doesn't matter, to my already existing tool change Ocode, then convert that to my bit banging? Now I know I can pass a value, and I realize this way does not allow me to play with the spindle overide, but that is fine. I have been running CNC machine for 15 years now, and I can count on 1 hand the number of times I needed to adjust the speed during a cut. Mind you I do play with the feed to get it right at times.
I read something about select8. Is this the direction I should look?
I would like to for now just do this in g-code with m64/65, but short of running a loop the number of times to equal the speed, I am lost. Seems rather silly if the speed is 250, to run a loop 250 times when I should be able to loop 8 times.
I'm back again with this same issue. Is there an easy way ( meaning not using comp) to get the 8 bits of a byte to send out?
I thought there was a component for that, but I didn't find it just now looking at the components listed near the bottom of linuxcnc.org/docview/html/
The inverse exists (though it is called "weighted sum" rather than what one might expect).
I can see an argument for the conv32_bit component having an option of having more that 1 bit output
Is there a good reason not to use a PWM? It wastes a lot fewer pins.
So as you may be aware, R/C signals are not just simple PWM as such. While they can be closer then 20mS between pulses, typically they are not. This is why the complicated solution to a simple problem. As it is now, I can turn the spindle on and off, but of course the on speed is hard coded.
If you remember back, I was working on a control card that would talk to LinuxCNC instead of just bit-banging, I still want to acheive this. But time is pressing and I need to finish this before I am allowed to complete that effort.
Main program has this:
O<speed.ngc> P200 call // This is supposed to call a sub called speed and pass it a value in this case 200
then speed.ngc would look like this:
M65 paraport.0.pin14 true // I am not at all sure of the correct format here
M66 paraport.0.pin15 true // Same delima about format
M65 paraport.0.pin 14 false
M66 again // Of course this is all just some VERY basic hand shaking.
#1 = #1 - 1
I think this whole thing is wrong, but it gets my idea across. Does it make sense and where can I find the correct format for the M64/65/66? I have read what I can find about them, but the Docs simply seem to say they operate on dig 0-4. well what is dig 0-4? where is it defined and how do I assign them to PP pins?
I have read what I can find about them, but the Docs simply seem to say they operate on dig 0-4. well what is dig 0-4? where is it defined and how do I assign them to PP pins?
Yes, the docs leave out a really important bit of information. It is actually hidden here:
M62-M65 change the value of the motion.digital-out-NN pins in HAL.
So, you net those pins to parport pins in HAL