Davem, if your motor is not internally protected against overload, most newer single phase motors are, then you need a motor controller with thermal overloads or fuses.And the fuses or overloads must be sized properly.If your panel with the breaker suppling the feeder to the conroller is within sight and generally this is considered to be no more than 50 feet.Your panel breaker is fine if it meets the above.You 18 amp motor on #10 wire should use a 30 amp HCAR rated breaker to avoid nuisance tripping on start up . This stuff goes on and on to meet the requirements of the national electrial Code.
So anyway,lets say the motor is internally proteced against overload. The compressor has a pressure switch? is the swith amp rating more than the motor? If so, install a disconect if the panel is not in sight. The disconnect switch can be a general duty 30 amp 240 volt unfused 2 pole.Run one wire from there , through the switch in series, then to the motor. The other wire does not have to be broken by the switch. This is fine and legal in accordance with the National Electrial code article 430. The controller is not required to break all circuit conductors if not used as a disconnecting means. If by chance, the switch is two pole, great, run both wires through it. Using "Romex or NM type wiring is legal in a residential setting according to the NEC, there might be a few places that its use in this case might raise an eyebrow. The wiring that goes to the actual motor or compressor must be stranded wire, either a cord or wire in flexable conduit, to allow for vibration.My 16 amp 240 volt compressor has been wired this way, a simple pressure switch, for 8 years.I suspect that you may not want to get all involved here, it won't get inspected and you need the thing running. Remember , don't butcher anything, use a proper ground, proper wiring methods. If something happens, like a fire or you buddy gets zapped by your compressor ,your insurance co may have a fit and hold you responsible.