I see a lot of anti-LE/anti-BP posts here, but I wonder what these same people's posts would be if this was a thread about illegal immigrants infiltrating the US to work manufacturing jobs, or about drug smuggling and it's effects on our society. (And this is not either of those...I don't want to get this spun off topic!). To fellow LEOs/citizens in support, bottom line is that with many folks there IS no winning--we're either lazy, corrupt or complicit if illegals keep crossing or if drugs keep flowing into their communities or we're a bunch of over-zealous repressive fascists if they happen to get stopped (and released) while we are trying to interdict those illegals/drug dealers they complain about.
That having been said, Art Eatman is right on the money about how to handle yourself. 90% of the way many of my interactions with the public go is determined by how the citizen acts. If you're polite/co-operative/friendly then most of us will respond in kind--you might still get detained/arrested depending on what you're doing, but HOW you get arrested and what treatment or consideration you get during the charging process can be affected significantly. Should I remain professional with someone who is unnecessarily abusive or belligerent during a legal stop? Yes. Can I detain them as long as it takes to make any checks on their paperwork, and can I issue out as many citations as I can find on your car or paperwork instead of giving you a warning for speeding/failing to signal/whatever? You betcha! Can I push for bail to get you lodged in jail instead of a summons? MmmHmm (and some southern states can do this for motor vehicle charges, too!) Can I take those tickets/charges to trial and let the prosecutor know I'm looking for maximum penalties instead of dealing out a plea bargain for reduced charges or minimum fines? Oh yeah. And at every one of these choices, it is usually YOUR behavior that will determine which way it goes.
Have I come across "robo-cops" who push (or cross) the boundaries of what is legal? Of course. In those cases, do what some of the other posters have said--calmly and politely state that you object to what they are doing but will comply with them. Do not resist an unlawful arrest, do not obstruct an unlawful search, get names and call your attorney. If what they did was unlawful then you may have grounds for civil and criminal actions against the officer, the officer will have serious problems and in all probability you will have any charges dismissed. You DO have rights, but sometimes you have to have the wisdom to know where the best place to make your stand is. The roadside is usually the WORST place for this but, in my experience, is the place most people choose to do so (especially those who only THINK they know what their rights are).
For what it's worth, I ask "do you know why I stopped you" to see if someone is: a) someone who just wasn't paying attention to what they were doing; b) an honest person who knows they made a mistake; or, c) someone who is going to look me in the eye and lie about running that light or doing 55 in a 25. Oh...and A and B usually get warnings.