The mining industry has undergone big changes ever since the commodities "super cycle" ended three years ago. Increasing environmental concerns over mining proved a double whammy even as miners battled plummeting commodities prices in the wake of a slowdown in key consuming markets like China. Prolonged weakness has forced mining companies to axe non-core operations and curb capital spending, bringing growth at mining-equipment manufacturers to a halt.

But that doesn't mean you should write off mining-equipment companies just yet. Analysts at Wood Mackenzie project 2018 global demand for base metals to be 27% higher versus 2013, and the Freedonia Group forecasts global demand for mining equipment to grow 8.6% annually through 2017. In other words, patient investors in mining-equipment companies can still make great profits. The key is to find companies that are riding out the storm and positioning themselves for a recovery. Two companies in particular appear to fit the bill: Joy Global (NYSE:JOY) and Caterpillar (NYSE:CAT). Here's why: 

Joy Global
Unlike Caterpillar that has three diverse businesses, Joy Global is a pure-play mining-equipment company. The problem with Joy Global is that 59% of its sales depend on coal mining, which is under tremendous pressure largely because of environmental concerns. The silver lining is that the company derives nearly 62% of its sales from outside North America. Industry experts project regions like the Asia-Pacific and Latin America to lead recovery in the mining industry.

Source: Joy Global presentation at Bank of America Merrill Lynch Global Industrials and EU Autos Conference, March 2015

The key to survival for mining companies will be mechanization of production techniques and equipment that can yield more at lower costs. Joy Global understands this well, which reflects in its new products such as low-seam longwall (used in underground mining) that can produce 40% more with 70% lesser manpower and more fuel-efficient diesel/electric hybrid shovel.

Joy Global is also investing more on big data, connecting its machines to a monitoring network for continuous tracking to prevent breakdowns and optimal usage. In fact, Joy considers this a massive business opportunity. At the same time, the company is using this downturn as an opportunity to build upon its expertise areas such as underground hard rock mining through bolt-in acquisitions, having acquired two related businesses over the past year.

What I particularly like about Joy Global is its strong balance sheet. Despite challenging business conditions that have wiped out nearly a third of its revenue and more than half its net income since 2012, Joy is still cash flow positive. Moreover, aggressive restructuring has helped management trim costs and maintain healthy operating margins of around 12%. Thanks to that, an interest coverage ratio (company's operating income relative to its interest burden) of nearly 6.7 times places Joy in a comfortable position to service debts. There's still scope for the company to cut costs further.

Source: Joy Global presentation at Bank of America Merrill Lynch Global Industrials and EU Autos Conference, March 2015

Given Joy's strong financials, judicious capital spending, and restructuring efforts, there's no reason why it shouldn't emerge a winner when things turn around.

Caterpillar reinforced its position as the world's leading mining-equipment manufacturer when it acquired mining-machinery company Bucyrus International for $8.8 billion in 2011. Today, Caterpillar offers the broadest range of products that cater to every aspect of mining.

While leadership position gives Caterpillar strong pricing power, expansive dealership network has helped it penetrate markets across the globe. For perspective, only 36% of Caterpillar's resource industries (mining) sales came from North America last year. Asia-Pacific and Europe, Africa, Middle East regions made up nearly a quarter each of its mining sales. So Caterpillar could be the biggest beneficiary as international mining markets recover.

Caterpillar's autonomous 793F mining truck. Source: company website

With mining companies scrambling to lower costs and improve productivity, Caterpillar is not only going big after technology. It formed a new division -- analytics and innovation -- this past April to exploit opportunities in data analytics, but it's also leading the way in automated machinery. After trying out six of Caterpillar's autonomous 793F trucks, mining giant BHP Billiton added another six to its fleet last year. Automation is clearly a big opportunity for Caterpillar.

Meanwhile, Caterpillar is restructuring its operations in the wake of current challenges: Its employee count as at the end of first quarter was roughly 3% lower year over year, with the bulk of downsizing coming off its mining operations. The company now expects to incur an extra $100 million in restructuring costs this year because of further mining-related cost reductions. These moves should help Caterpillar rein in falling mining profits.

There's no arguing that the slowdown in mining has hit Caterpillar hard: Resource industries contributed only 18% to its revenue last year compared to 32% in 2012. But that also shows what a big revenue machine mining can be for the company once conditions improve. For an investor, it also helps that Caterpillar's other businesses of construction and energy and transportation are helping it sail through while mining recovers. Thanks to its diversity, Cat still boasts an operating margin of 10%, interest coverage of nearly 13 times, and return on equity of about 21%.

Caterpillar currently trades for 17.77 times forward earnings according to S&P Capital IQ estimates, while Joy Global trades for 15.66 times forward earnings. Which stock you choose largely depends on where your interest lies: If it's pure mining that you want to bet on, Joy Global is clearly the one to go for.