• Spring 2024 meetup in Calgary - tentative date Saturday, April 20/2024. Other regions are also discussing meet ups. If you want one in your area get going on organizing it! discussion
  • We are having email/registration problems again. Diagnosis is underway. New users sorry if you are having trouble getting registered. We are exploring different options to get registered. Contact the forum via another member or on facebook if you're stuck. Update -> we think it is fixed. Let us know if not.
  • Spring meet up in Ontario, April 6/2024. NEW LOCATION See Post #31 Discussion NEW LOCATION

What's Paul up to?

PaulL

Technologist at Large
Premium Member
A bit quiet lately - the shop got shut down for three weeks for insulation and boarding. And the results are amazing! I have a wall full of shop cabinets that Home Depot is supposed to drop here this week, and a new bench topped with a half-sheet of 1/2" steel to replace the saw horses. And as usual, it's way more effective to have the fabrication shop that's sourcing my slab weld up the frame for me. At 600+ lbs I'm not trusting my crappy welds.
I also took advantage of the clearing of the space to re-orient into a better corner and to clean the lathe! Mill is next.
PXL_20221106_191116769.jpg
 

jcdammeyer

John
Premium Member
A bit quiet lately - the shop got shut down for three weeks for insulation and boarding. And the results are amazing! I have a wall full of shop cabinets that Home Depot is supposed to drop here this week, and a new bench topped with a half-sheet of 1/2" steel to replace the saw horses. And as usual, it's way more effective to have the fabrication shop that's sourcing my slab weld up the frame for me. At 600+ lbs I'm not trusting my crappy welds.
I also took advantage of the clearing of the space to re-orient into a better corner and to clean the lathe! Mill is next.
View attachment 27680
A lot nicer than the last time I was there. Awesome!
 

PaulL

Technologist at Large
Premium Member
Envious of the free space although with time and help from all the enablers around here I'm sure that'll change!

Looks good, I like the plywood.

D:cool:
Yeah - the plywood is removing all my anxiety about bumping things against walls.
Now I need to work out my chip management/cleanup. The shop vac does a bit, but I'd like the dog to be allowed in the shop, and chips are incompatible with paws.
 

DPittman

Ultra Member
Premium Member
Yeah - the plywood is removing all my anxiety about bumping things against walls.
Now I need to work out my chip management/cleanup. The shop vac does a bit, but I'd like the dog to be allowed in the shop, and chips are incompatible with paws.
Ya I've got a dog that eats the dang chips! I just about have a heart attack everytime. I'd like to have her in more often but seldom is my shop perfectly chip and swarf clean, and she can find the tiniest little bit to. I get most areas clean always but often there is something hiding behind machinery or stuff.
 

PaulL

Technologist at Large
Premium Member
Got out back today again and made some progress on my very homebrew ELS. Had a cheap rotary encoder on hand, so I got it mounted to ride along the drive belt. Yes, I did just make up a crappy bushing to fit one of my change gears temporarily to travel on the belt - it's holding very well, thank you. Another day I'll make something more reasonable.
Cm4rHOgTZamPzxSoF2R6ogzH3sSnF1nml1iMyWIbdwqTuxOQL7nAC0GuPf4T5_DdTS3c9xOL1aesXZH-0KXU8d7xkFC0_K3bq-bFT_VuZy0r31b47q8_6EU70qtVCOIUz6UEp7PFkkJHzuijHUDm2RqOEMUOd7U-Z5dR2mfvKVvt9ntNKONrb1uxLow9p7q7BcJFq0JcARf8n9EWooGkRIAAc4iI7WhK1x39RL7hio4c1LpmIuB4qvtFiNq_yVVvQA-LkEg70m9DXyNPLVoivC-UMg18aJFkMDyLsEwYIDptPHwYvY2gdXUPKJ7WI22fyJnUaCHJH-73eceHevhHonuMv2y3I0PbP1g9bJaZcxRIIPfrkQ9fQWUgKKCgsjL-D8jnp1LGKUv0jkp-o5z9mQkf8_bIdIjCMGwvT4PUTPI6Zg3MCTlCYjYrN8vhdPxN_9GX0x0jrnPSjNJ0BG_RNsThsqWJCWtTLlEJa3hiXEvabXlgdeIrNte4p8XsQ2FVGzjpkHfQ24mki1RnihXjNEPnBlr9BDk5kfiOUlCWsFfsI01Mui4AMf7yGGKcMRbSq19nf4rFrz0CVdLJ_PKzbtxlbWQJC6zMru_RsM16ldE8acxWIidLU8UA1wv0D9UE3WxgBFbX4qwPnJ_oI5DSoovTP_cZUwgPIF8QwNb9RA5owxCO69G818iazzbdmYvY-VjQaY3sWONrlBIsKUrUlHyBw0Yk9ktWOsmLPcVpMD46Tj-UbPWVG8T0upI2IZJb5l6epLdbwIp7g_KK_0e2fXwPFoHySYdHvRRXMhvoW69D83WZc6l7sypde5U-4vA7gD8RYVTqvOh59YKh8V0w4xsdem57wuiJtj0q0Ds5wet311CXlEGF3CSm_eh2CqUItmpOznkabIqmncokGDHXQ8ZHY_GZOc5sWnaz9js37HDocQ=w1464-h1943-no

Then I pulled out my little logic probe and a couple of pull-up resistors:
1667958023908.png
And got some pulses to count. I put a mark on the big wheel and took ten full revolutions by hand to help reduce the "stop in the right place" error:
1667958104720.png
And the software happily counts the number of rising edges for me, and I get, awkwardly enough to re-do the experiment, 22001 pulses per 10 revolutions. I was thinking that maybe the ratio of the gear size to the pulley size was nice and metric, but this encoder measures 360 pulses to the revolution. So it's just a coincidence that I get 2200 pulses per spindle revolution.

Next is to see if any of my microcontrollers can handle that kind of throughput. It's not too bad - at 1k RPM that's "only" 2,200,000 pulses per minute, or 36k per second. That's in range of anything running at 16MHz range, I'd think. So anyhow, looking through the pile of old boards and seeing if there's something appropriate and easy to drive the motor with.
 

jcdammeyer

John
Premium Member
Don't forget that if you are running a stepper motor, that it needs to accelerate.
Say you are running 1000 RPM and getting 36,000 pulses per second. To cut a thread that is lead screw pitch the leadscrew turns at the same rpm as the spindle. So you need 1000 RPM on the lead screw.

If it's directly coupled with a 2000 step/rev micro-stepping drive then for every 36,000 pulses per second you will output 2000 steps per second. (BTW, stepper motors lose most of their torque by 1000 RPM).

Anyway, every 18 encoder pulses you'll send out 1 stepping pulse since it's a 26/2 ratio and you'll be counting down those 18 every 27.8uS so your code has to be tight.

Next figure out what sort of acceleration you want. So you don't start out every 18 counts. That's your target value to decrement and reload for each step pulse. So your reload value starts hi and then is made smaller and smaller until it reaches the target at which point you are sending out steps at the expected ratio.

Doesn't matter what the spindle speed is. The ratio remains the same. Your target is 2000 steps per second. Say you go up at 2000 steps per second per second. That would then put the motor at full speed in one spindle rev. Or 36000 spindle pulses.
 

PaulL

Technologist at Large
Premium Member
Yeah, I've been noodling on the control loop - in particular I have effectively no experience in fitting acceleration curves to real inertia ;-). I have vague recollections from a graduate level control class I took 30 years ago, which I may say mildly, I did not excell at.
I have one of these IHSS60-36-30-31 servos (https://www.amazon.ca/gp/product/B08JG8SRNC) that I'll be hooking up with a 3:1 reduction. Yes, that's my one-star review to point out it's not what they advertise.
My background is in fitting *way* more compute than that in a 16mSec slice. It's kind of refreshing/nice to be able to have 28uSec to toggle lines. These days, that's a round trip and database lookup to a server in my datacenter...
 

jcdammeyer

John
Premium Member
I haven't spent a lot of time with the electronic gearing approach so I can't give hints on how to do your acceleration. I'd be concerned about 3:1. I run 2:1 with a 280 oz-in stepper on my South Bend and I'd rather have a bigger motor and go 1:1 but my ELS internal micro-stepping driver was limited to 3A and 55V so I went with a 3A (or maybe it was 2.8A) motor and 2:1.
 

Susquatch

Ultra Member
Administrator
Moderator
Premium Member
Yeah, I've been noodling on the control loop - in particular I have effectively no experience in fitting acceleration curves to real inertia ;-). I have vague recollections from a graduate level control class I took 30 years ago, which I may say mildly, I did not excell at.
I have one of these IHSS60-36-30-31 servos (https://www.amazon.ca/gp/product/B08JG8SRNC) that I'll be hooking up with a 3:1 reduction. Yes, that's my one-star review to point out it's not what they advertise.
My background is in fitting *way* more compute than that in a 16mSec slice. It's kind of refreshing/nice to be able to have 28uSec to toggle lines. These days, that's a round trip and database lookup to a server in my datacenter...

I guess that depends what you are doing the controlling with. It's a walk in the park for a dedicated controller. But it might be like asking a turtle to fly for an arduino.
 

jcdammeyer

John
Premium Member
Actually not for electronic gearing which is the correct term for the Arduino electronic lead screws. Look at the code for those.
For example the Russian ELS is an electronic gearing system with with all the ratios needed to run the lead screw at a scaled rate relative to the spindle. As long as the spindle doesn't turn the encoder faster than the processor can track it while doing floating point operations.

I've attached the document for it.
 

Attachments

  • ELS_Russian.pdf
    4 MB · Views: 11

Susquatch

Ultra Member
Administrator
Moderator
Premium Member
Actually not for electronic gearing which is the correct term for the Arduino electronic lead screws.

Once again I am impressed by what the little Arduino can be programmed to do! I've been having fun doing little learning projects with mine. I want to order a few breadboards to expand a bit on the organization of components for my projects. Piles of parts and wires is just an invitation for problems. I'm hoping to be ready to fly my turtles by spring.

I guess I should have looked for something more challenging to make the point. Regardless, I'm thrilled to be able to plan my turtle flights a bit higher up!

Thanks for that John!

A question - do you have a rough idea of just how fast an Arduino is? In other words, what is an average execution rate for typical lines of code without comments. I know typical is a very broad term but just looking to get a sense of what is and isn't possible.

Or is that my next project?
 

PaulL

Technologist at Large
Premium Member
Your typical Arduino is *s l o w*. They run at 16MHz, so you take 62.5 nanoseconds per machine instruction (to a first order approximation ... I'll avoid those details here). For comparison, you PC laptop likely runs at least 100 times faster (>1.6 GHz). And these controllers have typically for only one processor core, where your bottom end laptop runs at least 4. Heck, the phone in your hand is probably at 2GHz with 8-10 cores.

So yeah, doing the electronic gearing work in real-time is a challenge on these small, very low power parts.

But there's another class of controllers running in the 100-200 MHz range that make these things so much easier. I have one of the TI boards that James Clough likes - total overkill, but sure leaves a lot of overhead to not worry about.

As far as "line of code" execution speed, that's a really hard call. Some are almost free - integer addition, logic opérations (and, or, xor) - while some hide vast amounts of compute - floating point math, serial out, any library calls, really. And what's expensive relative to what else at the low level changes significantly as your processor gets faster for increasingly arcane reasons. At least on Arduino-class devices RAM is effectively exactly as expensive to access as an addition operation. On your PC it's close to 1000x as costly (a boatload of caveats and optimizations apply).
 
Top