Nancy, since it will likely be a complex question for you to understand, I decided to write an answer about it:
What are Participles?
Participles are one of the Non-Finite Verbs which derive from forms of verbs; every verb has 5 forms, split into three categories:
Base Form: (To do),
Tense: Present (Do), Past (Did);
Aspect: Present (Doing), Past (Done);
Participles derive from the aspect and base form since they are the unique ones which don't show tense and thus can't agree with person, tense or number..
Every non-finite verb (base form and participles) can perform three syntax functions:
Nominal, Adjectival and Adverbial.
In this answer, we will focus on Participles acting adverbially:
As adverbs, they can show a few semantic values: Result, Sequence of actions, Condition, Reason...
Having been a teacher for two years, he knows how to handle it -
Getting home, I found the door opened - Time sequence;
Eaten carefully, the food will not damage your health - Condition;
The cables from the Christmas tree fell down, causing the cars to be
electrocuted - Result
As you can see above, they are likely to appear without an explicit subject; when such a thing happens, the subject is understood to be the same as in the matrix (main) clause:
Having been a teacher for two years, he knows how to handle it
means the same as:
Because he was a teacher for two years, he knows how to handle it;
Eaten carefully, the food will not damage your health.
If the food is eaten carefully, the food will not damage your health.
When the subject is non-explicit and you use a different subject from the matrix clause makes the so-called Dangling:
Having been a teacher for two years, the students will enjoy his class
The sentence above would imply that the students have been a teacher for two years, so be careful.