Replies: 8 comments 23 replies
-
Hi @zyeborm, huge thanks for offering your help. Arduino is not the best platform for ELS and for 2-axis controller I've moved to ESP32 in the upcoming version of NanoEls. It has 15x higher frequency, 2 cores and many more features for a smaller price :) And it's supported by the Arduino IDE just as well. I have the following PCB in production at the moment with ALLPCB (JLCPCB had component shortage): It's designed to be used with a 25-button panel which I'm still trying to figure out that piece on because my last prototype has problems with buttons having 3 states instead of 2 (released, clicked & no contact, clicked & has contact). Doesn't help that my suppliers are all out of office due to Chinese New Year :) If you notice any problems with the designs above in terms of ESD or EMI, please let me know. The code for the 2-axis version will be open-source but I'm still thinking whether I'd be sharing the PCB design files since the plan is to sell those boards in my little online shop to recoup some of the investment for this project. Smallest batch of these (5 boards) costs 200$+ to produce and it'd be much cheaper for folks to buy a board from me than order it from JLCPCB. Same for the 25-button panel, minimal order there is 400$+ for 5 panels while I would be able to offer them for much less due to volumes. I like your limit switch idea but on the ESP32 board we don't have any more free pins. Perhaps you could wire a NC limit switch into the driver/motor circuitry, not sure if it would be practical. I don't plan to make more hardware iterations on H1/H2 Arduino boards but feel free to make your own hardware version of H2! Let me know what you think, cheers! |
Beta Was this translation helpful? Give feedback.
-
I stand corrected, looks like I'm doing another iteration on the PCB design :) It's mostly to make it more robust and likely to pass the FCC/CE certifications (a man can dream). I tried to follow your recommendations where I understood them. Added a 300mA fuse even though the board only takes 100mA during normal operation. If there are any problems with this design, please kindly let me know :) Thanks! |
Beta Was this translation helpful? Give feedback.
-
Looks pretty good man ;-)
Somewhat unrelated I'm putting together a nanoels2 for my father right
now (literally sat down to find the cable to program the arduino lol)
One thing I have found is the 3.5mm spacing headers you have for the
stepper power etc is a little harder to find than 2.54 and
5.8(something) spacing (I think, the physical store in Australia is
Jaycar if you wanted to look lol).
Need to order from the big electronics supply place here, not just pick
up from the local hobby store kind of thing. Not a deal breaker just
something you might consider looking into?
Have you tried that low pass filter on the analogue button switch thing?
That should breadboard ok to try out. I only suggest it because of the
people who had noise issues.
You might consider getting your copper pour under the K2-K5 switches.
But that's pretty much just a visual thing.
Oh, if you're getting it assembled consider liberally dousing the whole
thing in LED's ;-)
They cost like less than a cent and a 10K(or so?, perhaps 5k? depending
on LED) resistor driving is still plenty bright enough to see and now
you can get an indication from the encoder that things are happening and
also that you are step and directioning out.
I like the blinken lights (if they are dim lol) I'd breadboard that
first to make sure it doesn't bother the encoder signals etc.
My father just got his encoder running and the Z (index) needed a pullup
resistor to make a nice wave form? That seems very strange and LED's may
impact on that.
Again, just an idea to consider for more flashing lights lol.
If you wanted to you could perhaps consider a switch matrix rather than
using the analogue switches btw. It's a little more brain work to
understand but it does give you a lot of digital switches with few I/O pins.
For your EMC dreams you might consider ferrite p.i networks at the feed
into the nano. the EMI filter is a great start but take a look at the
example circuit on page 2 of the datasheet and you'll see they have a
cap on either side of it as well.
The resistors on your I/O lines will help with a lot in regards EMI too
(slew rate limiting the signal edges, it drops the frequencies you put
out dramatically.) I'd consider adding a ground contact (if you can) to
the step/dir line outputs. People can run shielded lines then if they
want (and you say they will for your testing lol)
I really wish the stepper drivers these days actually took differential
inputs, it'd be so much nicer.
I'd perhaps look at "common mode" filtering and some capacitance right
at the point that you get (and give) your 5V btw. You want to think
about the wires leading into your board as being antennas, any ripple in
the signal you put out over those antennas becomes radio waves and those
wires are included when your device is tested. You can get a bit of an
idea of your noise sources with a loop of wire on your oscilloscope (or
spectrum analyser) and sniffing around your board with that. Won't tell
you what passes/fails but you can get a magnitude comparison for any
changes you make.
Probably test those 1K resistors on the outputs of the steppers, just
make sure that isn't too much to make the drivers marginal.
Under your power switch, if you route that track from the arduino around
the other side of the switch you can stop it from hugging those through
holes, make for fewer ooopses when soldering.
On the LCD side I'd drop that line that runs next to the pads down some
just to give yourself a bit more clearance there.
I think that's probably a general thing, in your DRC check, perhaps
think about increasing the minimum clearance distance, like you're
probably fine as is, but you have so much room on the board you might as
well make it as easy to manufacture as possible? You can ignore it where
you have to, but it might find places you're close but don't need to be.
Just to be really clear here I'm trying to find every possible thing I
can see that might be wrong or could be improved (or made more to my
personal taste lol) It's a good looking board and I don't think you'll
have any particular problems with it.
Now I've done this instead of flashing my fathers PCB or building my
mother in laws TV computer and now I'm late for bed too.
LOL, your project is way more fun that those things ;-)
Have a good day mate. Once I get this one up and running I may be able
to help out a little more on the software side perhaps, see if we can
steal some clock cylces back ;-)
…On 28/02/2023 7:16 pm, Maxim Kachurovskiy wrote:
I stand corrected, looks like I'm doing another iteration on the PCB
design :) It's mostly to make it more robust and likely to pass the
FCC/CE certifications (a man can dream).
r1
<https://user-images.githubusercontent.com/517919/221793280-baa02a01-79e2-463d-9e90-0909962ec66f.PNG>
r2
<https://user-images.githubusercontent.com/517919/221793293-461859a6-fa91-462b-97de-d7ba0069d4f2.PNG>
r3
<https://user-images.githubusercontent.com/517919/221793311-e122b9ea-bd42-46af-bb20-0b59e689dc08.PNG>
I tried to follow your recommendations where I understood them. Added
a 300mA fuse even though the board only takes 100mA during normal
operation. If there are any problems with this design, please kindly
let me know :) Thanks!
—
Reply to this email directly, view it on GitHub
<#106 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56EU3VQUTMTNBBX6HCHXTWZWX7PANCNFSM6AAAAAAUG36SQM>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm thinking about adding some extra reverse polarity protection (Nano and screen already have some I believe) - do you think it's worth it? Will something like this SBD work spec-wise? Also thinking about over-voltage protection. Would a TVS diode to GND after the fuse be a good solution or is there a better way? Many thanks! |
Beta Was this translation helpful? Give feedback.
-
I don't think the nano has reverse polarity protection. Adding some is for sure a good idea especially to save peoples encoders etc, I think you should have enough voltage headroom to fit it in. TVS diodes are more of a voltage spike than a sustained over voltage situation protection. Think ESD, sparks from walking across the carpet in socks kind of deal. You will want it to conduct until the fuse trips, they may well work but that could be a few seconds of operation if the input supply is like 6.something volts. (somebody turned the pot on the 5v supply) Don't get me wrong it's probably a really good idea to put TVS on all the I/Os and the power just to help protect against ESD and big big noise. They say to put the TVS right on the edge but personally I wonder if it'd be better after your initial current limiting resistor, provided they are both located close to the actual pin. They want the TVS first to stop the spike from coupling into other things as it travels along traces. For this circuit you could probably get some USB TVS chips (they are pretty cheap and very common) to cover the I/O's that are directly connected to the nano. You get 2 channels out of each chip. Just check their clamping voltage, it might be too low being usb. For the overvoltage you could put a zener diode in after the fuse perhaps (and perhaps use a resettable/thermal fuse?). You'd want to check the curves but something like a 5.6 volt zener on the 5V rail probably won't eat too much current at idle and will probably trip your fuse at 6 ish volts? (ideally stay under the abs max voltage of the nano/screen) If you really wanted to be fancy you can do the reverse polarity and over voltage stuff by putting a fet (or two, can't remember the circuit exactly) on your input rail and basically turn the fet off if the incoming voltage is too high or too low or backwards. But yeah a diode on the supply and possibly a zener (as a crowbar kinda) after the fuse is probably going to do the job good enough most of the time. I'd kinda like the crowbar(ish) zener to be after the diode so you can use a lower voltage zener and keep closer to the limit of the arduino, If one exists like a 5.1v zener might do then. But then the reverse polarity diode has to take the short circuit current until the fuse trips and the zener itself might wind up chewing significant power all the time. Decisions Decisions lol. Thankfully this is your problem not mine lol. |
Beta Was this translation helpful? Give feedback.
-
I haven't had a look at that one yet but I have had a bit more of a read of your code. Some ideas for that, in your current Async ISR you're doing the step pulse in software still to get the delay. It's been a long time since I did avr timers but I think you should be able to allow the pwm to output directly. If you also then in that isr kept track of the current position (++ or -- your position variable) you could change the synchronous operation from being dependant on the encoder pulses directly to a PID loop style of operation. It wouldn't actually be that much of a change to your code I don't think because you wrote it so well. But basically use another timer or millis counter in your main loop to get a say 1khz trigger. (100hz would probably be totally fine too BTW) Now you've got plenty of time to update LCDs and things, and your max step rate should be in the hundreds of khz range. (Back of the envelope says minimum step rate is about200hz if you're not using a prescaler, but what'll happen if you need to go below that is the pid loop will wind up basically dithering it's output provided the PID loop runs at more than the minimum step rate, it'll just put out a single step then run a few more loops and put it another.) Double check everything I've said there though. It has literally been a decade since I did raw avr timers lol. |
Beta Was this translation helpful? Give feedback.
-
Ahh that's irritating, I really don't like how kinda crappy the inputs on the stepper drivers are generally. Like I get they are cheap but is differential really so hard?You'd probably get away with like 200 ohm which would still limit the short circuit current at least. BTW you can get zero ohm resistors. It's not uncommon to use them for stuff like this so you can have a resistor with a value on the board or change it out for 0 if you want to bypass it totally.
|
Beta Was this translation helpful? Give feedback.
-
Just letting you know we got the first one running. |
Beta Was this translation helpful? Give feedback.
-
Hi There.
My father (Russell) was wanting an ELS for his lathe, came across your project and liked it. He is more mechanically inclined and I am more electrical/software. He sent me your video where you had what looks like the nanoels running multiple axies during a threading operation. https://www.youtube.com/watch?v=B8pwe0wKsCU
I understand the software isn't there yet but PCB design is part of my day job (Not that I am an expert) and I was going to look at revisiting your current PCB to improve noise handling, ESD safety, things like that. I figured it may be nice at the same time to add provision for the extra stepper (and perhaps some general inputs/outputs, limit switches etc perhaps?). If it's ok could you tell me what pins you would like to use for the stepper (if they are special at all, eg if you are using hardware PWM for outputs or something)
And any other things you'd like to see on your dream PCB ;-)
Just to be clear, not suggesting there are any faults or failures in the existing design. I want to test some things I have learnt about PCB design and this is a good project for that.
I was probably going to look at getting boards assembled by JLC and using SMT parts, it's almost cheaper getting 5 boards made and assembled that way than it is buying components for a single board these days lol. That and I need some more practise ordering PCBA services.
Happy to give PCB designs back to you and your very nice project of course.
P.S.
I may be able to help a little with software as well, but that takes a lot more time as I'm sure you're aware. I haven't had a close look at your code but what I have seen looks nice. I think I may have spotted a few places where you could save some cpu cycles though if that's of any use to you? (Readability and "it's not broken" have a lot going for them though lol)
Beta Was this translation helpful? Give feedback.
All reactions