Using Numeric Input & Manipulating it

Hi all

I am trying to build a camera slider to timelapse my 3D printing.

Got it all set up to take a picture, when the print head parks after every layer.

What I want to do now, is to input the amount of layers in the 3D print say 320 using the keypad, then use that to alter the distance traveled by the stepper at each pulse so at the end of the print the slider is as the end.

I have a keyboard and LCD setup and working

Any help or pointers appreciated.

MB

Then what is the problem? Just continue step by step.

1 Like

Welcome to the forum

I am not sure what you need help with but if it is entering a number using the keypad then this might help

If you need help with something else then please give more details

1 Like

so you have a way to detect when the head is parked, which is what triggers taking a picture ?

if your stepper starts at position 0 and needs to be at position endPos (in steps) at the end of the print, if you know there are layerCnt pictures to take then at layer number currentLayer you move the stepper to position currentLayer * endPos / layerCnt

1 Like
int OneStep = TotalSteps / 320;

Thanks all for your help, I am just getting into this type of programming am so old, I used to quite happily program BBC basic, could do anything, just a matter of getting used to it, I am getting there, just needed some pointers, thanks

If you calculate it once then you might fall short due to int truncation.

Say you need 800 steps, 800/320 =2,5 but will be truncated to 2 and int the end you’ll have done 320 x 2 =640 steps instead of 800.

That’s why keeping the full linear interpolation formula is better as you catch-up along the way.

2 Likes

You can just calculate the distance per layer by dividing your total slider travel by the number of layers.

Please explain how the solution should involve LEDs and multiplexing.

Mathematically this is correct but see post 7