Not sure that starting with Marlin gains us anything. It is build
ground up around the concepts of driving steppers. For your sanity you
would have to leave the planner etc. all dealing with generating
DIR/STEP output. Then add a routine that simply took the DIR/STEP
signals and integrated them into the value for the DAC. I.e. in
stepper.cpp change all the WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN); lines
to set a new value in the DAC instead.
Smoothie is a much better starting point. Whilst its current
modules/robot/Robot.cpp is stepper based you could drop in a new module
that was optimized for galvo's. Their planner etc all looks
well-structured enough to work well. However it doesn't run on
Arduino's, do we have other hardware as an option?
Alternatively I hacked a supper simple g-code evaluator together for
testing different driving options:
https://zi.is/p/browser/microg
Obviously we don't want to reinvent the wheel and would need to switch
to Smoothie before going past basic testing. But the is something to be
said for starting with something that dose precisely what we tell it,
rather then trying to test our output code inside the advanced
acceleration planners.
As you say it is the dynamic stuff that we need a good understanding
off. Even the simplest question: how often do we need to update the DAC?
It may even be possible to use more analog stuff to smooth the output so
the MCU can output more in terms of: Move galvo from its current
position to XY over T seconds.