This is my first post on here so firstly I would like to say a hello to everyone.
I have some questions about stm32 and arduino.
I am building a pipe bender at the moment with a 3 phase motor and gearing which is almost complete. I am planning once it is complete attaching an 600p/r incremental encoder to the main bending shaft via a gt2 pulley at a 1:1 ratio and making the bender CNC as such.
My question is as I only have very basic knowledge in arduino and I will be learning a lot doing this most likely would trying to learn stm32 at the same time be a big jump and learing curve? I plan on having an LCD display with buttons to increase and decrease the angle needed, a back to zero degree button, stop button, jog forward and back, also a zero current angle button. On the LCD will display current angle and the adjustable desired angle. The 3 phase ac motor will be controlled by 6 relays from the IO pins to enable reverse and forward on the motor.
I have no experience with encoders or LCD’s as of yet. But have been reading up on them and dont seem to difficult.
Oh and the encoder will only be rotating at approx 1rpm so the pulses from the encoder wont be that fast.
I look forward to your replies.
Dave
And it will provide a better accuracy …
Thanks for the input. ![]()
I don’t think it needs to be that accurate like a servo. As long as it’s within half a degree that will be adequate. Plus with all the gearing and backlash it wouldn’t be very accurate i wouldn’t imagine. Also the motor isn’t braked so it would complicate things I’d imagine with switching off the motor in time for it to stop at the right angle. I’m assuming that when the desired angle is reached the relays will trip and the motor will only move it a small amount more with it being around 1500:1 ratio.
Dave
fit a marker switch and let it do a revolution forward and backward, i think in my case it was a 15-20 count.
enough to affect the model in the wind tunnel, so depending on the model angle required, the motor/gearbox had the slack taken out by approaching the zero from the appropriate direction.
are you monitoring the angle of the tube itself ? when i’ve bent pipes in a manual bender, i ended up approaching the bend angle incrementally as i needed to back off and repeat as the bend in the tube opens a fraction.
how are thinking of handling that bounce back in the tube when you release the bending force / drive ?
can you monitor the motor current/loading and mark that position as there’ll be some lack in the mechanical bits ?
stephen
I was planning on using the same tube over and over again so the spring back will be very similar. So with a bit experimentation I could bend a 90 degree bend by bending it to say 92 degrees for example. Once I know this I can just note down for each angle what angle bend is needed. Then it should be bery repeatable. I imagine a 45 degree bend will spring back less than a 90 degree bend.
So do you think the programming of an stm32 would be a bit ambitious considering this will be a steep learning curve on an arduino still for me? I would rather learn the stm32 board as it’s more advanced for future projects. It’s just the time scale that is putting me off as I’d like to get this up and running asap really.
Dave
flies in the ointment
one or more libraries requires some porting. there is a section for libraries and problems. plenty of them already are; i use them as tutorials & for guidance.
voltages and sensors, keep in mind that stm32 is predominantly 3v3, although some pins(quite a few) are 5v tolerant.
go for a simple display, lcd 20×4 (fit a backpack? makes it simpler, i2c/spi/serial) – a graphical one can come latter
determine what you need in peripherals, spi, i2c, serial and general i/o pins. then double
look at board prices, the mcu families. if a board has a display socket or header(32/34/36/40ways), then it’s always there for the future.
usually such boards are more than a 103c8.103cb, typically minimum of medium 103r
look at the wiki http://wiki.stm32duino.com/index.php?title=Main_Page
there is considerable effort being applied to f4 and f7 series cores and libraries, pretty much the same peripherals & gpio are available, but more of them and much faster. pricing is trending downwards and the gap from high end 103 to that of a decent/high end f4xx is not that much
i’d suggest getting more than less in the mcu.
stephen
I would only need 2 pins really 5v for the encoder to be honest. Or just use a voltage divider to convert to 3.3v. As long as it has 2 interrupt pins for the A and B pins for the encoder and maybe another for the stop button that should for suffice.
I would probably go for a very basic LCD with spi or i2c to be honest as there will be less ports being used up. Is the wire library supported now? When you say porting do you have to go into the header files and change the registers? As I have no experience at all with this and I think I’d struggle greatly at the moment.
I think I’m gonna go for using the stm32 and see how I get on. Hopefully I haven’t bitten off more than in can chew. Hahaha!
Plenty of libs for displays work. The ILI9341 SPI colour LCD seems to be the most popular display.
Thanks. I did consider using a touch screen instead of normal switches.
I think I’m going to just order some bits and pieces have a bit of a play and see how I get on. Maybe see if I can get the hang of a basic touch screen display with a basic project first. Then do some basic with the incremental encoder second. Then once I feel comfortable with both try and merge what I’ve learnt and give it a whirl.
I think breaking this down and learning each part first is the most sensible option than trying to learn it all in one go.
Wish me luck!
My experience of metalworking shops is that optical sensors, unless completely sealed from their environment are not very reliable, hall sensors are better (but watch out for metal dust screwing them up).
They are pretty cheap too, so maybe worth picking up for a bit of experimentation.
No harm in having a play and see how it goes for a couple of quid.
I was thinking off adding a couple of hall sensors in parallel as a bit of protection for the end limits as a bit of a safety measure. I think this will be advisable with almost 25,000Nm of calculated torque.
[davemorl – Thu Sep 07, 2017 12:47 pm] –
I think this will be advisable with almost 25,000Nm of calculated torque.
You certainly don’t want that much oomph pinging lumps of metal round the workshop.
you say torque, so it’s acting on an arm of some sort. pushing or pulling something (constrained in a guide?) against the pipe ?
stephen
Apologies I had a big brain fart its not 25,000Nm its actually around 5,000Nm god knows where that figure came from its been a long day ![]()
also say you meant worm and not worn ? backlash is not a big enough term for that lot.
and up to what size tube ? actually anything from the look of that setup
so the motor came off a 3d printer ?
stephen
Yeah I’m not to worried about backlash as I’ll be taking up the slack in the system and then zeroing then bending to the desired bend with the addition of the spring back which will be determined from a few tests.
I’ve got the die made for 60x30mm oval tube with 3mm wall thickness so that’s the first test. I’ll just make new dies as I need them which won’t be to hard.
I’m putting a 1kw 3phase 4pole motor on it so will be pretty beefy! I’m hoping that the motor will stall before anything snaps especially the gears. I’ve calculated it this way so hopefully I have done it right
So I’m hoping to get the hang of the stm32 and get this up and running asap. In the mean time I’ll just try it manually with fwd and back buttons.

