Skip to content

Conversation

@Orob-Maslow
Copy link

@Orob-Maslow Orob-Maslow commented Nov 25, 2020

This pull request rolls in spindle pwm speed control with holey calibration for use with webcontrol or makerverse.

The shield numbering is pushed out to version 8 for 0 based numbering.

By adding eeprom settings for spindle settings and z axis limits, the eeprom storage will change shapes and need to be rewritten, requiring a recalibration, though it does not change the calibration process.

To date, this firmware compiles and has been flashed and verified as operational on a bench mega, but not on an actual system yet. This submission is to solicit testers to try it and verify for all versions of boards specifically 1.5b, 1.4, 1.3, 1.1, and 1.0. It has been tested on 1.6 and 1.2b.

How can this pull request be tested?

This file can be found in the OrobMaslow/Firmware repository as the New_Feature_Verification branch.

Testing should included z axis limit setting, sled and z axis movement, spindle speed via Sxxx commands, and spindle power control. The spindle servo control was disabled for this addition.

madgrizzle and others added 30 commits August 20, 2019 10:48
Any changes to values that are used during the kinematics::forward calculations should call kinematics.init() so sled position can be recalculated.  If its not, this can cause a "sled not keeping up" error, particularly after calibration.  If the sled is at an unadjusted position and a move is made, the move will be made with the adjusted parameters and that can exceed the positionErrorLimit.
 cnc_ctrl_v1.ino:
 - add global flag to signal Axis::computePID() and Motor::write()
 - check for saved state at startup and report it

 Gcode.cpp:
 - add 'B99 ' command
 - - if the line contains 'ON' set FAKE_SERVO_STATE otherwise clear it
 - - report the state
 - - save the value of FAKE_SERVO_STATE in the high byte of EEPROM to persiste over restarts
 - - note that Setings::settingsWipe(SETTINGS_RESTORE_ALL) writes '0' to that location, which turns FAKE_SERVO off

 Axis.cpp:
 - at start of Axis::computePID(), check 'if (FAKE_SERVO_STATE != 0)' to determine whether to fake the encoder change. The check adds very few microseconds to this importrant function.

 Motor.cpp:
 - at the start of Motor::write() add a check for (FAKE_SERVO_STATE == 0) to determine whether to set the speed of the motor. This check adds only a few microseconds. Adding this check keeps the motors inoperative dureing FAKE_SERVO mode.
add B99 command to control FAKE_SERVO mode
 - define a specific number value to indicate FAKE_SERVO as active in Config.h
 - in cnc_ctrl_v1 on startup, check the contents of EEPROM[ 4095 ] for that special value, if found enter FAKE_SERVO but if any othe value is found store a '0' there and indicate that FAKE_SERVO is 'off'
 - change the logic in Axis::computePID() and Motor::write() to check for the specific value ranther than non-zero.
…cess-control

tighten up FAKE_SERVO access
Remove comment characters between parentheses.
…if Z is not specified in gcode line. Set Z1 and Z2 to NAN if not provided. Update arc() to deal with NAN Z. Make Z calculations happen the same way as X&Y before movementUpdate(). Add Z end move same as X & Y.
…c-z-optional

gb0101010101-g2-arc-z-optional: Do not perform Z axis movement on G2 …
I have made some small tweaks to the code to be able to set upper and lower limits for the z axis in order to prevent motors from forcing the Z Axis beyond its limits.
Made changes per requests during review
…-support-radius

Add support for G2 & G3 commands that use radius R instead of I & J.
…emplate

Revert pull pull request template to original version
Added $60 min speed and $61 spindle max speed for pwm output  Added S functionality to set spindle speed.  pwm setting is scaled from 0 to max with min being set as the start speed.
default is for pwm pin to be active and for relay to be active high
added  original chain length to extend chain routing and removed axis detach
added sys.SpindleSpeed and sys.SpindlePower that are set in spindle.cpp when the relay is toggled and then checked when an S command is received.  Verbose dtails are given when an S command or $60, $61 command are given to change the spindle max, min, or speed setting
51.29:
added board v 1.5 TB6643 chip
and associated procedures for communicating with that chip and the different pinouts.
incremented settingversion to 7
board now identify as version +1
updated board number
description changes and reserved Version 8 as the next board version to come out, reservd 15 because it is already used by board v 1.2b
verification showed TB6643 board identifies when not selected.  Fixed to check rather than set variable when comparing.
@Orob-Maslow Orob-Maslow added bug Something isn't working enhancement New feature or request labels Nov 25, 2020
@Orob-Maslow Orob-Maslow requested a review from a team November 25, 2020 05:17
@Orob-Maslow
Copy link
Author

Should I have pulled requested this into master or a different branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants