Even Grand Canyon, especially the south rim, and Yellowstone will eat most of your time and you spend a lot of time driving. Rushmore/Badlands/Devils Tower won't be a problem since they are on the direct route Chicago to Yellowstone.
Yosemite is out of the question unless it is the sole target of your trip. It's two days to Yosemite from Grand Canyon, and the same back. Plus getting a campground inside Yosemite is on a lottery system and a 40 ft RV probably can't find a space inside the Valley. You'll be camping outside the park.
Also let me point out these parks are huge, to drive from one side of Yellowstone to the other is an all day affair and the same with Yosemite. Of course Yellowstone has horrible traffic which adds to the problem. They all have low speed limits and the Rangers will ticket you.
Since you have an RV this hopefully won't be your last trip, so I suggest:
1) Go to California do Yosemite, Lassen, Kings Canyon maybe Death Valley. Hit the Rushmore area on the way in or out. Lots of time in the car for this.
2) Do the Utah/GC loop: Go to Grand Canyon North Rim, Zion, Bryce, and Arches.
3) Do Yellowstone, Tetons and maybe Glacier. Yellowstone really deserves a week.
For all of these trips hit the Rushmore area on the way in or out. Rushmore is worth about 2 hours and Devils Tower the same. Do all three, one a year.`
As for timing, it depends on the winter snowfall. To be safe plan on July or maybe late June.