For Flats, only the focus and orientation has to be the same.
Not ISO or length.
I put the DSLR in P (Program Mode).
Set ISO to 100.
Take an exposure and check the histogram is 1/3 rd of the way along from the left.
Take a lot and an odd number of flats.
Also I move the camera/scope slightly around the Flats Screen/Light Panel every few shots to avoid any hot spots.
I use P mode and stick to 100 ISO (giving lower noise, better signal) because it initially gives me a histogram close to what I'm after, 1/3 to 1/2 way across.
If it's not close to that I can switch to manual and tweak the setting I got from the P settings to get the ideal histogram.
I use an odd number because I 'median combine' the flats and the 'math algorithm' used in 'median combine' works better with an odd number of frames.
RB