- Posts: 8
- Thank you received: 0
4 bit parallel ADC for spindle gear control
Has any one used a 4 bit parallel ADC to take the analogue signal 0 to 10v from the mesa board, and use the digital output to select required gear for example in a 16 speed gearbox .
Regards john
Please Log in to join the conversation.
Please Log in to join the conversation.
Thanks for the reply
The problem is how can I convert a spindle speed S into a 4 bit logic that will allow the correct gear ratio to be activated.
I thought the 0 to 10 volt spindle speed would be divided by the analogue to digital converter with a 4 bit signal , and with the truth table select the correct speed gear ratio clutches .
I have thought about this 16 speed problem for 4 years and without a solution within my limited ability.
At present I have started the conversion of a mazak lathe and have the axis homing on the encoder index.
The lathe conversion road looks fairly long ahead.
Best Regards john
Please Log in to join the conversation.
johnmc wrote: The problem is how can I convert a spindle speed S into a 4 bit logic that will allow the correct gear ratio to be activated.
I thought the 0 to 10 volt spindle speed would be divided by the analogue to digital converter with a 4 bit signal , and with the truth table select the correct speed gear ratio clutches .
I don't think that there is much point taking the digital speed signal in HAL out to the real world as an analogue signal, then converting it back to digital for further processing.
Does the lathe have a VFD or does it run a fixed speed in each gear?
I have a vaguely similar situation with my CNC lathe, albeit I have a VFD and only two speed ranges selected by electromagnetic clutch.
(I was going to post documentation links, but it looks like the main LinuxCNC.org web site is down at the moment)
One way to do what you want, though not a very elegant one, would be to use the HAL "lincurve" component. You could set up Lincurve to output a number based on spindle speed command. The number would be a binary representation of the combination of clutches required.
The reason that this is inelegant is that the output of Linucurve is floating-point, and converting to an integer format to extract the separate clutch signals might fall foul of rounding errors. Also it is not aware of spindle state, and will try to change gear any time the spindle speed command changes.
A better solution is probably a custom HAL component like the one I have for my lathe. Exactly what this would look like depends on how you want to control the spindle, whether gear-change with the spindle under load is allowed, whether gear change with the spindle spinning is allowed, etc.
The component will look like this (written in English rather than C)
make a set of params for the spindle speed ranges
make a set of params to define the clutch positions for each speed
;;
If the spindle is stopped, don't do anything
If the spindle speed command is less than threshold 1
Set the clutches for the lowest speed
Go into a waiting-for-stop state
If the spindle speed command is less than the second threshold
Set the clutches for the lowest speed
Go into a waiting-for-stop state
...
(Spindle Running, waiting for stop)
If the spindle speed < safe-to-change-gear speed
Go back to the top
The implementation on my lathe has a manual over-ride switch for situations where the spindle speed is set by the GUI. I only needed a 3-position switch for this (high, low, auto), your situation might be more interesting.
Please Log in to join the conversation.
Thanks for your considered reply.
Lathe has 16 fixed speeds with the clutches at present under 4 bit logic control, of the electro magnetic clutches,
gears are changed when the is no load.
Where is the information that will allow me to make use of a HAL component , to make to 16 discrete S words.
I wrote the plc for the old ANCA controller 20 years ago, with anca's own plc .
At 75 years young my reasoning is not that sharp.
If all else fails, a manual 16 position decoding switch may be the answer.
Thanks again
Cheers john
Please Log in to join the conversation.
If you are familiar with PLC programming then CL might be your preferred solution.
Unfortunately I can't get you links at the moment as the host appears to be down.
Please Log in to join the conversation.
- skunkworks
- Offline
- Platinum Member
-
- Posts: 351
- Thank you received: 0
(it was quite a few years ago)
electronicsam.com/images/KandT/conversio...fig/gearshift16.comp
Please Log in to join the conversation.
skunkworks wrote: I wrote a comp for our HMC - 4 bit binary 16 speed gear box. (it was my first comp so it is pretty scary
)
Aye, no offence, like, but that's pretty messy code.
I will try to knock-up a generic version this evening.
Please Log in to join the conversation.
- skunkworks
- Offline
- Platinum Member
-
- Posts: 351
- Thank you received: 0
I have not touched it since I got it working - it has been flawless.. (surprised the heck out of me..)
sam
andypugh wrote:
skunkworks wrote: I wrote a comp for our HMC - 4 bit binary 16 speed gear box. (it was my first comp so it is pretty scary
)
Aye, no offence, like, but that's pretty messy code.
I will try to knock-up a generic version this evening.
Please Log in to join the conversation.
Thanks for your 16 speed gearbox solution.
This method gives me much food for thought ,when using your KT mill do you program the G code with a set S speed
and the code automatically selects the nearest gear ratio.
Best Regards john
Please Log in to join the conversation.
