mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
3.5 KiB
3.5 KiB
Module 6060-PUSH
SKU:K028
Description
This an application-level module, which implements a motion & robotic control and it is totally customizable with different length. Packed with Stepper motor, Mega328 microprocessor, RS485 serial bus, 1515 framework. It realized a linear motion control, you can program the stepper motor to move a certain length with high precision. This type of module can be applied to 3D print, linear push and etc.
Product Features
- Mega328 inside: GRBL
- Customizable: length & distance
- RS485
- 1515 Aluminium Profile frame
- 48 stepper motor: 2 phase 4 lines
- Itinerary: 57mm
- Input voltage: 12-24V
- Motor power: 10W
Include
- 1x 6060 module
Applications
- 3D printer
- Linear motion
Specification
| Resources | Parameter |
| Net weight | 569g |
| Gross weight | 569g |
| Product Size | 166*60*60mm |
| Package Size | 166*60*60mm |
Example
- Control instruction
//Check ID - return ???\r\n
ID\r\n
//Set Device ID
ID=???\r\n
//Move
ID???:X???.?\r\n
//Read Pos
ID???P\r\n
//Find Zero
ID???Z\r\n
//Set Feed Speed (mm/sec)
ID???:F?????\r\n
//Read Busy?
ID???I\r\n
#include <M5Stack.h>
#define RX_PIN 16
#define TX_PIN 17
#define X_LOCAL 40
#define Y_LOCAL 40
#define X_OFF 160
#define Y_OFF 30
int distance = 0;
void header(const char *string, uint16_t color){ //Title
M5.Lcd.fillScreen(color);
M5.Lcd.setTextSize(1);
M5.Lcd.setTextColor(TFT_MAGENTA, TFT_BLUE);
M5.Lcd.fillRect(0, 0, 320, 30, TFT_BLUE);
M5.Lcd.setTextDatum(TC_DATUM);
M5.Lcd.drawString(string, 160, 3, 4);
}
void setup() {
M5.begin();
M5.Power.begin();
header("PUSH 6060", TFT_BLACK);
M5.Lcd.setTextFont(2);
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
Serial2.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN); //Configure serial port 2
delay(500);
Serial2.print("ID=123\r\n"); //Serial port 2 output ID=123\r\n, configuration 6060 motor ID is 123
}
void loop() {
if(M5.BtnA.wasPressed()){ //Press button A to send ID\r\n to view 6060 motor ID.
Serial2.print("ID\r\n");
}
if(M5.BtnB.wasPressed()){ //Press button B to send the ID123: X%d\r\n to control the absolute travel, where %d is the variable distance
if(distance < 50){
distance +=10;
Serial2.printf("ID123:X%d\r\n",distance);
}
}
if(M5.BtnC.wasPressed()){ //Press C to send ID123Z\r\n and the motor returns to the origin.
Serial2.print("ID123Z\r\n");
}
if(Serial2.available()){ //Serial port 2 receives the message returned by 6060 and prints
char c = Serial2.read();
Serial.print(c);
}
M5.update();
}
Related Link
- Datasheet - Mega328P

