Skip to content

Commit

Permalink
Merge pull request #6 from ponoor/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kanta authored Sep 3, 2021
2 parents e89f1a5 + 271681a commit 0364bd8
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 128 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# STEP800
8-axis stepper motor driver for Open Sound Control

![step800_r1_1](https://user-images.githubusercontent.com/1097902/131634424-28f9508c-f418-4d1a-af06-ffac0bb8adc5.JPG)

STEP800 is a 8-axis stepper motor driver designed for art or design projects. STEP800 combines the following elements into one single board:

- [Arduino Zero](https://www.arduino.cc/en/Guide/ArduinoZero)
- Ethernet shield
- 8 stepper motor drivers
- Sensor inputs for homing

The current firmware is focused on working with [Open Sound Control](http://opensoundcontrol.org/) (OSC) via Ethernet, which is a common protocol for creative coding environments, like openFrameworks, Processing, Max, Unity, or Touch Designer.

Stepper driver chips are STMicroelectronics's [L6470](https://www.st.com/en/motor-drivers/l6470.html) which provide most of functionalities as a stepper driver.


Friend of STEP800 : [STEP400](https://github.com/ponoor/STEP400)

## Documentation
https://ponoor.com/en/docs/step-series/

Forum: https://github.com/ponoor/step-series-support/discussions

## Repository Contents
### Firmware
These 2 folders contain same codes.
- [/STEP800_firmware](https://github.com/ponoor/STEP800/tree/main/STEP800_firmware) : Arduino Sketch folder
- [/firmware-platformIO/STEP800_firmware](https://github.com/ponoor/STEP800/tree/main/firmware-platformIO/STEP800_firmware) : PlatformIO folder

### Hardware
[/hardware](https://github.com/ponoor/STEP800/tree/main/hardware) : Eagle design files, BOM lists, and a schematics PDF

### Others
[/configTool](https://github.com/ponoor/STEP800/tree/main/configTool) : The configuration tool consists of a html and JavaScritpts.

## Firmware dependency
- **[OSC Library](https://github.com/CNMAT/OSC)** from CNMAT
- **[Ponoor L6470 Library](https://github.com/ponoor/Ponoor_L6470_Library)**
- **[ArduinoJSON Library](https://arduinojson.org/)**
- **[Adafruit SleepyDog Arduino Library](https://github.com/adafruit/Adafruit_SleepyDog)**


2 changes: 1 addition & 1 deletion STEP800_firmware/STEP800_firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const char *firmwareName = "STEP800_PROTO_BLACK";
#else
const char *firmwareName = "STEP800_R1";
#endif
const uint8_t firmwareVersion[3] = {0,1,0};
const uint8_t firmwareVersion[3] = {0,1,1};
const uint8_t applicableConfigVersion[2] = {1,0};

// L6470
Expand Down
100 changes: 37 additions & 63 deletions STEP800_firmware/diagnosis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ void printCurrentState() {
showBoolResult(F("SD config file open succeeded"), configFileOpenSucceeded);
showBoolResult(F("SD config JSON parse succeeded"), configFileParseSucceeded);

printHeader("PowerSTEP01");
printHeader("Motor Driver");
uint16_t status[NUM_OF_MOTOR];
uint32_t temp = 0;
for (uint8_t i = 0; i < NUM_OF_MOTOR; i++) {
status[i] = stepper[i].getStatus();
temp += status[i];
}
showBoolResult(F("PowerSTEP01 SPI connection established"), temp != 0);
showBoolResult(F("L6470 SPI connection established"), temp != 0);
if (temp != 0) {
for (uint8_t i = 0; i < NUM_OF_MOTOR; i++)
{
temp = 0;
p("PowerSTEO01 ID#%d\n\tSTATUS: 0x%02X\n", i + 1, status[i]);
p("L6470 ID#%d\n\tSTATUS: 0x%02X\n", i + 1, status[i]);
bt = (status[i] & STATUS_HIZ) > 0; // HiZ, high for HiZ
showBoolResult(F("\tHigh impedance state"), bt);
showBoolResult(F("\tBUSY"), !(status[i] & STATUS_BUSY));
Expand Down Expand Up @@ -196,18 +196,6 @@ void printCurrentState() {
else {
p("-HOME senser input open.\n");
}
// ADC
temp = stepper[i].getParam(ADC_OUT);
p("\tADC_OUT: %d ", temp);
if (temp >= 28) {
p("-LIMIT senser input open.\n");
}
else if (temp < 5) {
p("-LIMIT senser input closed.\n");
}
else {
p("Unexpected value.\n");
}
}
}

Expand All @@ -223,7 +211,6 @@ void printCurrentState() {
printAllData(F("Homing status"), homingStatus);
}


void printConfigurations() {
boldHeader("Configurations");
printHeader("Config file");
Expand Down Expand Up @@ -257,12 +244,11 @@ void printConfigurations() {
showBoolResult(F("isDestIpSet"), isDestIpSet);
showBoolResult(F("reportErrors"), reportErrors);

printHeader("Report & Alarm");
showAllBools("reportBUSY", reportBUSY);
printHeader(F("Report & Alarm"));
showAllBools(F("reportBUSY"), reportBUSY);
showAllBools(F("reportBUSY"), reportBUSY);
showAllBools(F("reportHiZ"), reportHiZ);
showAllBools(F("reportHomeSwStatus"), reportHomeSwStatus);
// showAllBools(F("reportLimitSwStatus"), reportLimitSwStatus);
showAllBools(F("reportDir"), reportDir);
showAllBools(F("reportMotorStatus"), reportMotorStatus);
showAllBools(F("reportSwEvn"), reportSwEvn);
Expand All @@ -275,52 +261,39 @@ void printConfigurations() {

printHeader("driverSettings");
showAllBools(F("homingAtStartup"), bHomingAtStartup);
// showAllBools(F("homingDirection(1:FWD,0:REV)"),homingDirection);
p("homingDirection(1:FWD,0:REV) : %d, %d, %d, %d\n", homingDirection[0], homingDirection[1], homingDirection[2], homingDirection[3]);
p("homingDirection(1:FWD,0:REV) : %d, %d, %d, %d, %d, %d, %d, %d\n", homingDirection[0], homingDirection[1], homingDirection[2], homingDirection[3], homingDirection[4], homingDirection[5], homingDirection[6], homingDirection[7]);
printAllData(F("homingSpeed"), homingSpeed);
printAllData(F("homeSwMode"), homeSwMode);
showAllBools(F("prohibitMotionOnHomeSw"),bProhibitMotionOnHomeSw);
// printAllData(F("limitSwMode"), limitSwMode);
// showAllBools(F("prohibitMotionOnLimitSw"),bProhibitMotionOnLimitSw);
printAllData(F("goUntilTimeout"), goUntilTimeout);
printAllData(F("releaseSwTimeout"), releaseSwTimeout);
printAllData("microStepMode", microStepMode);
// showAllBools(F("isCurrentMode"), isCurrentMode);
printAllData("slewRate", slewRateNum);
printAllData(F("microStepMode"), microStepMode);
printAllData(F("slewRate"), slewRateNum);
showAllBools(F("electromagnetBrakeEnable"), electromagnetBrakeEnable);
printAllData(F("brakeTransitionDuration"), brakeTransitionDuration);

printHeader("speedProfile");
printAllData("acc", acc);
printAllData("dec", dec);
printAllData("maxSpeed", maxSpeed);
printAllData("fullStepSpeed", fullStepSpeed);

printHeader("Voltage mode");
printAllData("kvalHold", kvalHold);
printAllData("kvalRun", kvalRun);
printAllData("kvalAcc", kvalAcc);
printAllData("kvalDec", kvalDec);
printAllData("intersectSpeed", intersectSpeed);
printAllData("startSlope", startSlope);
printAllData("accFinalSlope", accFinalSlope);
printAllData("decFinalSlope", decFinalSlope);
printAllData("stallThreshold", stallThreshold);
printAllData("lowSpeedOptimize", lowSpeedOptimize);
printHeader(F("speedProfile"));
printAllData(F("acc"), acc);
printAllData(F("dec"), dec);
printAllData(F("maxSpeed"), maxSpeed);
printAllData(F("fullStepSpeed"), fullStepSpeed);

// printHeader("Current mode");
// printAllData("tvalHold", tvalHold);
// printAllData("tvalRun", tvalRun);
// printAllData("tvalAcc", tvalAcc);
// printAllData("tvalDec", tvalDec);
// printAllData("fastDecaySetting", fastDecaySetting);
// printAllData("minOnTime", minOnTime);
// printAllData("minOffTime", minOffTime);
printHeader(F("Voltage mode"));
printAllData(F("kvalHold"), kvalHold);
printAllData(F("kvalRun"), kvalRun);
printAllData(F("kvalAcc"), kvalAcc);
printAllData(F("kvalDec"), kvalDec);
printAllData(F("intersectSpeed"), intersectSpeed);
printAllData(F("startSlope"), startSlope);
printAllData(F("accFinalSlope"), accFinalSlope);
printAllData(F("decFinalSlope"), decFinalSlope);
printAllData(F("stallThreshold"), stallThreshold);
printAllData(F("lowSpeedOptimize"), lowSpeedOptimize);

printHeader("Servo mode");
printAllData("kP", kP);
printAllData("kI", kI);
printAllData("kD", kD);
printHeader(F("Servo mode"));
printAllData(F("kP"), kP);
printAllData(F("kI"), kI);
printAllData(F("kD"), kD);
}

void printTitle(String title) {
Expand All @@ -334,26 +307,27 @@ void showBoolResult(String title, bool val) {

template <class T>
T printAllData(String title, T* val) {
String out;
printTitle(title);
for (uint8_t i = 0; i < NUM_OF_MOTOR; i++)
{
SerialUSB.print(val[i]);
if (i < (NUM_OF_MOTOR-1)) SerialUSB.print(", ");
out += val[i];
if (i < (NUM_OF_MOTOR-1)) out +=", ";
}
SerialUSB.println();
SerialUSB.println(out);
}


void showAllBools(String title, bool* val) {
String out;
printTitle(title);
SerialUSB.print(" ");
for (uint8_t i = 0; i < NUM_OF_MOTOR; i++)
{
String res = (val[i]) ? "Yes" : "No";
SerialUSB.print(res);
if (i<(NUM_OF_MOTOR-1)) SerialUSB.print(", ");
out += (val[i]) ? "Yes" : "No";
if (i<(NUM_OF_MOTOR-1)) out +=", ";
}
SerialUSB.println();

SerialUSB.println(out);
}

void showIpAddress(String title, IPAddress ip) {
Expand Down
Loading

0 comments on commit 0364bd8

Please sign in to comment.