Question When I'm using preset 1 on the Harmony-M and I change sounds on my keyboard, the pedal changes to a different preset as well. How do I avoid that

It's perfectly normal and standard MIDI behaviour for unit to react to MIDI program changes, fortunately you can set the Harmony-M to ignore MIDI Program Change commands altogether. Page 21 of the Harmony-M product manual explains this in further detail.