President Carter slipped away from Camp David to visit a second group of private citizens yesterday and prepared for his return to Washington, possibly late today.

Accompanied by his wife, Rosalynn, and a handful of aides, the president flew by helicopter from Camp David to Martinsburg, W.Va., for a 1 1/2-hour meeting with 17 people at the home of Marvin Porterfield, a disabled former Marine Corps pilot and retired cattle farmer.

It was the second time in less than 24 hours that Carter and his wife left the presidential retreat in Maryland's Catoctin Mountains unannounced to seek the views of randomly selected citizens on the problems facing the nation.

The president traveled Thursday night to Carnegie, Pa., a suburb of Pittsburgh, where he talked with a dozen people assembled on the back porch of the home of Bill Fisher, a machinist.

The two excursions were a fitting climax to the extraordinary "domestic summit conference" that Carter has been conducting for more than a week at Camp David, and they left some of the participants impressed but bewildered.

"He didn't know my husband before," said Virginia Porterfield. "We don't know why we were chosen. Well, it was fun. We had a good time."

After his visit to the Porterfield home, Carter returned to Camp David, where he briefed 18 journalists, including David S. Broder and Meg Greenfield of The Washington Post, on why he convened the unusual summit and what he hopes it will accomplish.

The president will return to Washington late today or early tomorrow and deliver a nationally televised address on domestic policy at 10 p.m. tomorrow.

He will follow that Monday with a speech in Kansas City to the National Association of Counties, where he is to detail specific energy proposals.

Yesterday, Carter and his senior advisers, including Vice President Nondale, worked on those speeches and the final details of the president's energy proposals, according to White House press secretary Jody Powell.

Powell said there was no particular pattern in the choice of the two families who received presidential visits. Explaining why Carter made the trips unannounced with little advance notice even to those who were visited, Powell said:

"The president thinks it is important and helpful for him to have conversations with the public in a natural setting.. . .The president regrets not having done more of this up until now."

Powell said the two groups Carter visited were put together by Campbridge Survey Research, the polling firm headed by Patrick Caddell, the president's political pollster. The participants were not told until the last minute that it was the president they would meet with to discuss the state of the nation.

It was clear from the comments of the participants that Carter sounded the two groups on issues well beyond energy to include some of the concerns he vocied to visitors to Camp David, among them a declining confidence of the American people in the future of the country.

"He asked us where we thought the United States would be in five years if we keep going the way we are going," said the 29-year-old Fisher, the president's host Thursday night. "All the guests agreed things would get worse."

Fisher said Carter didn't offer any specific solutions to the nation's problems.

"He asked us to get things off our chests and tell him everything - the oil shortage, the gas lines," Fisher said. "He said he's be taking everything into consideration.

"I told him I thought the country was in a downhilll spiral, too."

Porterfield, the president's host yesterday, said the group at his home "agreed that even though our country has its problems, they are recoverable. But it will take an enlightened Congress, a hard-working executive and an enlightened electorate.

"The people have got to face up to it. When the gas lines disappear, that doesn't mean that our enercy problems have gone out the window."

The briefing at Camp David yesterday, another sign of the importance Carter attaches to the results of the "domestic summit," was the first time the president has been seen by reporters since he secluded himself at the presidential retreat July 3. In addition to Broder and Greenfield, those present were:

Jack Germond and Edwin M. Yoder Jr. of the Washington Star; Tom Wicker and Max Frankel of The New York Times; Anthony Day of the Los Angeles Times; Frank Reynolds of ABC; John Chancellor of NBC; Walter Cronkite of CBS; Hugh Sidey of Time magazine; Marvin Stone of U.S., News & World Report; Jim Lehrer of the Public Broadcasting Service; H. Brandt Ayers of the Anniston, Ala., Star; John McCormally of the Burlington, Iowa, Hawk-Eye; and columnists Carl Rowan, James J. Kilpatrick and Joseph Kraft. CAPTION: Picture, The Porterfields: "We don't know why we were chosen . . . We had a good time." AP