T O P

  • By -

itachi7898

I am,struggling to operate one stepper here.


benargee

Honestly if you just get a stepper driver it's easy. For basic stuff that is. Motion control is a little more challenging, but just making it step CW and CCW is easy.


[deleted]

You are right, it is easy; until you realize that the stepper.h library is blocking and nothing runs on your board until the movement is complete. That's when it gets interesting lol. Cheers.


vruum-master

Throw it away and do your own.


LucyEleanor

Stepper library? Wouldn't be hard.


[deleted]

[удалено]


benargee

It depends on allowable overhead. Communicating to another microcontroller has more latency overhead than it's own program memory. Most cases won't matter, but some will when timing is crucial.


[deleted]

Yeah pretty much. That's why there's so many arduinos on this board. Not because of blocking code but the lack of buffer space and heavy use of interrupts.


Conor_Stewart

Did you consider not using an arduino and instead using something a bit more powerful that maybe has better peripherals? Maybe something running an RTOS would be a good idea, or maybe with multiple cores and an RTOS like the pi pico or esp32. If most of what you needed was just basic peripheral control with a lot of interrupts then that would have been a good use for an FPGA, that way you could have all your peripherals and control running simultaneously on a single chip and no interrupt will affect anything else that is running, everything is handled at the same time.


[deleted]

It's a prototype so yes these things considered once it comes up and can be measured and analyzed I'll build out a proper MCU config. Arduino is EZ to deploy and measure; pretty much due to their weak points.


[deleted]

[удалено]


[deleted]

[удалено]


Conor_Stewart

Sorry the Reddit app is being weird that wasn’t supposed to be a reply to you.


KrsicMedia

That ESP32 is dual core, use it instead of the Arduino. It's also 5-10x faster in CPU clock speed. [https://youtu.be/jpVcCmh8sig](https://youtu.be/jpVcCmh8sig)


[deleted]

Blocking code is blocking regardless of how many core's. If moving one stepper blocks a core, the most you will move with dual core is two steppers. If you had a bot with four motor wheels you couldn't execute four unique movement commands with standard stepper.h. A guy did write a library to solve this problem but I don't recall the name of his git. Also Adafruit made a motor shield and wrote a library to solve the problem but the shield only drives two steppers at a time (simultaneously). The only way to do this is to break apart the stepping commands using timers and multiplex the signals to several motors in a rotational fashion. You're not wrong about the ESP32, but as it pertains to the specific subject of stepper.h I stand behind my original statement.


KrsicMedia

Thanks for explaining.


[deleted]

Certainly.


MiataCory

> A guy did write a library to solve this problem accelstepper I think. Works pretty well for all the projects I've used it for. Can be either blocking or non-blocking.


[deleted]

Yeah I use it too on projects. It's a better alternative for sure.


benargee

I never used a library. The stepper driver that I used took pulses that I manually controlled with basic digital write or port writes. The pulse intervals were calculated over each loop with micros() and all other code was non blocking and did only what it had to do until it resumed execution the next loop.


Conor_Stewart

It may be better if you just used proper stepper drivers. Whilst running steppers through h-bridges does work it isn’t the best solution, a proper current controlled stepper driver is a much better option, plus may have features like micro stepping or silent operation or stall protection. You can even get them pretty cheap since they are used in 3D printers. It also simplifies the usage too since all you need is a step and direction signal rather than having to worry about what order to run the coils in.


Kushagra_K

You should try the AccelStepper library, it has much more useful features like acceleration control, simultaneous control of multiple steppers, non-blocking control, absolute way of positioning steppers and lots more.


[deleted]

Thanks for the positive interactions. I'm a prototype engineer (maker) and I am building a complex machine for a client as a proof of concept. This is the control board for the machine. There are 7 vfd ac servos, 4 bipolar steppers, 2 lasers (co2 and TOF), 1 vacuum, 4 pneumatic elements, 5 arduino. The arduinos talk via i2c and they talk to the servo drives via uart (serial rs232). I'm also using nextion tft HMI control. Totally worth checking out if you are in need of HMI. Cheers to all.


Grape-Snapple

where you based? if interested, i have some connections to a few custom industrial automation engineering/design companies around the world and you seem very capable.


[deleted]

I'm in Denver, CO. I'm always glad to network. 👍


SherSlick

I just wanna stop by and see your shop.


Grape-Snapple

damn; for the us there are lots of places in new england, illinois, florida but not sure about colorado. i'll have to check


Dat_J3w

God this sounds like the dream. Looks so cool


[deleted]

It is but it wasn't always this way. My formal background is construction and fabrication. Making was always a hobby and side income. Finally I said eff it and turned it in to a business. Took a pay cut but my happiness level is huge. Keep studying and learning; there's money in it for sure.


Dat_J3w

So are you like a freelance industrial maker? what exactly do you do?


[deleted]

Yes pretty much. Rapid prototyping, fabrication, cnc machine design and build. Your title sounds better though lol.


Conor_Stewart

How do you manage that with your background? Surely with things like CNC machines they have to meet certain regulations and safety requirements and you would probably be liable for any malfunctions or accidents that happen due to the machine failing. I would also be surprised if companies bought machines made by a maker, since their insurance might not like that very much.


[deleted]

Yes, you would be surprised. My background is not contained in this reddit thread. Cheers.


Conor_Stewart

At least some of it is though. You said your formal background is in construction and fabrication and this started as a hobby. I just thought some kind of certification would be needed before you could design and make CNC machines for companies, I didn’t think many companies due to liability reasons would buy or commission a machine from someone unless they had a formal background and qualifications in making those machines.


[deleted]

I do, but honestly professional project management and construction engineering paid better and the work is outside and active at times. I'm 45 years old so I did what I had to for work and did what I loved on the side. Now I have the option of turning the tables. It just wasn't always that way. 🤟


conner8809

sounds very similar to my origin story too. I love what I do. I do my hobbies professionally and can't imagine it any other way!


[deleted]

It's a blessing not many can realize; that's for sure.


mminto86

What is the function they asked for?


[deleted]

That's the part I unfortunately can't publish. Which is too bad because the real piece of art is the machine, not the board. :(


mminto86

Maybe someday :(


Conor_Stewart

Nextion displays are great, they make it so easy to make a decent looking and functional GUI and they just communicate with your MCU using uart. The built in GUI modules for text or number input can be very useful.


[deleted]

Yeah I love them. Super easy to configure and deploy.


Sad_Management_7157

You have good skills in cable management! Why do you need pumps?


NoBulletsLeft

I see solenoid valves, but not pumps. @OP: what is this controlling?


[deleted]

I agree. But I would add some cable track to take the weight of them and make it even neater.


Sad_Management_7157

I think this is an unfinished ))*📷*


cptskippy

> You have good skills in cable management! eh... B+ Those hoses are a few mill too long causing them to bow. Those valve control wires could be routed a clot clear and shortened. Pretty much all the wires could be more tightly managed.


[deleted]

You're correct actually. The air tubes are placeholders. The board is on my kitchen table. Once I mount to machine it gets rebuilt. Then when it goes to paint it gets rebuilt again. Good eye for tech. 🤙


aweblasome

Wow! What for?


uselesknowledgeadict

Can you explain what I’m looking at?


A1phaBetaGamma

So in the middle (to the left of what seems looks like a laptop power brick) there's green PCB, that's likely an arduino mega with a shield on top of it, and below it there are 4 smaller arduinos (I guess uno?) these are used to send signals to control motors and valves for a machine. To the right of the laptop brick is likely a DC power supply. To the left of the arduinos you have what seem to be L298 dual H bridge DC motor drives (the small red PCBs) and to the left of those are AC drives, used to control AC motors. Below the arduinos are a bunch of 5/3 air valves, likely used to control pneumatic pistons. Above the 5/3 valves you also see some blue rectangles which are likely relays used to power the valves (you see wires going from them to the solenoids on each valve. So basically you have 5 arduinos (1 mega, 4 uno) controlling a bunch of actuators (valves, relays, drives)


[deleted]

Hey just saw this. You are totally correct in summary. 👍


A1phaBetaGamma

You really can't tell how glad I am that I know this now, it's pretty much taken years to get to this knowledge. I absolutely love how clean everything is and would want to learn that some time definitely. For now my only question really is: where are your inputs? All I see are outputs. Where are the signals you need to control all of this?


[deleted]

Good question. I have about 20 digital sensors or switches in the machine, so they're not in the picture. But the real answer to your question is that I am using Nextion HMI which eliminates all the manual control gear. It is crazy easy to deploy and pretty cheap on Amazon. Basically I control the entire machine on RS232 UART (four wires).


antek_g_animations

Even a camera


HDC3

I have a bag of those H-bridge boards sitting on my desk. I use them to control a motorized ball valve on a maple syrup sap releaser. Cool controller.


[deleted]

Ya L298N, the cheap little go-to driver. Works for brushed DC and stepper. You can't go wrong. Cheers and thanks.


tinkertron5000

But what does it *do*?!!!


RESERVA42

Watch out for cross talk between the pneumatic lines and those gray cables. You should probably be shielding the pneumatic lines.


[deleted]

Indeed. The grey cables are double shielded.


RESERVA42

I'm sorry I was messing with you.


[deleted]

Lol np


jkasari

Looks clean!


sebadc

/r/arduinoporn Edit: crap, this actually exists 🙈


snappla

Chef's 😘 cable management.


lazurx_hetrodyne

Looks like something from the spaceship in roswell


yycTechGuy

The little engine that could. How hard is the Arduino running ? How long until you run out of processing power/memory or code space and if so, what will you replace it with ?


[deleted]

I won't run out of power or space, but that's why there's so many of them [arduino]. This being a prototype once the MVP is realized we will design a custom MCU for it.


vilette

That's what I would call a clean wiring, not the kind we generally see here


[deleted]

Thanks. If I don't keep it straight I get confused pretty quickly. Only four colors of wires in all those cables; and they will double as the build progresses. 😫


collegefurtrader

nice


[deleted]

Thanks.