I have a project in which database of products is stored in MATLab. In order to store or retrieve a product on/from a shelf, motors are used. Other hardware consists of IR sensors and limit switches. The motors, IR sensors and limit switches are connected to Arduino.
Now I need to know that working of motors and other components should be coded in MATLab (and C Code generated for Arduino)?
Or should MATLab be interfaced with arduino in a way that MATLab tells arduino to the place the product where the shelf is, and arduino code should move the motors?
Now I need to know that working of motors and other components should be coded in MATLab (and C Code generated for Arduino)?
Or should MATLab be interfaced with arduino in a way that MATLab tells arduino to the place the product where the shelf is, and arduino code should move the motors?
If the product is on the third shelf in the second column in the 5th row, does the Arduino have a clue how to get there? If not, expecting the Arduino to drive the motors to move a mechanism to that location is unrealistic.
It seems like you are trying to build a 3D CNC machine. The Arduino needs to accept M and G codes (GRBL) that define how far to make each motor move. All that it needs to do is read the GRBL data and make the motors move appropriately. Generating the M and G codes is the PC's responsibility.
Yes, it is like CNC machine. But I was thinking to feed the steps of stepper motor and position beforehand.
Like how many steps in horizontal and vertical direction to reach a position, and those steps are controlled by Arduino.
In what program can G and M codes be generated in PC?
Because the actual task is about books. The user inserts a book and the cartesian takes a book and places it into an empty shelf. The shelf position and book information gets stored. The user then selects another book from user interface and cartesian manipulator gets that book from the shelf.