PDA

View Full Version : Triac PC Linuxcnc



JohnT
19-01-2021, 12:49 PM
Hello, said id throw up my project to document and try get some help.

it was built in 98 and its partially stripped to check the ball screws and condition. My Plan is to use the existing hardware, drivers, spindle controller and run it from a Linuxcnc PC.

This is the Chinese BOB iv ordered. Seems to have a 0-10v output for the spindle.
https://www.aliexpress.com/item/32988486511.html?spm=a2g0s.9042311.0.0.62b94c4dSy2 CSf

The circuit diagram below if i understand correctly. The drives output a 12v step and dir. The step and Dir is connected to the collector from the transistor and the emitter to ground. The 5v output from the BOB is connected to a 2k resistor and connected to the Base. When ever the BOB pulses the 5v it pulls 12v from the driver to ground?
29401

29402

29403

29405

29404

29406
[

Doddy
19-01-2021, 06:29 PM
The circuit diagram below if i understand correctly. The drives output a 12v step and dir. The step and Dir is connected to the collector from the transistor and the emitter to ground. The 5v output from the BOB is connected to a 2k resistor and connected to the Base. When ever the BOB pulses the 5v it pulls 12v from the driver to ground?


That circuit - if the BoB is outputting 5V, it will let the input to the stepper driver float to 12V as reported. If the BoB output is 0V then the input to the stepper driver will be dragged to 0V.

You draw the BoB with an output transistor - as shown this inverts the 'step' signal from the BoB - is this your intent?

JohnT
19-01-2021, 07:17 PM
Iv ordered Bc547c transistors , I'm trying to figure out how to connect up that circuit in the diagram. Am I correct above ? That diagram I found on the net isnt mine.

JohnT
19-01-2021, 08:06 PM
this is another diagram I found on the net
29407

JohnT
19-01-2021, 08:12 PM
These sketches are not my own, im trying to figure out what they do. Am i correct with the above explanation? Once 5v is active the Step or Dir inputs 12v go to ground activating the steppers ?

Doddy
19-01-2021, 09:42 PM
Your first schematic confuses me a little - because you show one transistor on the BoB and one on the machine. If the one on the BoB is intended to represent the output stage of the BoB (fairly common thing to do) - the problem is that it's not likely to represent the actual output stage of the cheap Chinese BoB (they use push-pull outputs rather than open collector) - the net result of this is I wouldnt recommend that diagram (I apologies - the earlier answer answered against the schematic, but I don't think the schematic represents quite what you're likely to achieve with the BoB).

The second schematic ("this is another diagram I found on the net") makes no assumption or assertion about the implementation or design of the output stage of the BoB, but instead just shows that (5V TTL...) driving a transistor. Two signals - Step/DIr, each with their own base resistor and transistor. That circuit implements the open-collector drive as shown in the BoB on the earlier diagram. This second schematic is "better".

The behaviour is, as the input (5V TTL) rises "high" (5V) then the transistor conducts, and the voltage on the collector ("12V from motherboard") will be shunted to ground. So, 5V in = 0V out.

When the input (5V TTL) drops "low" (0V) then the transistor stops conducting, and the collector->emitter is high resistance, and the 12V from the ("12V from motherboard") remains unaffected.

So 5V in = 0V out; 0V in = 12V out.

Note, and this is important if you don't want to blow the transistors up. The "12V from motherboard" I expect is either the Step or Dir input to the existing stepper driver - it's not connected directly to 12V, but rather through an internal resistor on the stepper driver to 12V. It's that resistor that presents the voltage drop when the transistor is conducting. So don't connect the circuit to a 12V supply, but do connect it to a Step/Dir input (... that might read 12V on a meter).

Just to demonstrate (a picture is worth a thousand words), I've sketched out your schematic in a circuit simulator (LTSpice)...

29408

The circles - the one on the left in the "BoB" is a 5V voltage source, that starts at 0V and spikes to 5V after 1 second, then returns to 0V....

The one on the right represents the machine's 12V supply. The resistor is the aforementioned internal resistor.

Simulating this for 5 seconds gives the following waveform...

29409

The lower, green trace is the 5v signal from the BoB. The upper blue trace is the resulting voltage measured on the input to the Stepper driver.

JohnT
19-01-2021, 10:26 PM
ok thank you very much for the reply. still waiting for my parts to come. once they come i will try this diagram. i will keep this updated.

JohnT
18-06-2022, 06:19 PM
Ok so I managed to get control of the axis with Linuxcnc and parallel card. The next thing is figuring out these balluff 2 wire numar sensors. these don't switch on or off like a normal switch. They seem to change the resistance inside the sensor. Something quite sensitive like a 200ma difference.

Question is how can I measure the change in current so I can switch a pin on something like an Arduino?

I know people don't bother with these and switch them out for normal sensors. But I'd like to try and get these working.

Doddy
19-06-2022, 08:43 AM
Without data sheet (I've googled for 5 minutes and given up to watch the F1 qualifying instead) - and without knowing the sensor supply voltage range, but assuming it's good for 12-24V, I'd suggest buying an opto-isolator (maybe mounted on a board)... or 3 (however many sensors you have) and, with suitable current limiting resistor for the supply voltage, wire the input in series with the sensor. From the little I've gleaned of the internet these. devices have an activated current of <1mA and a de-activated current of what you say - 200mA? Provided the 1mA is insufficient to transfer through the opto-isolator then it's an easy solution.

You question use of an Arduino... yes, you could, but it's a sledgehammer solution, plus you have to think about your power-up behaviour before IO is configured. For the Arduino the obvious solution is to use an analogue input to measure the voltage across the sensor with a current-limiting resistor in series with the supply voltage to the sensor. You would have a simple threshold (with hysteresis?) measuring software to drive the digital output,

Beyond that, you could use a comparator circuit - op-amp, preset-pot and, again, series resistor on the sensor, monitor the voltage across the sensor (nee the voltage drop across the series-limiting resistor).

Loads of different ways, just need to think about what suits your experience and equipment.

My 'can't-be-arsed-making-this-into-a-project' solution would start with a cheap opto-isolator board, checking that the board has mounting holes. (so many small boards omit these!),

More complex solutions (and the real high-integrity solutions) would likely have multiple comparators and logic to detect nominal current levels, fail-open and fail-short faults. Easy to do but heading into 'project' mode.

JohnT
19-06-2022, 10:22 AM
Thank for the lengthy reply. Would one of these comparators work?

https://a.aliexpress.com/_vFHhhU
I have the data sheet for the sensor but can't upload it. It's 24v supply

Load capacitance max. at Ue1 µF Min.
operating current Im0 mA
No-load current Io max., damped5 mA
No-load current Io max., undamped2 mA
Operating voltage Ub10...30 VDC
Output resistance Ra33.0 kOhm + D Protection classII Rated insulation voltage Ui250 V AC
Rated operating current Ie200 mA
Rated operating voltage Ue DC24 V
Rated short circuit current100 A
Ready delay tv max.21 ms

Doddy
19-06-2022, 11:13 AM
Certainly can be made to work, however, bear in mind the switching time for the relay(s) - guessing in the order of 5-10ms (I'll let you do the math on that). Place a series resistor in line with the +supply of the sensor, ground-to-ground. That gives you a monitor point at the supply terminal of the sensor that is the input into the comparator. Choose the 24V flavour of the comparator board and it's all pretty straight forward. The choice of series resistor needs a little consideration - I'd start with a 100R - if (my assumption) the sensor is a switched constant current sink of 1mA / 200mA then that would give a switching voltage swing of 23.9V down to 4V at the sensor supply line.

It's a bit of a sledgehammer solution but it provides all the function that you need in a very handy prebuilt module. If it's affordable to you then it's a valid solution.

JohnT
20-06-2022, 11:19 AM
Great checked those sensors this morning. They are feed by 12v. If there is no metal near the sensor, it's at about ,8.5v. when metal is near it, it's at about 10.5-11v

JohnT
20-06-2022, 09:25 PM
Axis control with Linuxcnc


https://youtu.be/9UANH070kZI

JohnT
25-06-2022, 05:05 PM
Waiting on some parts to come to tackle the homing sensors.
I need a bit of help with the Spindle. I have the spindle working by grounding the SGR relay and hooking up a 9v battery (it's at about 4v) and it's spinning fine. My issue the spindle control board is not isolated.

I have the BOB feed with the machine cabinets 24v power. On the Bob it has a 0-10v opto isolated output for spindles. I'm afraid to connect this incase I blow something. Would changing the power feed to the Bob from separate transformer power supply isolate it ? The BOB I have is the same as below.

MACH3V2.1
https://a.aliexpress.com/_uzGXvi

Doddy
27-06-2022, 07:46 AM
John, I've looked at the link to that board and I can't work it out - but it looks probable (PCB underside image) that the 0V reference for the 0-10V analogue output is common with the other 0V references on the board. In that case - I understand your concern with effectively raising the 0V reference to some hundreds of volts that the Spindle Controller operates. If that 0V cannot be isolated (between the logic and the analogue output) then, yes, you have a problem. I understand your argument of adding an isolation transformer to allow the 0V rail to be raised to that of the spindle-controller, but - of course - at that point you're raising the common 0v reference, back to the logic supply and ergo the short-circuit hazard remains at the point that you connect to another system - the connecting PC. It crossed my mind whether you could do the opposite and provide an isolation transformer (1:1) to the supply to the spindle controller, but you would wonder if there's any internal bonding of earths to line neutral anywhere on the spindle controller - either direct or indirect through EMF caps. Considerable care is needed going in this direction.

These https://www.amazon.co.uk/Isolation-Quantities-Voltage-S-10V10V-voltage/dp/B082NXR4PR look interesting and useful. I've no experience of them, but understand the description rather better than the BOB.

JohnT
27-06-2022, 07:57 AM
Thanks Doody. Yes I checked with a multimeter and the Bob shares it's grounds. I was looking at those isolation boards. I checked the motor controller and measured the 0-10v terminals against each other and to machine ground. I'm getting 270v DC and 9v AC with the multimeter. I don't have an oscilloscope. I'm leaning towards ordering one of those isolation boards. But if it doesn't work I could blow the motor controller etc. I'm thinking feeding one end of the isolation board to the 0-10v terminals on the motor controller and the other end to the 0-10v output on the Bob. Use a transformer power supply to feed the vcc and ground. Or else not risk it and let linuxcnc control the SGR relay and use a potentiometer to control the speed.

Doddy
27-06-2022, 08:37 AM
Thanks Doody. Yes I checked with a multimeter and the Bob shares it's grounds. I was looking at those isolation boards. I checked the motor controller and measured the 0-10v terminals against each other and to machine ground. I'm getting 270v DC and 9v AC with the multimeter. I don't have an oscilloscope. I'm leaning towards ordering one of those isolation boards. But if it doesn't work I could blow the motor controller etc. I'm thinking feeding one end of the isolation board to the 0-10v terminals on the motor controller and the other end to the 0-10v output on the Bob. Use a transformer power supply to feed the vcc and ground. Or else not risk it and let linuxcnc control the SGR relay and use a potentiometer to control the speed.

From what I squinted at with that particular board the circuitry was visible separate from the LV and HV sides. You’d supply the LV from the general machine supplies and the HV from the reference voltage provided by (most) spindle controllers (is these that you’d otherwise write a speed control pot to). It’s low risk and you can test with a meter easily. I wouldn’t have much fear of going this route.

JohnT
27-06-2022, 10:59 AM
I'll order one and give it a try. I'll hook up 24v from the machine cabinets PSU. And the 0-10v from the Bob to input 1.(LV side). For the HV side, it looks like the terminal for 0-10v connects to the output 1. The power and ground come from another isolated power source?

Doddy
27-06-2022, 01:11 PM
I'll order one and give it a try. I'll hook up 24v from the machine cabinets PSU. And the 0-10v from the Bob to input 1.(LV side). For the HV side, it looks like the terminal for 0-10v connects to the output 1. The power and ground come from another isolated power source?

If you was to write a pot on the spindle controller, you should have 3 pins on the spindle controller to attach to, what are those? Likely a good candidate for the HV supply side (and the pot input)

Sorry, reading on phone during demo at work, can’t review the full thread here. What is the spindle controller model?

JohnT
27-06-2022, 01:24 PM
I'm suppose to be working aswell lol. It's a sprint 1200 v1.2. there are two terminals for the 0-10v signal. One been the signal and the other ground I'd imagine.

31112
31113

Doddy
27-06-2022, 10:04 PM
I'm suppose to be working aswell lol. It's a sprint 1200 v1.2. there are two terminals for the 0-10v signal. One been the signal and the other ground I'd imagine.


The copy of the manual I found online suggest pin 61 is a +12V (10mA max) regulated supply. Check that is +12V wrt the common rail (99.9% convinced it will be) then use that +12/Com as the HV supply to the isolated 0-10V control. Double check when operating that you still have 12V on the HV supply (i.e. it's not being dragged down by excessive load), and check the HV output is ranged 0..10, and then when confident connect to the Pin-3 analogue input.

I'll pm the address to send the hobnob :)

JohnT
28-06-2022, 07:30 AM
Thanks for the help doody, ordered the parts. I'll give it a try once the isolation board comes.

JohnT
08-07-2022, 01:19 AM
Got the board in the mail today. Wired it up works away fine :) I'm getting 8.5v max with 10v imputed. I'll play away with it a bit more and see can I get it closer to 10v on the output. Waiting on more bits from China to tackle those homing sensors. Thanks again Doody.


https://youtube.com/shorts/gTI93IFkSJ4?feature=share

Doddy
08-07-2022, 07:32 AM
John,

You've peaked my interest. 0-8.5V... On the image of the isolation 0-10V board that I'd linked on Amazon - noting you could have ordered a different device, or the device delivered may well differ from the images... that withstanding, the image shows the PCB with a number of devices on the board. There's the LV side, and the HV side of the board. Behind the terminals on each side there's a large 3-pin TO220 device (big blob of black plastic, 3 pins to the board, and a metal tab on the arse-end for bolting to a heatsink if required. I'm guessing - and it is a guess - that these are series regulators. Could you check for a part number on the front face of these for both LV and HV sections. There's usually a couple of numbers at play - the lower one typically a date code, and the upper one typically the device part number. I'm guessing this may be of the form "LM7809". That number could help determine the options for adapting the output voltage swing. Also of interest - there's a 8-pin surface-mount device on the HV side (and another on the LV side) - the part number for that would also be of interest. Finally, there's a device straddling the LV/HV sections - looks like a 8-pin Opto-Isolator but could be something a little different - if that's not obscured by a QC sticker, then that part number is also interesting.

I'm wondering, if you currently have a 0-8.5V output, would that be better for you as 1.5-10V? (i.e. with a 1.5V offset) - to remove the very low speed control and give higher top-speed control?

There may be (and I've not checked) support with the Sprint board to calibrate to a max voltage for max speed - might be worth checking as well.

JohnT
08-07-2022, 10:35 AM
Yes iv ordered a slightly different board. It has two input/outputs instead of one. Behind the two terminals they are
L7818cv GKDEG V6 CHN 941
8pin surface mount chips are unmarked aswell. Typical China lol

The two 8pin chips in the middle are blank, no ID.(I have the dual model)
Iv mistakinly ordered the 5v5v version instead of the 12v12v version. But there are two pots on the board to alter output. It's maxed out at 8.5v. it states on the page you need 24-32v if you are using 0-10v. I have it hooked up 12v from the Bob (may need higher V)and a separate 24v PSU to the isolator board. Iv checked the sprint board and it has two pots for min and max speed.

dazp1976
08-07-2022, 12:07 PM
Got the board in the mail today. Wired it up works away fine :) I'm getting 8.5v max with 10v imputed. I'll play away with it a bit more and see can I get it closer to 10v on the output. Waiting on more bits from China to tackle those homing sensors. Thanks again Doody.


https://youtube.com/shorts/gTI93IFkSJ4?feature=share

You won't get 10v out if you only put 10v in. You get voltage drop through the circuits. Needs at least 12v inputing.

JohnT
08-07-2022, 12:10 PM
No it's 10v inputted by the BOB's 0-10v . It's supplied with 12v from the Bob and 24v on the other side
If the opto chips had an ID I could find out what pins has the 0-10v signal. My guess the 12v power from the Bob isn't enough

Doddy
08-07-2022, 06:17 PM
The 7818 is an 18V regulator - operating with an input voltage of 12V clearly it's not going to function well - downstream of that you'll suffer the forward voltage drop across the reg.

JohnT, I'd use the Sprint Min/Max pot settings to get full range - think that's where your thoughts are, too.

Personally I'd probably remove the HV regulator and just connect pins 1 and 3 together (Vin to Vout) and rely on the Sprint's internal regulated supply - it'd almost certainly be fine, but.... min/max pot is fine.

JohnT
08-07-2022, 11:45 PM
Ill have a play around with the min/max pots. I won't be using the lower speeds really.

JohnT
29-07-2022, 09:47 PM
Finally got some time with this. Homing is now working.just need to fine tune it. I managed to blow the relay side of the control board(Bob) messing with the spindle output. New one ordered :) that comparator board seems to be working very well Doody.


https://youtu.be/jz_jHis239Y

JohnT
29-07-2022, 09:47 PM
....