Chris BrownAnger Triggered By Bipolar Disorder

2/28/2014 11:15 PM PST

Chris Brown -- Anger Triggered by Bipolar Disorder

EXCLUSIVE

Chris Brown has been diagnosed with bipolar disorder, severe insomnia and Post Traumatic Stress Disorder ... and that's why he has had such anger issues ... this according to new court docs.

Chris was in court today for a progress hearing in the Rihanna beating case. Documents were filed by the facility where Chris just completed 90 days of anger management therapy. In fact, Chris stayed longer, just completing 95 days.

In the legal docs -- obtained by TMZ -- an official from the rehab facility wrote that ... in addition to his diagnosis ... Chris was self-medicating inappropriately.

The facility writes, "Mr. Brown became aggressive and acted out physically due to his untreated mental health disorder, severe sleep deprivation, inappropriate self-medicating and untreated PTSD." They never explain the cause of the PTSD. The letter also says Chris was diagnosed with Bipolar II.

The letter says Chris is on meds for the bipolar and other conditions.

Chris has learned various relaxation exercises, according to the letter, and he's tested negative for drugs, including weed, during his stay.

The facility says he's doing really well. It says he gets up at 5 AM and works hard. They say he's been especially good with community service, saying, "Mr. Brown's attitude has been beyond exemplary in regard to his community service responsibilities."