Motivate kids for doing homework

It is important make children want to realize their homework. It is a very important moment of the day and we know that kids are tired, but they should do it. 
To encourage them, the bedroom should be pleasant and appropiate. Must not be a place of passage and must not have distractions, but they have to like it. 
Before beginning the homework, we have to know when is the perfect moment for doing homework: until they arrived of school or after a few minutes. It depends of their productive time or eagerness to study. Doing homework always at the same time will create them an habit. 
We have to encourage them and organize homework with kids. For this reason we have to tell them how to estructurate the time: first the homework that don't like and after subjects which like more. 
Having a pleasant space for doing homework will motivate them