LED&Key and stepper motor

Ruminating a bit here, but I've been playing with the LED&Key module as a possible stepper RPM display.

The fastest library I've found for this is Tom Almy's TM1638 SPI lib. It can update the digits and LEDs at about 250 microseconds (on my Nano Every) maybe a bit faster if I tweak the code and update only 4 digits (haven't tried it yet).

However, with a 200 RPM stepper, 200 steps and 8X micro-stepping, step intervals will be about 180 microseconds. This doesn't leave much time for anything else (button reads and other general processing) or higher RPM.

I am assuming that this is a task for dual processor boards, or a much faster display (is there such an animal??).

Comments appreciated.

thx

K

How frequently do you really need to update the display and LEDs bearing in mind that they will be read by human beings ?

.00018 seconds

:thinking:

doesn't 0.000180 seconds = 180 microseconds ? :slight_smile:

Yeah, I considered that, but even if it's only every 200 ms or so, it has the potential of interrupting motor steps depending on what ever other processing is happening between step intervals. Not clear what that is yet.

Unless I can juggle and schedule those other activities against display updates.

K

Perhaps the solution is to offload the stepper control to a dedicated driver board, and just have the main board send it commands as needed?

  • Yes, point being this gives you a huge amount of time to do all the other things you say you need to do.

  • For example, you only need the read switches every 40-50ms, update a display every 500ms etc.

Not really, if you run the stepper via an interrupt, the user interface can run slowly.

Yes, but if it takes 250 microseconds to update the display, then it will interrupt (delay) the stepper pulses no matter how infrequently the 'other' things are done.

Am I misunderstanding?

K

You mean like a timer interrupt? Then the timer would interrupt the display updates (not a problem) if they happened at same time? Might give this a try.

Is there any CPU overhead with the timer?

thx

K

Hi,
How are you controlling the stepper motor?
How are you measuring the speed?
What model Arduino are you using?
Please post your code.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

  • This only needs to happen once every 500 milliseconds.

  • Switches need updating only once every 50 to 100 milliseconds.

Is this the LED&KEY module:

and this the library?

1 Like

Sorry for late response, but yes to both.

Working on using timer interrupts to drive the stepper.

Also considering using two Nano Everys (they're very inexpensive), with one dedicated for displays.

K

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.