When the diesel motor the EE was operating derailed, the EE struck his left knee against a SCSR box. The incident was caused by the EE's failure to react to the rail conditions and maintain operating control. The EE had on the proper protective items and was compliant with rules and regulations. He was properly trained and has a positive attitude towards safety.