The use of the present perfect in the if-clause of a first conditional is completely correct, as instead of the present simple you can use the present perfect (here to stress that something has been done before).
Also keep in mind that you can use the progressive forms of the present tenses in the if clauses, depending on what you want to say.
"If I'm working tomorrow, I'll tell you."
As for the second conditional, you could also use the structure "If I were to..." which can be used in the place of the past tense in the if-clause.
So you can either say,
"If you did your homework by 3 am, I would give you an ice-cream." or
"If you were to finish your homework by 3 am, I would give you an ice-cream."
Remember also that the past tense in a second conditional is not a "real past", as it refers to actions in the present or the future.