i have a mechanical setup with 2 dc-motor'shttp://www.faulhaber.com/uploadpk/EN_3557_CS_DFF.pdf with on the back of each motor an encoder(HEDS 5500) http://www.faulhaber.com/uploadpk/EN_HEDS_HEDM_DFF.pdf. The encoder has 2 channels 90degrees shifted with a 500 puls/rev output of 2.4V
both motors drive a ball screw spindle of about 100mm long and a pitch of 1mm. (directly shaft driven)
So i want to position the nut of both spindles starting from a reference point (sensor) which i detect on start up (homing procedure).
Can i control this all with one arduino uno i have?
because i think i need 4 external interrupts. 1 for each encoder channel. and i only have 2 on the Uno. or should i use only channel per encoder? but then i don't know the rotation direction i think...?
software:
for the position control i need to make a PID control per motor, or can i use a simpeler way? (the load is always the same)
or should i better use a MEGA to control everything?
i couldn't find a similar arduino project to look up how someone else would do this, thats why i want some help.
Can i control this all with one arduino uno i have?
because i think i need 4 external interrupts. 1 for each encoder channel. and i only have 2 on the Uno. or should i use only channel per encoder? but then i don't know the rotation direction i think...?
You've set the motor spinning in one direction, haven't you? You should be able to read just one channel, to get the number of pulses. The direction is implied by the direction the motor is going.
for the position control i need to make a PID control per motor
Why? PID is used when there is not a direct, immediate relationship between an action and a reaction. For instance, if you set the PWM out to 150, and an LED is attached, the LED will nearly instantaneously reach the specified brightness. So, PID is not needed.
On the other hand, if you apply PWM to a motor, it can take a measurable amount of time for the motor to get to speed (especially if you are measuring the speed of a robot rather than the motor), so, you'd apply a higher than necessary PWM value, and then ramp that down as the robot came up to speed. PID measures the input (speed), and computes an output (PWM value) based on the difference between the input and a set point (desired speed).
As the robot goes over varying terrain, and wheel slippage occurs, the PWM value is increased to maintain a constant forward speed. If the wheel slippage is reduced (off the ice onto pavement), PWM can be reduced to maintain a constant speed.
So, what is it that PID will do for your situation?