![]() Using the TinyG JSON server and the serial port used by our TinyG board (ls /dev/ttys.*) we were able to connect the TinyG to three motors, and have it running all three axes at once. We're not sure if this was just a connection issue, but a top speed of F600 was achieved after reconnecting one of the motors. After some adjustments, this number fell to F250. However, we struggled to find a point at which the trimpots affected the upper limit, while the motor itself refused to run at higher than F380 without stalling, which seemed like a relatively low speed. According to the TinyG documentation, we could use the trimpots (plastic screws near each motor input) nearest to each axis to fine-tune the amount of voltage going into each motor. Overdriving the motor draws more current and results in overheating and thermal shutdown. The next step was to find the limits of the stepper motor which turned out to be quite challenging. ![]() A standard block might be 'G1 F400 X300', indicating linear interpolation 'G1' which finds the straight path between the current position and the next, an 'F400' feedrate of 400mm/minute, and a movement to 300mm on the X-axis, depending on whether the movement is set to relative or absolute. We then proceeded to spin the motors according to the default G-code presets.Ī note on G-Code. We then wired the motors by finding the coil pairs which was fairly simple. We then set up Coolterm and established a simple serial interface with the TinyG. The next step was to establish the USB connection and install the FTDI drivers for Mac. For our initial tests, we used the power supply available in the arch shop, and set the voltage to 24 volts. We made sure to wire the power input correctly. The first step was to connect to the power. What this means is that if there is no data present when the read method is called then PHP will block (halt) until data is received or the PHP execution time is reached.SThe documentation provided for TinyG was quite exhaustive which made the process of setting up and testing the TinyG a lot easier than we had thought. Important note: PHP Direct IO does not currently implement a timeout on reads and is blocking. Then type into the terminal on the other end of the connection, this will be echoed back onto the web browser window. In a Web Browser open the file, the other end of the serial port should show ‘HELLO WORLD!’. To find all the names of Brainboxes serial ports installed on UNIX type ls /dev/cu.usbserial* into the terminal. ![]() Unix systems the port name is ‘/dev/cu.usbserial-XXXXXXXXX’ where ‘X’ is a randomly assigned id.Windows the port name should be ‘comX:’ (X being the port number assigned name must be lower case and a colon at the end) this can be found by opening Device Manager.The sample script has some settings to be configured at the top, most importantly the port name. Configure PHP file with correct local serial port settings We also recommend opening the other side of the serial connection in the terminal initially to confirm that data is definitely able to be sent and received across the connection. On a windows system we recommend using Putty and on Mac OSX CoolTerm (see this FAQ for more details) to configure a serial for for transmitting and receiving data. In order to test sending and receiving serial data in PHP, the other end of the serial port should be open. Open terminal program at other end of serial connection Navigate to the file the a web browser to confirm that an error is not produced which tells you to install PHP Direct IO. Windows: restart IIS webserver, or WAMP serverĭownload the file above and place it in your web-servers root directory.Unix: commands vary, on mac for example: sudo apachectl restart.To the bottom of the php.ini file add the following. Next the php.ini file needs to be updated to tell it to use the extension. ![]() The dll file should be copied into your php_extension folder (often located in ext or libphpext ) Configure PHP to use the extension On windows download the latest php direct io extension dll from. On Unix system install the extension using PECL, open a terminal and type: We will use this extension for serial port communication. PHP by default does not offer good COM port support however a PHP extension called Direct IO does offers low level access to IO.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |