Yes Ultram is a drug that treats chronic pain. It does this by interacting with nerves in the brain that control pain. I suppose its possible that you very quickly built up some tolerance to the drug (?) or that there is some difference between extended release form and the generic. Whatever the case it's your doctors job is to find you the right medication for your pain. Tell him exactly what's going on - how much you are taking and when and what your symptoms are. Some more on Ultram is below.
http://www.healthcentral.com/chronic-pain/find-drug-25432-25.html
Good luck!