Control of molding defects using programmed injection velocity