Giter VIP home page Giter VIP logo

nano_stepper's Introduction

Smart Stepper (also known as the nano zero stepper)

Firmware to turn a stepper motor into servo motor: see http://misfittech.net for hardware!

If you have a MKS Servo42, this firmware is not fully tested. MKS has taken this firmware but has not provided source back and hardware designs back to the community. Test submissions are appreciated. Test at you own RISK!

If you want to support the work on the firmware and hardware consider buying hardware from www.misfittech.net or buying me a beer using the donation button.

Donate

How to Install

Hardware install and manual

Arduino install for building firmware

Further Details and to purchase Hardware

Google groups forum

Google groups forum

Command List

Smart Stepper Command Line Interface

The smart stepper uses a command line interface where the prompt is “:>”

help

The help command will return a list of commands that the smart stepper supports.

getcal

This command will print out the 200 point calibration table. This is useful if you are doing firmware development and do not want to calibrate each time you update firmware. You can take this table and copy it into the nonvolatile.cpp file as shown below

calibrate

This will run a 200 point calibration of the encoder.

testcal

This will test the calibration and report the maximum error in degrees.

microsteps

This command gets/sets the number of microsteps the smart stepper will use for the step command and the step pin. The number of microsteps does not affect the resolution of the controller but rather how fine you can set the position.

step

This will move the motor one step clockwise, the step size is based on the current microstep setting. To move the motor counterclockwise use “step 1”. To move the motor clockwise 16 steps used “step 0 16” to move motor counterclockwise 16 steps use “step 1 16”

feedback

This commands disable/enables feedback control loop. The plan is to discountinue this command in the future and use the “controlmode” command to put controller in open or one of the many closed loop operational modes.

readpos

Reads the current motor position and reports it as degrees.

encoderdiag

This command will read and report the AS5047D internal registers for diagnostic purposes.

spid

This command sets the Kp, Ki, and Kd terms for the simple positional PID controller.

ppid

This command sets the Kp, Ki, and Kd terms for the positional PID controller.

vpid

This command sets the Kp, Ki, and Kd terms for the velocity PID controller.

velocity

This sets the velocity to rotate motor when unit is configured for velocity PID mode of operation.

boot

This command will put the microprocessor in the boot loader mode. Alternatively this can be done by double pressing the reset button.

factoryreset

This erases the calibration and other system and motor parameters such that unit is reset to the factory ship state. After this command the unit will need to be calibrated to the motor again.

dirpin

This command sets which direction the motor will rotate when direction pin is pulled high. The direction pin is only sampled when the step pin has a rising edge. ‘dirpin 0’ will set the motor to rotate clockwise when dir pin is high ‘dirpin 1’ will set the motor to rotate counter-clockwise when dir pin is high

errorlimit

Gets set the maximum number of degrees of error that is acceptable, any posistioning error about the error limit will assert the error pin, when error pin is set as error output. For example:

:>errorlimit 1.8 

Will set the error limit to 1.8 degrees.

ctrlmode

Gets/Sets the feedback controller mode of operation. The command takes an integer from 0 through 4 to set the control mode per table below:

  • Controller off - 0 -- this is not currently used
  • Open-Loop - 1 -- this is open loop with no feedback
  • Simple PID - 2 -- simple positional PID, which is factory default
  • Positional PID - 3 -- current based PID mode, requires tuning for your machine
  • Velocity PID - 4 -- velocity based PID, requires tuning for your machine and speed range

If you are unsure what you are doing leave unit in the Simple PID mode of operation.

maxcurrent

This sets the maximum current that will be pushed into the motor. To set the current for maximum of 2.0A you would use command “maxcurrent 2000” as the argument is in milliAmps.

holdcurrent

For the Simple Positional PID mode the minimal current (ie current with no positional error) is the hold current. You set this current based on the required holding torque you need for your application. The higher the hold current, the hotter and noisier the motor will be but also the larger the holding torque. For the Positional PID mode the PID tuning params have to be set correctly such that the control loop will dynamically determine the holding torque. This tuning of the PID can be difficult, hence the simple PID mode will work most of the time out of the box by setting maximum current and holding current.

motorwiring

The firmware always uses a positive angle as a clockwise rotation. A stepper motor however could have wiring done with one coil reversed wired, which will cause motor to normally operate in opposite direction. The Smart Stepper firmware will detect the motor wiring direction, using the encoder, and the firmware will compensate for a reverse wired motor. The reverse or forward wiring of a motor is detected on first power up after factory reset. If the wiring changes after that you can compensate using this command. HOWEVER it is better to do a factory reset and recalibrate motor if wiring changes.

stepsperrotation

The Smart Stepper firmware will with first power on after factory reset detect the number of full steps per rotation for the stepper motor and store in flash memory. This command will read this parameter from flash and allow user to change this parameter if motor is changed. HOWEVER it is better to do a factory reset and recalibrate motor if motorchanges.

move

The move command will request the motor to move to an absolute angle position. Optionally the user can specify the rotational speed (RPMs) by which the move should happen. For example if the current motor position is at angle 0 and you issue ‘move 3600” the motor will turn 10 rotations clockwise to angle of 3600 degrees. If issue the ‘move 3600’ again nothing will happen as motor is already at angle 3600. If motor is at angle 0 and user issues the command ‘move 3600 20’ then motor will move to 10 rotations clockwise to angle of 3600 at a rate of 20 RPMs.

stop

If user issues a move command that takes a long time and wants to stop the move before completion then user can issue the stop command command which will stop a move operation.

setzero

This command will take the current motor position and set it to absolute angle of zero. Note that if you are in the middle move it will take the position at the time of the command and use it, thus it is recommend a move be stopped or wait for completion before issuing the setzero.

data

This command will toggle output of binary data.

looptime

This command will display the time it takes for a single processing loop to execute.

eepromerror

This command displays the motor error in degrees difference from the stored eeprom value at motor power up.

eepromloc

Displays the location of the shaft angle in degrees at motor power on.

eepromwrite

Forces the eeprom to store all current values in ram to eeprom.

eepromsetloc

Forces the eeprom to write the current shaft angle overwriting the stored location from powerup.

setpos

Overwrites the current shaft angle in the motion planner.

reboot

Forces the smart stepper to reboot

homecurrent

If using built in homing routine (command "home") this will specify the amount of current applied when motor is moving during homing operation when homepin is logic active.EXPERIMENTAL USE WITH CAUTION

homepin

Allows setting of pin for current limited enable for homing. This triggers a current drop during homing movements. Current set using command "homecurrent". This pin is pulled low to activate. EXPERIMENTAL USE WITH CAUTION

homeangledelay

Currently unused.

home

Tells the motion controller to move motor until the home switch (enable pin) is pulled low. (Only on boards 3/21/2017 or newer) (Must be enabled in firmware). For example:

:>home 360 0.5

Will move up to 360 degrees at 0.5 RPM. EXPERIMENTAL USE WITH CAUTION

pinread

Displays the binary states of all pins (Step, Dir, Enable, Error, A3, TX, RX)

errorpinmode

Sets or displays the error pin mode. Allows someone to swap usage of the error pin as an enable pin on older boards. (Not compiled for use on boards 3/21/2017 or newer since they have separate enable and error pins) (Must be enabled in firmware) Modes are:

  • "0" - Enable mode, active high (digital input).
  • "1" - Enable mode, active low (digital input).
  • "2" - Error mode, active low (digital output). Active level is reached when there is an angle error.
  • "3" - Error mode, bi-directional, (digital input/output open collector). (Not currently used).

errorpin

Sets or displays the binary state of the enable pin. Acceptable values are 0 or 1 For example:

:>errorpin 1

Will set the error pin on the terminal block to output a logic high when the error level is reached

enablepinmode

Sets or displays the enable pin mode. Allows someone to swap usage of the enable pin as an error pin on older boards. (Only on boards 3/21/2017 or newer since they have separate enable and error pins) (Must be enabled in firmware) Modes are:

  • "0" - Enable mode, active high (digital input).
  • "1" - Enable mode, active low (digital input).
  • "2" - Error mode, active low (digital output). Active level is reached when there is an angle error.
  • "3" - Error mode, bi-directional, (digital input/output open collector). (Not currently used).

geterror

Displays the current motor shaft error in degrees.

getsteps

Displays the number of steps that have been seen from the DIR pin.

debug

Sets if syslog debugging will be output on USB serial. Allowed values are 0 for disable, 1 for enable.

License:

The smart stepper related hardware is released under the Creative Commons Attribution Share-Alike 4.0 License as much of the work is based on Mechaduino project by J. Church.

https://github.com/jcchurch13/Mechaduino-Firmware

The firmware is licensed as GPL V3 for non-commercial use. If you want to release a closed source version of this product, please contact MisfitTech.net for licensing details.

nano_stepper's People

Contributors

coolio986 avatar filabot avatar hg42 avatar misfittech avatar swk avatar trampas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nano_stepper's Issues

Schematic has upside-down text

This project was probably put together when Altium defaulted to self-righting text. It hides upside-down text. Much of the text of the schematic is upside-down.

Controler Mode CTRL_OPEN doesn't work with step\dir interface

Since the feature "USE_TC_STEP" was enabled the Stepper doesn't show any reaction on the step\dir interface when running in "CTRL_OPEN" mode. If I comment the USE_TC_STEP define out it works as intended.
So it seems that it has somthing to do with the new step counting method.

I use the older HW revision (9/29/2016)

compilation with (for) MECHADUINO_HARDWARE is broken after hash 684f9ac4

compiling 684f9ac for mechaduino works quite well with Arduino 1.6.13 IDE, Later commits fail. (I have not tracked down the specific commit yet.

Only mod to the code is to uncomment the define for MECHADUINO_HARDWARE

Error message
In file included from sketch/nzs.h:11:0,
from sketch/nzs.cpp:8:
sketch/board.h:83:2: warning: #warning "Compiling source for Mechaduino NOT NZS" [-Wcpp]
#warning "Compiling source for Mechaduino NOT NZS"
^
sketch/nzs.cpp: In function 'int menuTestCal(int, char**)':
nzs.cpp:39: error: 'PIN_SW3' was not declared in this scope
while(digitalRead(PIN_SW3)==1)
^
nzs.cpp:43: error: 'PIN_SW3' was not declared in this scope
while(digitalRead(PIN_SW3)==0)
^
sketch/nzs.cpp: At global scope:
sketch/nzs.cpp:534:9: warning: #pragma GCC target is not supported for this machine [-Wpragmas]
#pragma GCC pop_options
^
exit status 1
'PIN_SW3' was not declared in this scope

narrowing conversion error

when compiling on Arduino IDE on Linux I got this conversion error:

eeprom.cpp:67:90: error: narrowing conversion of '4095' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
 __attribute__((__aligned__(FLASH_ROW_SIZE))) const uint8_t NVM_eeprom[EEPROM_SIZE]={0xFFF};
                                                                                          ^
exit status 1
narrowing conversion of '4095' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]

I guess it is a typo...should it be 0xFF?

Or may be I don't understand the special purpose of initializing an uint8_t with 0xFFF :-)

Cannot Install misfitTech SAMD Boards in Arduino.

[http://misfittech.net/blog/arduino-package-install/]
I followed the above link and "Arduino SAMD Boards (32-bits Arm Cortex-M0+)" was installed successfully, but I am not able to install "MisfitTech SAMD Boards in Arduino".
Any suggestion, how to fix this problem?

ERROR 'Serial5' was not declared in this scope

Hi, I followed http://misfittech.net/blog/arduino-package-install/ and have a MKS SERVO42A, I bought it without knowing the story about this copy-product, but I need to buy some others soon for my bachelor project. I'm trying the .ino in this hub, the last version but I got this error:

In file included from C:\Users\ATLAS\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,

             from C:\Users\ATLAS\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd.h:105,

             from C:\Users\ATLAS\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/sam.h:540,

             from C:\Users\ATLAS\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\cores\arduino/Arduino.h:48,

             from sketch\syslog.h:33,

             from sketch\stepper_controller.h:27,

             from sketch\stepper_controller.cpp:24:

C:\Users\ATLAS\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined

#define LITTLE_ENDIAN 1

In file included from c:\users\atlas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\types.h:67:0,

             from c:\users\atlas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\stdio.h:61,

             from sketch\syslog.h:32,

             from sketch\stepper_controller.h:27,

             from sketch\stepper_controller.cpp:24:

c:\users\atlas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\machine\endian.h:17:0: note: this is the location of the previous definition

#define LITTLE_ENDIAN _LITTLE_ENDIAN

sketch\nzs.cpp: In member function 'void NZS::begin()':

nzs.cpp:639:2: error: 'Serial5' was not declared in this scope

Serial5.begin(SERIAL_BAUD);

^~~~~~~

sketch\nzs.cpp:639:2: note: suggested alternative: 'Serial_'

Serial5.begin(SERIAL_BAUD);

^~~~~~~

Serial_

sketch\commands.cpp: In function 'uint8_t kbhit_hw()':

commands.cpp:1523:9: error: 'Serial5' was not declared in this scope

return Serial5.available();

     ^~~~~~~

sketch\commands.cpp:1523:9: note: suggested alternative: 'Serial_'

return Serial5.available();

     ^~~~~~~

     Serial_

sketch\commands.cpp: In function 'uint8_t getChar_hw()':

commands.cpp:1528:9: error: 'Serial5' was not declared in this scope

return Serial5.read();

     ^~~~~~~

sketch\commands.cpp:1528:9: note: suggested alternative: 'Serial_'

return Serial5.read();

     ^~~~~~~

     Serial_

sketch\commands.cpp: In function 'uint8_t putch_hw(char)':

commands.cpp:1532:9: error: 'Serial5' was not declared in this scope

return Serial5.write((uint8_t)data);

     ^~~~~~~

sketch\commands.cpp:1532:9: note: suggested alternative: 'Serial_'

return Serial5.write((uint8_t)data);

     ^~~~~~~

     Serial_

sketch\commands.cpp: In function 'int commandsProcess()':

sketch\commands.cpp:1579:52: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

CommandProcess(&HostUart,Cmds,' ',COMMANDS_PROMPT);

                                                ^

commands.cpp:1589:15: error: 'class Uart' has no member named 'dtr'

if (SerialUSB.dtr())

           ^~~

sketch\commands.cpp:1591:60: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

 return CommandProcess(&UsbUart,Cmds,' ',COMMANDS_PROMPT);

                                                        ^

exit status 1
'Serial5' was not declared in this scope

I really, really hope for help. @trampas @Misfittech Have a great day!

How to change vendor/product I or add iSerial

Hi,
because i want to have control over each smart stepper by usb connected to a usb hub, i figured out that all Smart steppers have same product id and vendor id. I'd like to persist named devices in raspbian by mapping their id's as fixed rule. Unfortunately that looks not so nice because all IDs of nano zero are the same. How can i change that? i did not find a fitting line of code to adjust that.
grafik

2209 question

Hi there

I'm looking for change the driver to 2209 on board, can I do this without major firmware modification?

Regards

AS5047 Error on Mechaduino

I got two Mechaduino clones for free, so I use them to check if I want to use Servo Steppers.

I assume it's not a priority for you, but I see Mechaduino is supported in some way.
So I wanted to give it a try and may be give something back (also see my PRs).

NZS has some interesting features, so I want to try some of them, and eventually switch to SmartStepper hardware if it fits for my purposes.

After ironing out some compile problems, I am now getting a stream of AS5047 Errors when trying NZS with two

AS5047 Error
AS5047 Error
AS5047 Error
...

If I enable the LOG messages I get a repeating sequence of these:

...
AS5047 Error
stepper_controller.cpp  309: move
stepper_controller.cpp  314: sample encoder
ERROR:    as5047d.cpp  198: read command 0xFFFF failed
AS5047 Error
stepper_controller.cpp  317: Angles 0 0
stepper_controller.cpp  329: Angles 0 0
stepper_controller.cpp  348: angle delta 0 0 (0 0)
ERROR:    stepper_controller.cpp  634: Motor may not have power
stepper_controller.cpp  130: Home pin -1
stepper_controller.cpp  586: start up encoder
as5047d.cpp  110: csPin is 16
as5047d.cpp  115: Begin AS5047D...
as5047d.cpp  134: AS5047D diag data is 0x0000
ERROR:    as5047d.cpp  198: read command 0xFFFC failed
ERROR:    as5047d.cpp  198: read command 0x7FFD failed
as5047d.cpp  153: AS5048A diag data is 0xFFFF
ERROR:    as5047d.cpp  241: AS5047D problem
stepper_controller.cpp  592: cal table init
calibration.cpp  346: calibration table status is: 0
ERROR:    as5047d.cpp  241: AS5047D problem
ERROR:    as5047d.cpp  241: AS5047D problem
ERROR:    calibration.cpp  197: WE did some thing wrong
WARNING:  stepper_controller.cpp  596: start up encoder 63728
stepper_controller.cpp  598: start stepper driver
stepper_controller.cpp  630: measuring step size
stepper_controller.cpp  302: reset motor
ERROR:    as5047d.cpp  241: AS5047D problem
ERROR:    as5047d.cpp  241: AS5047D problem
ERROR:    calibration.cpp  197: WE did some thing wrong
stepper_controller.cpp  305: sample encoder
ERROR:    as5047d.cpp  198: read command 0xFFFF failed
AS5047 Error
...

This is with motor power off, because it tends to get a little hot, but enabling the power doesn't change the messages that much. I am sure it's not the cause of those messages.

May be I am doing something weird, but after looking into it from different sides I don't see what could be wrong.

First question first: should NZS work with Mechaduino hardware?

Also: how is it supposed to be configured?
I ask, because enabling MECHADUINO_HARDWARE wasn't enough.
At least I had to disable NEMA17_SMART_STEPPER_3_21_2017 and USE_STEP_DIR_SERIAL ...
So may be I am missing more of this kind. Though, looking into the sources didn't give me any hint for more necessary changes.

Some conditions and observations:

  • I am using two Mechaduinos from the same manufacturer (currently clones)
  • both give me similar results
  • both work so far (no real application yet) with original Mechaduino firmware and the version from Kai Wolter
  • I already tried some things
    • reducing the SPI frequency to 400000 (from the uncommented parameters)
    • increasing a loop count (from older source) and delays in AS5047 read functions
    • reducing NZS_CONTROL_LOOP_HZ to 3000 (just in case :-) )
    • I also disabled the AS5047 error checking (because it seems to be ignored in KaiWolt1990) but the errors were resulting in bad values
  • I also tried an older version (when Mechaduino was mentioned last, commit 3bb2471)

Any ideas?
Is there anyone using NZS on Mechaduino?

setpos to negative number error

If a setpos command is issued with a negative value, a resulting readpos value will be the abs() of the negative.

move -124.00 400
:>
 deg
:>
readpos
encoder -124.10
:>
setpos -10
:>
readpos
encoder 10.08

The current implementation:

static int setpos_cmd(sCmdUart *ptrUart,int argc, char * argv[])
{
	if (argc>=1)
	{
		int64_t a;
		float x;
		x=fabs(atof(argv[0]));
		a=ANGLE_FROM_DEGREES(x);
		stepperCtrl.setAngle(a);
		return 0;
	}
	return 1;
}

Is there a reason why the fabs() is used?

add rs485 & modbus

Hello,
The nano_stepper is using tx&rx, so we have to use a main controller (like arduino mega 2560), which owns 3or4 serials ports.
If we add rs485&modbus into nano_stepper, we could use “daisy chaining”, just 1 serial port in main controller, or one computer could control many servo motors.

how about the idea? I will make it in my free time.

thank you!

Additions to docs

Hi,
in the recent documentation there are missing some really simple things

  • color and sense of the two LEDs which are lighting red (for Reset) and orange (for Status/Error)
  • naming of the 4 buttons/switches for common understanding
  • ground pads image confuses. it shows nylon washers on the pads but to ground it you need to remove them

my stepper labeling looks like this now:
grafik

the bug of move motor

  My version is "FW: 0.31", stepperDriver is A4954, input signal (STEP, DIR, ENABLE).
  The motor works good for a period of time (such as 2~3 hours), then it fails, The motor rotates fast in one direction,The screen is shown as follows:

bug
after reset, it can works good for a moment(maybe 30 minutes), but then fails again.
why is this happening? thanks.

please update

hello please update how to use it install , can i use it with my leadshine normal driver ? like if its a middle man between the break out board and the driver

New Firmware 0.40 direction not work

I have BIGTREETECH-S42A-V1.0 motor and driver. working on 0.38 firmware. To make it work i need to change some pins in board.h. With the same config pins on FW 0.39-0.40 do not work any more. Every things fine, LCD work, motor working only one way, can't change direction.
here is board.h file
board.zip

commands.cpp compile error.. missing reset.h

I am getting a compile error on commands.cpp.

sketch/commands.cpp:7:19: fatal error: reset.h: No such file or directory
#include "reset.h"

This was changed from Rest.h as part of 874650f, back on Jan 27.

I tried moving back to Reset.h and it worked for me, but I am not sure why the change was made or if this is the best fix.

Connecting to Smoothie

I just confirmed that I cannot use Smoothie's 3.3v logic directly on the level-shifted pins (step (0), dir (1) and error (10)).
I tried with Vin not connected (using usb for power) and with Vin connected to a 3.3v source from smoothie (usb not connected).
With both setups, the screen would come on and the firmware would load, but the motor would not step when signaled from smoothie.
Maybe I am doing something wrong, any suggestions?

Alternatively, I did test with modified firmware:
- Use D3 (3) for STEP, TX (30) for Dir and RX (31) for Err/Ena.
- Disabled Serial5 in NZS::begin.
- Connected Vin to 3.3v.
Then it works great with my Smoothieboard exactly as expected.

I would prefer not to have to modify the firmware each time I update it.
Do you have any suggestions on what I did to hook it up incorrectly?
Anything I can test or retry? I would be happy to test anything and share my results.

Referencing comments from: #1

MKS SERVO 42 ERROR PIN?

The MKS servo42 have an pin error? I need to know when the stepper have a certain error in other to interrupt my G-Code, but I don't see an error pin or something.

What magnets to use?

Hi,
i lost the magnets for some smart steppers time ago and wanted to ask what to buy to replace the lost ones. At the other smart stepper motors there are some 6.35 x 3.175 mm neodyms used and they work fine. Those are the ones which were delivered together with the boards.

I tried some other magnets like 4x2 mm but i think they do not have the correct field strength. My smart steppers only produce horrible error on calibration all the time. No chance to get them quiet. Any recommendations for this?

UsbSerial not available

Through the usb serial, I can upload the firmware with arduino. And the nano_stepper is working well except the usb serial, I sent ":>help\r\n" and other commands , but no response.

Detailed C++ programming questions

Hello!

I'm just learning OOP and C++, and use this repo for practice.

First, I noticed a copy constructor that seems to do exactly the same as the implicit copy constructor.

Angle(const Angle &x) {angle=x.angle;}

Are there advantages of defining this copy constructor explicitly?

I also noticed an operator overload for subtraction between angles.

int16_t operator-( const Angle &a2)

I was curious about what behaviour you wanted to change/control, so I compared the new minus operator with the shorter:

int16_t minus(const Angle &a2)
{
  return (int16_t)(angle - a2.angle);
}

... but no pair of input angles gave (a - b) != a.minus(b).

Is the explicit wrap condition in the minus-operator code there simply to make the code still work if ANGLE_STEPS ever changes?

Thanks for your software and for your time.

Current Homing

How can I do homing with the current?
In terms of Marlin (Ramps 1.4)

Ramps 1.4 GRBL

Hi..

can i use GRBL firmware with smart stepper ?
hardaware : Ramps 1.4 + arduino MEGA

Thanks
Rizki

Enhancement: Support for TMC2130/TMC2XXX

How about a future development of the board to support TMC2130/TMC2XXX series of chips? This would get much quieter running motors plus better micro stepping.

update to the readme?

I recently came across this project and while reading the readme. i decided to look up the servo42. it seems a bit weird to open a issue over this but i think they since have released the source code and hardware designs for their version of this project.
https://github.com/makerbase-mks/MKS-SERVO42A

i totally understand not wanting to support a Chinese low cost clone of your project. but if all that was stopping you was lack of documentation. i think that now exists.

Convert to TMC2208?

Looking to convert this to a TMC2208. I was wondering if any firmware modifications would be necessary? Any help appreciated!

Duet Board Support

Dear Misfit team,
i've got a question belonging to the manual you provide. At the moment i plan to wire up Smart Stepper to a Duet 2 Ethernet Board. In manual is written:
grafik

As i don't find any recent information i just wanted to ask you directly by creating this issue.
Can you provide some support information please?

kind regards, Mario

Just for info: easily read/write from/to Smart Stepper by raspberry pi/bash

Hi,

just wired up some bash stuff to operate Smart Steppers with scripts utilizing screen

apt install screen
#!/bin/bash
SCREEN_NAME="screen_smart_stepper"
LOG_FILE="/opt/${SCREEN_NAME}.log"

# remove old log file if existent
rm "${LOG_FILE}" > /dev/null 2>&1

# send "smart stepper command + enter (^M) keystroke" to first window (-p 0 could be applied) in a new named screen by stuffing (https://www.gnu.org/software/screen/manual/html_node/Command-Summary.html) the string into input; log the output to file
screen -d -m -L ${LOG_FILE} -S ${SCREEN_NAME} /dev/ttyUSB-SMARTSTEPPER 115200

declare -a cmdArray=("getcal" "microsteps" "readpos" "encoderdiag" "spid" "vpid" "ppid" "dirpin" "enablepinmode" "errorlimit" "ctrlmode" "maxcurrent" "holdcurrent" "homecurrent" "motorwiring" "stepsperrotation" "velocity" "looptime" "eepromerror" "eepromloc" "geterror" "getsteps" "torque")
for val in ${cmdArray[@]}; do
        screen -S ${SCREEN_NAME} -X stuff "${val}^M"
done

sleep 1
screen -S ${SCREEN_NAME} -X quit

# clean up the log with ^M symbols
sed -i 's/\r//g' ${LOG_FILE}

it looks easy but it was torture to find out how to communicate best without bugging the complete USB buffer or change stty settings. Maybe someone has smarter solution. That one works and might be a starting point.

same script can be used as basis to send commands or to build up some cyclic things.

i am using it for Hangprinter project to read encoder data without I2C/Two Wire interface, because there's no Duet support yet. And i dont want to mess around with firmware mods.

cheers, Mario

ctrlmode command not working

The ctrlmode command does not set the controller mode correctly.
If I use e.g. ctrlmode 2 sysparams shows 108 for controllerMode and I see undefined symbols on the display (see attached file).
nzs_ctrlmode

Setting the controllermode via sysparams is working correctly.

Open Source License

Hi Misfittech team, congrats for your very nice work. I was looking at your GitHub and saw this mention about the firmware license:

The firmware is licensed as GPL V3 for non-commercial use

GPLv3 explicitly says that there is no commercial limit. This mention makes your license kind of invalid. The other problem is that your project can't really be forked/reused/improved because of that non-commercial mention.

If you really want to have a non-commercial restriction you should look at CC licenses but they are more for art stuffs (they are not very explicit on sharing the source code for example). GPLv3 is for sure the best choice if you really want to make your project open source.

I think you have a very nice project here and it would be good to have a great license coming it with. This would for sure help to grow.

Wiki Updates

I forked this repo and created a wiki based on the readme and the other links back to your blog as well as added some stubs for future documentation I plan to add. Apparently there isn't any way to create a pull request on github for the wiki, so you would have to make the changes from my wiki back to the main branch (I think). I also wasn't able to add any contributors to my fork, so not sure how you would grab the markdown.
https://github.com/andrewismoody/nano_stepper/wiki

Inquiry: Step interpolation mode

Hello,

I wanted to know, would step interpolation theoretically help with the noise levels of the system? AFAIK it is what trinamic does to keep their steppers quiet even on low microsteps number.

Regards.

get postion is error ,value is 23592960.00

float pos;
int32_t x,y;

pos=ANGLE_T0_DEGREES(stepperCtrl.getCurrentAngle());

SerialUSB.println(pos);

I use the code to always print pos value, I found that sometimes the value is strange 23592960.00.

maybe there are calculate mistakes, like devided by zero...

thanks.

Smart Stepper N2P 100 35V capacitor getting really hot

Hi,
i installed Smart Stepper on 4 exactly same motors. The smart steppers are all hardware rev. 2019 and they are running with same firmware 0.39. I jsut mounted them and did the calibration procedure anad the test calibration test. All fine so far.

No i figured out that one of the 4 smart steppers the capacitor (N2P 100 35V) is getting really hot. I took an infrared thermometer which measured 70°C (the others are at ~20°C). you cannot grab it by hand because its so hot. The smart stepper reacts normally so far - if i add a force to the motor shaft it corrects the error immediately. The smart stepper are not connected to a machine yet. they are just mounted, connected to power source and to the 2 phases of the stepper motor. do you have an idea what could be wrong?

regards, Mario
regards, Mario

Retrofit for Nema 14

Hi, I was wondering if the board, provided it's properly aligned with shaft and magnet can be used directly on a Nema 14 motor, instead of Nema 17.
Thanks.

Required Wiring Doc Update

Hello,

Submitting this issue on the request of btechnet at the 602 Discord. The docs reference the following:

The VIN, GND, STP, and DIR should be connected to the pins on the NZS with the same names. The
above diagram shows the connection for the X axis on the RAMPS only, the other axis have similar
wiring.
The RAMPS boards have 5V logic levels, hence the VIN pin should be connected to the 5V VIN pin on the
RAMPS board. Other boards like Smoothie which uses 3.3V logic will have slightly different wiring.

He advised that this is now incorrect and docs may need to be adjusted, in regards to VIN.

Thanks

compile error 'Serial5' was not declared in this scope

Hi, i'm trying to compile the 0.39 but get this errors:

sketch\commands.cpp: In function 'uint8_t kbhit_hw()':

commands.cpp:1521:9: error: 'Serial5' was not declared in this scope

return Serial5.available();

     ^

sketch\commands.cpp: In function 'uint8_t getChar_hw()':

commands.cpp:1526:9: error: 'Serial5' was not declared in this scope

return Serial5.read();

     ^

sketch\commands.cpp: In function 'uint8_t putch_hw(char)':

commands.cpp:1530:9: error: 'Serial5' was not declared in this scope

return Serial5.write((uint8_t)data);

     ^

exit status 1
sketch\nzs.cpp: In member function 'void NZS::begin()':

nzs.cpp:637:2: error: 'Serial5' was not declared in this scope

Serial5.begin(SERIAL_BAUD);

^

'Serial5' was not declared in this scope

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.