A controversy over federal farm programs ended yesterday as the House approved a package of changes to the new farm law that could put more money in farmers' pockets.

A 283-to-97 vote accepting "technical corrections" passed Wednesday by the Senate cleared the legislation for President Reagan's expected signature.

The fight over amendments to the basic farm law, which was enacted less than three months ago, delayed farmers' signups for support programs and stirred debate over the administration's management of them.

The changes approved yesterday would increase support costs by about $160 million, but the extra spending would be offset by cuts in new export subsidy programs.

Another provision would free dairy farmers from a mandatory 4.3 percent cut in milk support prices that is required by the Gramm-Rudman-Hollings deficit-reduction law.

Rep. Barney Frank (D-Mass.), a frequent critic of the dairy program, was defeated, 267 to 120, in an attempt to delete the dairy exemption, which he said was special treatment.

Dairy state lawmakers said the required $80 million reduction could be achieved more efficiently, and with less threat to farmers' economic stability, by raising the fees that dairymen pay to help finance the support program.

Sen. Robert W. Kasten Jr. (R-Wis.), a leader in the effort to exempt price supports from the Gramm-Rudman-Hollings cuts, said the bill would mean an extra $1,000 this year for the average dairy farmer in his state, the nation's leading milk producer.

Other provisions of the package could increase income subsidies to farmers by changing the formulas for calculating their crop yields and by providing additional payments to certain wheat farmers for retiring acreage from production.

Another key element of the package would bar farmers who idle subsidized cropland from using that land to grow unsubsidized crops such as vegetables and fruits.

The law enacted in December encouraged farmers to divert their idled acreage to alternative crops. Unsubsidized growers protested that this would create unfair competition and glut their markets.

On the other side of the Capitol yesterday, the Senate voted 95 to 2 to confirm Richard E. Lyng as secretary of agriculture. Sens. William Proxmire (D-Wis.) and Donald W. Riegle Jr. (D-Mich.) voted against Lyng, who is expected to be sworn in by week's end.