I m doing a robotic project and I planned to use 3 of these motors with enoders http://www.pololu.com/catalog/product/2286 in the project. I planned to control them using Arduino Mega 2560. I have a doubt that the Arduino Mega 2560 is able to handle the 3 encoders. I found that this library can be use for the encoder interfacing Encoder Library, for Measuring Quadarature Encoded Position or Rotation Signals. Is it possible to handle these 3 motors with encoders from the Arduino Mega 2560 ? Controlling of 3 stepper motors and serial communication also need to done while controlling the 3 dc motors with encoders by the Arduino. Can these all the things do by Arduino Mega 2560 ? Please someone help me.
In the project Arduino is going to do serial communication with a PC ( getting data from the PC ). According to the data got from the PC. Arduino Mega 2560 need to control 3 stepper motors, and 3 dc motors with encoders (some small processing of the data is also need to done ). No any other input or outputs. Therefore 6 interrupts pin can be used for the encoders. Encoder readings and the stepper motor steps are need to store in the EEPROM. Therefore EEPROM write is also need to done. Is processing power of Arduino Mega 2560 is enough for the handling 3 encoders with high pulse rate (around 4500 pulses per second from each encoder) ? Can I use arduino mega 2560 for this ?
The answer is probably yes, but it all depends on the rest of the code being fast as well. 4500 pulses per second is slow to the Arduino which is clocked at 16,000,000 pulses per second. 4.5KHz vs. 16MHz. Using interrupts is still a great idea and it should make this very doable.
If you were to poll the sensors instead of using interrupts, you would want to make sure the main loop ran very quickly (avoid delays and analog reads).
Encoder readings and the stepper motor steps are need to store in the EEPROM.
Why? EEPROM is for persistent storage. I can't imagine why the stepper position and encoder readings need to be stored in EEPROM, every time a stepper steps or a motor turns.
jroorda:
The answer is probably yes, but it all depends on the rest of the code being fast as well. 4500 pulses per second is slow to the Arduino which is clocked at 16,000,000 pulses per second. 4.5KHz vs. 16MHz. Using interrupts is still a great idea and it should make this very doable.If you were to poll the sensors instead of using interrupts, you would want to make sure the main loop ran very quickly (avoid delays and analog reads).
Thanks jroorda
I planned to use interrupts. Arduino mega 2560 have 6 interrupts pin therefore i can connect 3 quadrature encoders for these 6 pins. My problem is the Arduino need to handle 3 dc motors with encoders, 3 stepper motors and serial communication with a PC. only small calculation are carried out by the Arduino. Can all these things carried out in the Arduino without any problems?
PaulS:
Encoder readings and the stepper motor steps are need to store in the EEPROM.
Why? EEPROM is for persistent storage. I can't imagine why the stepper position and encoder readings need to be stored in EEPROM, every time a stepper steps or a motor turns.
Thanks PaulS
I thought that I can write those data EEPROM for securing motor position in power failure situation or unexpected power disconnection to the circuit. But I found that I coudnt do this because EEPROM only supprot 100000 erase/write cycles.
Is there any way to secure motor position in non volatile memory ?
But I found that I coudnt do this because EEPROM only supprot 100000 erase/write cycles.
Is there any way to secure motor position in non volatile memory ?
Writing into EEPROM takes milliseconds, so it is hardly to be achievable at 3x4.5kHz rate.
You may use an SPI based external MRAM or FRAM - they are as fast as sram, unlimited endurance and nonvolatile.
pito:
But I found that I coudnt do this because EEPROM only supprot 100000 erase/write cycles.
Is there any way to secure motor position in non volatile memory ?Writing into EEPROM takes milliseconds, so it is hardly to be achievable at 3x4.5kHz rate.
You may use an SPI based external MRAM or FRAM - they are as fast as sram, unlimited endurance and nonvolatile.
Thank you
Can you give me some links for the products ? I coudnt find a product.