... Power supply will be 4 NiMh AA batteries in series, and this will be used to power everything, including the motor, the microcontroller, etc.
Cool, make sure you implement some form of protection and charge control. Inevitably you'd need to use some form of regulator, either linear or switching (dc-dc buck).
The part that I need advice on is how to implement that "curve" and displaying it on a screen. You mentioned lookup table. As I understand, the lookup table stores the position information between the input and output correct? How do I actually code this up (I guess this is more of a software question) if I used a stepper motor without feedback? I believe one can only tell the stepper how many "steps" to take and at what speed. So maybe I need to take the derivative of the positions in the lookup table and use that as the stepping frequency?
Yes, the LUT stores effectively a "mapping" between function input and output value.
Ideally, you want to precompute most of your data beforehand rather than calculating them in real time, now there are some scenarios where a real-time calculation is the only solution, but for most cases, there will be sufficient system memory to precompute.
As you have no feedback, there is no way to accurately detect the stepper/servo position. Taking the derivative won't help you. You can use a counter to measure how many steps have occurred and thus the total angle/distance displaced. However, If the motor slips then that can never be corrected for (in usual runtime operating, you can force the motor to an extreme/hardstop to trigger a switch to indicate a home position). So when you use the LUT, you'll just have to pray that the motor does not slip so you get a 1:1 mapping of your LUT function.
As per suggested prior, you can just use an array, ill walk through a basic example:
Say I want to create a log LUT for an LED. I would have a function that resembles:
ledLut[5] = {0, 0.69, 1.099, 1.39, 1.61};
void ledLutFn(int i) {
return ledLut[i];
}
What this does is effectively index an array and returns a value. As you may deduce, this only works for integer inputs.
This LUT could either contain speed or position information, it's up to you.
As for displaying to a screen, that is a task that can be solved through many methods. I'd suggest looking at the u8g2lib.
https://github.com/olikraus/u8g2/wiki