XStepper: New complete Hardware GRBL solution.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: StepperX: New complete Hardware GRBL solution.

Post by cvoinescu » Wed Feb 13, 2013 7:34 pm

That doesn't work because it inverts the signals, and one of the optocouplers is "backwards" (one signal is from USB to the microcontroller, and that one's good, but the other one is from the uC to USB, so it should be facing the other way). To avoid inverting the signals, have the optocoupler LED turn on when the signal is low: connect LED anode to +5V, and LED cathode to signal line via resistor. You don't need the R4 and R6 resistors; connect those pins directly to +5V. Also, your pull-ups are too weak for 250kbps, and the LED series resistors too large too; use 470 ohm for R2, R3, R5 and R7. Diodes D1 and D2 aren't needed.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Godsplan
Posts: 63
Joined: Fri Feb 08, 2013 12:05 pm

Re: StepperX: New complete Hardware GRBL solution.

Post by Godsplan » Thu Feb 14, 2013 2:29 pm

cvoinescu wrote:That doesn't work because it inverts the signals, and one of the optocouplers is "backwards" (one signal is from USB to the microcontroller, and that one's good, but the other one is from the uC to USB, so it should be facing the other way). To avoid inverting the signals, have the optocoupler LED turn on when the signal is low: connect LED anode to +5V, and LED cathode to signal line via resistor. You don't need the R4 and R6 resistors; connect those pins directly to +5V. Also, your pull-ups are too weak for 250kbps, and the LED series resistors too large too; use 470 ohm for R2, R3, R5 and R7. Diodes D1 and D2 aren't needed.
First of all: Big thanks for your advices! It realy helps me to understand electronics (i'm new in designing electronic circuits). I understand what you mean, but i'm not sure about the correct circuit to keep the LED on and what happend with GND between Signal output and 5V?!, when signal is low. It would be awesome if you take a look to my revision :)
Attachments
GrblMainboard - v2.1.png
GrblMainboard - v2.1.png (47.76 KiB) Viewed 1580 times

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: StepperX: New complete Hardware GRBL solution.

Post by cvoinescu » Thu Feb 14, 2013 3:12 pm

You just converted your optocoupler LED into a SED (smoke emitting diode). I don't have a schematic capture program installed, so here it is in ASCII:

Code: Select all

          2  OK2  3     R3
USB_5V ---o--|>|--o---/\/\/\---- USB_AOFI
             //        470

          2  OK1  3     R2
    5V ---o--|>|--o---/\/\/\---- AOFI
             //        470
Note that the ground is not involved in the optocoupler LED circuit; just remove those connections in your circuit diagram, and you should be good. The output circuit is good. To be on the safe side, add 100nF decoupling between USB_5V and USB_GND, and that's it.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Godsplan
Posts: 63
Joined: Fri Feb 08, 2013 12:05 pm

Re: StepperX: New complete Hardware GRBL solution.

Post by Godsplan » Thu Feb 14, 2013 9:22 pm

cvoinescu wrote:Note that the ground is not involved in the optocoupler LED circuit; just remove those connections in your circuit diagram, and you should be good. The output circuit is good. To be on the safe side, add 100nF decoupling between USB_5V and USB_GND, and that's it.
Thanks again for this advice, i will write you in the signature part of the finished pcb.
Beside that I think we have it now! I ordered some opto isolators and will prototype the whole system before milling a pcb.
Attachments
GrblMainboard - v2.2.png
GrblMainboard - v2.2.png (67.16 KiB) Viewed 1559 times

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: StepperX: New complete Hardware GRBL solution.

Post by cvoinescu » Thu Feb 14, 2013 9:40 pm

Perfect!
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

jsbannis
Posts: 80
Joined: Tue Apr 10, 2012 11:09 pm
Location: Chicago, IL

Re: StepperX: New complete Hardware GRBL solution.

Post by jsbannis » Fri Feb 15, 2013 12:48 am

Maxim has a nice application note on isolating USB from the rest of the system using optocouplers. It's somewhere near the top of the google list so you may have seen it, but I ran across it the other day and thought it was interesting http://www.maximintegrated.com/app-note ... vp/id/3891.
shapeoko #0057

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: StepperX: New complete Hardware GRBL solution.

Post by cvoinescu » Fri Feb 15, 2013 2:21 am

That is interesting, but the lower speed, unidirectional serial signals are much easier to isolate in this particular case.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

xpix
Posts: 218
Joined: Thu Sep 06, 2012 6:47 am

Re: StepperX: New complete Hardware GRBL solution.

Post by xpix » Sun Feb 17, 2013 12:58 pm

Hello,

im back from my Vacation ;)

@Godsplan: Very nice work, can we get tghe original eagle schema from u? Then i want to work with urs :)

xpix
Posts: 218
Joined: Thu Sep 06, 2012 6:47 am

Re: StepperX: New complete Hardware GRBL solution.

Post by xpix » Mon Feb 18, 2013 7:51 am

I create yesterday a schema for Solid State relais to control the Spindle. This SSR can switch 20V - 220V! Only one thing to remember, the traces on board must thicker for this power.
Attachments
SSR.JPG
Solid State Relais
SSR.JPG (20.01 KiB) Viewed 1497 times

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: StepperX: New complete Hardware GRBL solution.

Post by cvoinescu » Mon Feb 18, 2013 9:33 am

Equally importantly, the traces must be separated a certain minimum distance from anything else on the board; how much depends on whether the board is coated with a solder resist or not. If you want to go with a PCB solid-state relay, I would strongly recommend moving it to its own small board, that can be easily enclosed and insulated, and leaving dangerous voltages off your main board. (Larger ones have screw terminals so they can't be mounted on a PCB.) Many people like to start with their board unenclosed, or frequently open the enclosure, to measure, adjust, program the board and so on, while the power is on. Having mains voltage on it is asking for trouble.

Also, I disagree with your choice of solid-state relay: its rated current is way too low at 2 A. A DW660 draws three times that, and much more during startup. Any DC spindle would draw way more than 2 A. Many larger solid-state relays are available, that take 3-6 VDC for the input (no resistor needed) and switch tens of amps. They're bulky, but they don't have to be on board (which, as I pointed out above, is a good thing).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply