Dale Hart, 54, and Michael Smart, 37, both of Pencoed, and Christopher Bennett, 61, of Port Talbot, pleaded guilty to the production of cannabis.
Newport Crown Court heard police found 692 plants worth around £800,000 at Queens Court, Bridgend Industrial Estate, during a raid last November.
A proceeds of crime hearing will be held in October.
The court heard police raided the unit after members of the public reported a strong smell of cannabis.
Hart was sentenced to five years in prison, Smart was sentenced to three-and-a-half-years and Bennett was given four-and-a-half years.

Bob Neill was speaking after ministers claimed there had been a "relentless campaign of distortions and half-truths" about the move.
The changes come into force on 1 April as a result of a revaluation of premises carried out by the government.
Business groups and some Tory MPs have warned of high street store closures.
As a result of the government's revaluation, ministers say three quarters of businesses' rates will either go down or stay the same - but ministers have faced calls for a rethink, with claims retailers in some areas could face rises of up to 400%.
In a letter to Conservative MPs, Local Government Secretary Sajid Javid and Treasury Chief Secretary David Gauke said: "This year's revaluation has been preceded by a series of reports claiming that rates are going to soar, that appeals are being banned and that hundreds of thousands of businesses will be forced to close.
"Such claims are simply untrue."
The ministers said 2017-18 "will see the biggest ever cut in business rates" and "three-quarters of all businesses, right across the country, will see their rates either fall or stay the same".
They said the "misinformation circulating in the news" meant it was "understandable that business owners and lobby groups have raised concerns with many of you", but they insisted the changes coming into effect in April were "not something to be afraid of".
But speaking on BBC Radio 4's The World at One, Mr Neill, the Conservative MP for the South London constituency of Bromley and Chislehurst, said the government had "swallowed a line" from the Valuation Office Agency, the organisation that handles property valuations relating to tax changes, which was "wholly out of touch".
He said high street shops in London and the South East would be particularly badly-hit, adding: "I think that the concern is genuine and there are sensible things that the government can do to address this."
Mr Neill said the "cliff edge" system should be replaced by a sliding scale and that businesses should be given more time to adapt.

The 58-year-old moved from his position as chief executive to director of football earlier this year.
Spireites director Ashley Carson said the role was now "redundant".
Turner, who joined Chesterfield in 2011, told the club website: "I am very disappointed to be leaving Chesterfield, but I can understand the situation and I leave on good terms."

Shiv Kumar Yadav has also been charged with "criminal intimidation" of the 26-year-old woman, reports said.
The victim had used the Uber smartphone app to book a taxi home but said she was taken to a secluded area and raped.
Delhi later banned Uber and several other web-based taxi firms for failing to carry out adequate driver checks.
Although the driver has not yet given a statement in public, police say he has confessed to the crime. They say he has also been identified by the victim.
Rape and the issue of sexual violence against Indian women have been in the spotlight in recent years ever since a 23-year-old physiotherapy student was gang-raped and murdered in Delhi in December 2012.
The crime prompted global outrage and a tightening of the laws on sexual violence, but correspondents say they have failed to act as a deterrent.
Earlier this month, five men were arrested in Calcutta for kidnapping and repeatedly raping a Japanese student.
And in the northern Indian state of Uttar Pradesh, two policemen were arrested for allegedly abducting and raping a teenager.
Three men who ran a cannabis factory yards from police headquarters in south Wales have been jailed.
[NEXT_CONCEPT]
Critics of the government's planned changes to business rates are raising "genuine" concerns, a former local government minister says.
[NEXT_CONCEPT]
Chesterfield director of football Chris Turner has left the struggling League One club.
[NEXT_CONCEPT]
A court in the Indian capital has formally charged a driver of the Uber web-based taxi firm with the rape and kidnapping of a passenger last month.