I have a C5 Nanotec motor controller that is taking an input from an Arduino Mega and switching a 40VDC power supply to the motor. The following is an image of the wiring schema for the controller:
Right now, I have a digital pin 2 connected to Direction, a PWM digital pin 5 connected to Clock, a direct 5V connected to Enable, and a GND connected to GND. The motor is connected to the controller in the correct way.
I am positive the motor is hooked up to the controller correctly, I'm not sure about the Arduino wiring to the controller. I am used to the standard "Direction" and "Step" connections on a motor controller, but I'm not sure what to do with all of these "Clock" and "Enable ports. I've been pouring over the technical details in the manual for the controller and managed to get the controllers working VERY smoothly using an analog input to control speed, but I really need to use the Arduino stepper library to better use the motors more precisely.
Try the first simple test code in this Thread. It is very basic and uses no library. Just make sure you use the correct pins - or modify the code to use your preferred step (clock) and direction pins.
You also need a GND connection between the controller and the Arduino
Try disconnecting the Enable pin, or connecting it to GND.
The Stepper library offers little or no advantage when you are using a proper stepper driver.
Digital 2 --> Direction
Digital PWM 5 --> Clock
Arduino GND --> GND
Yes but you forgot the enable line.
for the stepper library?
What stepper library?
They do not all output step and direction, some output the coil patterns for different types of driver. See the stepper library you use to see if it is a suitable type for your hardware.
omiz144:
Ah, so is the "clock" pin the same as a typical "step" pin?
That's my assumption
Are you saying the Arduino should be connected to the C5 in the following manner;
Digital 2 --> Direction
Digital PWM 5 --> Clock
Arduino GND --> GND
That should work (and you may or may not need to connect ENABLE). However you should note that there is no need to use a PWM pin. Arduino PWM has nothing to do with stepper motors.
Should that be the correct wiring scheme for the stepper library?
I don't know enough about the stepper library to answer your question. Just use the simple code I linked to until you get reliable motion.
I decided that the analog method I had working first is sufficient and my problem was the compatibility of the stepper library I was using and the controller I had wired.
Using analog signals derived from a PWM pin (using an RC circuit) I was able to achieve the precision I required. The analog voltage sets the speed and the + and - direction pins sets the motor turning (along with the enable pin).
The motor specs and shaft dimensions were all I needed to make a few rudimentary calculations and assumptions.