Giter Site home page Giter Site logo

ex-turntable's People

Contributors

frightrisk avatar petegsx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ex-turntable's Issues

Homing flagged as succeeded when sensor disabled

As reported by Rico, with the homing sensor disabled and no steps stored in EEPROM:

License GPLv3 fsf.org (c) dcc-ex.com Turntable-EX version 0.2.1 Turntable-EX has not been calibrated yet Calibrating... Turntable homed successfully CALIBRATION: Phase 1, homing... CALIBRATION: FAILED, could not home, could not determine step count

Homing should have failed, and calibration should not have started.

WAITFOR() Only works on first use, no delay on subsequent uses

There's an issue with the device driver and status whereby the WAITFOR() EX-RAIL command only works the first time it is used.

Not sure if this is a device driver or Turntable-EX issue at this point, but if a position is selected that has a WAITFOR() as the first turntable move, it works, where nothing after the WAITFOR() executes until the turntable has finished moving.

However, every other subsequent move does not correctly wait, and any subsequent activities happen immediately, not after the turntable has finished moving.

Failed homing results in infinite loop

Testing without the homing sensor reveals an issue where homing will fail, yet calibration will still be initiate, resulting in an infinite loop attempting unsuccessfully to home.

Note that if homing fails, commencing calibration will never succeed, so this shouldn't happen either.

To do: Device driver enhancements

The device driver needs to be able to obtain the status of the turntable activities, so the Nano needs to respond to status requests.

States would probably include the below (or similar):

  • Homing
  • Moving
  • Move complete
  • Move failed
  • Homing failed

Add traverser and non-360 degree turntable support

A request to access the code was made by Alex Shephard as he has a use case for a traverser that he's interested in seeing if Turntable-EX can support. Right now, this won't work, especially with the updated calibration sequence due to the fact that neither traversers, nor turntables that don't rotate a full 360 degrees can have a full rotation step count performed the same way.

We should be able to support these with an additional limit sensor, and enabling the calibration sequence to count the steps between the home and limit sensors, thereby achieving the same goal of automatic step calculation, and still being able to use the same step sequences etc. to move to the various positions.

To do: Limit homing rotations

A side effect of the improved homing logic is that the turntable will now rotate forever if the homing sensor is not triggered.

An unused counter homingSteps is available which can be used to count the number of steps taken during homing, and these can then be limited by extra logic in the homing function.

Add Issue Template for Beta Testing

The simplest way to capture Beta testing results is to have testers complete the regression testing process, and provide a template for raising an issue in this repo for the test results to be captured.

Two bugs in 0.1.0

Spotted by Rico:

Stepper pin names not updated for COUNTER_CLOCKWISE option.
Description of home sensor still mentions pin 2.

Enable support for active LOW relays

Looks like a lot of new relay boards are active LOW rather than active HIGH, need to enable support for these the same as we do for the home sensor.

Will fix with #37

Add ability to drive an indicator LED or accessory

Some users may wish to have an indicator LED or other accessory turned on or activated during, prior to, or after turntable movements.

This can be achieved by defining a digital output pin enabled by an activity flag.

Initial thoughts here:

  • Turn an LED on/off independent of turntable movements (can be used in EX-RAIL sequences).
  • Have an LED blink rapidly or slowly independent of turntable movements (as above).
  • Same options as above, but activated at the beginning of a movement, and deactivated on completion. Note that this would also need to incorporate a phase switch if appropriate.
  • Potentially add a second accessory output pin that can be activated/deactivated either in conjunction with movements or independent of them.

To Do: Test To Do

Enter Work Task Description

Capture whatever information is relevant and required in order to complete this task.

Enter Done Criteria

Define what "done" looks like, what is the outcome of this task?

Bug Report: Merged PRs do not move to Done

Describe the bug

When merging a PR, they do not move to "Done" in the project Kanban.

Steps to reproduce

Submit and merge a PR.

Expected behavior

The PR should appear in the "Needs Review" column when submitted, then should move to "Done" automatically when merged.

Screenshots

N/A

Hardware

N/A

Additional context

N/A

Provide a real README.md

The current README.md is just the default placeholder, this needs some real content, particularly to enable testing while the repo remains private and there is no published documentation on the website.

Add installer tests

While creating the documentation, I've discovered it would be beneficial to have some tests available via the serial console to validate that the various components are connected and working correctly.

Tests should include:

  • Stepper operates as expected in both directions
  • Homing is functional
  • Phase switching operates as expected

Adjust pins to free 2 up for interrupts if required

Considering future potential to allow DCC control of Turntable-EX (may or may not be a good idea), we need to shuffle the homing sensor and relay pins to free up the interrupt capability of pin 2.

Moving the home sensor to pin 5 is all that's required here.

TTEX 0.3.1 Beta Test (alt.config, ULN2003_HALF_CCW) Results:

Testing configuration

  • CommandStation-EX version: 4.0.2 (add-turntable-controller version)
  • Turntable-EX version: 0.3.1 Beta
  • Microcontroller: Nano V3
  • Stepper driver: ULN2003
  • Stepper motor: 28BYJ-48
  • Homing sensor: A3144
  • Dual relay board: Active Low

If you have edited config.h in Turntable-EX or myHalcpp or myAutomation.h in CommandStation-EX, please upload those to this issue also.

Test 1 - Startup Sequence

PASS

Any observations or comments:

Test 2 - Turntable-EX is Available

PASS

Any observations or comments:

Test 3 - Basic Movement with Automatic Phase Switching

Test 3, Part 1 - Clockwise

PASS

Any observations or comments:

Test 3, Part 2 - Counter Clockwise

PASS

Any observations or comments:

Test 4 - Homing

PASS

Any observations or comments:

Test 5 - Calibration

PASS

Any observations or comments:

Test 6 - LED Output Testing

PASS

Any observations or comments:

Test 7 - Accessory Output Testing

PASS

Any observations or comments:

Test 8 - Manual Phase Switching

PASS

Any observations or comments:

General comments or feedback

Please share any general comments or feedback here:

Testing switch moment (calibrated at 4100 half step modus):
Homing started Turntable homed successfully CALIBRATION: Phase 1, homing... CALIBRATION: Phase 2, counting full turn steps... CALIBRATION: Completed, storing full turn step count: 4093 Manual override has been set for 4093 steps per revolution Automatic phase switching enabled at 45 degrees Phase will switch at 495 steps from home, and revert at 2475 steps from home Turntable homed successfully Received notification to move to step postion 495 Position steps: 495, Auto phase switch - moving 1 steps Setting phase switch flag to: 1 Received notification to move to step postion 2473 Position steps: 2473, Auto phase switch - moving 1978 steps Setting phase switch flag to: 1 Received notification to move to step postion 2474 Position steps: 2474, Auto phase switch - moving 1 steps Setting phase switch flag to: 1 Received notification to move to step postion 2475 Position steps: 2475, Auto phase switch - moving 1 steps Setting phase switch flag to: 0
config.h.txt

To do: Change homing trigger

Instead of homing being triggered by sending 0 steps with activity 0, activate it by sending activity 2 and ignoring the steps sent. This will prevent inadvertent homing on startup or when the CS restarts as occasionally 0s are sent.

Define regression and unit tests

A few bugs have been cropping up post-release, time to define some proper unit and regression tests to ensure all items are tested completely prior to release.

Documentation Update: Clarify Required CommandStation-EX Version

Please provide a brief summary of the update being requested:

The documentation refers to the "add-turntable-branch" of CommandStation-EX, but doesn't clarify the version should be displayed as "4.0.2".

If the update relates to an existing page, please provide the link to the page:

https://dcc-ex.com/download/turntable-ex.html
https://dcc-ex.com/turntable-ex/get-started.html
https://dcc-ex.com/turntable-ex/troubleshooting.html

Please provide details of the information that needs to be added, clarified, or corrected:

Need to provide guidance that the version displayed will be 4.0.2.

Additional context

Add any other context or screenshots about the documentation request here.

To do: Statically define relay pins and home sensor pin

To make things easier for Conductor level users, relay pins and the home sensor should be statically defined, so these need to be removed from config.h and be defined directly in Turntable-EX.ino.

This will also help should we end up providing ready-to-go versions of this for sale.

Feature Request: Consider adding automatic DCC phase reversal

More feedback from Alex in Discord which is probably a great idea:

Is your feature request related to a problem? Please describe.

It's worth considering having the DCC phase automatically reversing when rotating 180 degrees to make it easier.

Describe the solution you'd like

When a turntable rotates beyond 180 degrees, the DCC phase should automatically invert, and return to normal phase once rotating back to within the first 180 degrees.

Describe alternatives you've considered

N/A

Additional context

Consideration during the remainder of the conversation is to have auto reversal as the default, but still enabling use of the Turn_PInvert command if users prefer, and an option to not invert at all which would be applicable in scenarios such as traversers that don't actually rotate.

Simplify calibration sequence

The calibration sequence is overly complicated. The goal is simply to ensure that the provided steps for a full 360 degree rotation are accurate, meaning the only positions that need to be validated are home/360 degrees, and 180 degrees. Even 180 is probably unnecessary really, but good to have that extra validation.

Calibration: "ERROR: Turntable failed to home, setting random home position"

Calibration cycle still returns ERROR: Turntable failed to home, setting random home position in version 0.2.3

How to reproduce:

  1. Update config.h to use #define STEPPER_DRIVER ULN2003_HALF_CW or #define STEPPER_DRIVER ULN2003_HALF_CCW and save
  2. Erase the EEPROM with sketch from IDE
  3. Remove HAL sensor to prevent successful homing/calibration cycle
  4. Upload Turntable-EX
  5. Open IDE Serial Monitor
  6. Cyclus starts with
    Turntable-EX has not been calibrated yet
    Calibrating...
    Homing started
  7. Wait until calibration cycle is ended and returns
    ERROR: Turntable failed to home, setting random home position

Beta Test Results: Test Item for Review

Testing configuration

  • CommandStation-EX version:
  • Turntable-EX version:
  • Microcontroller:
  • Stepper driver:
  • Stepper motor:
  • Homing sensor:
  • Dual relay board:

If you have edited config.h in Turntable-EX or myHalcpp or myAutomation.h in CommandStation-EX, please upload those to this issue also.

Test 1 - Startup Sequence

Not Tested/Pass/Fail

Any observations or comments:

Test 2 - Turntable-EX is Available

Not Tested/Pass/Fail

Any observations or comments:

Test 3 - Basic Movement and Phase Inversion

Test 3, Part 1 - Clockwise

Not Tested/Pass/Fail

Any observations or comments:

Test 3, Part 2 - Counter Clockwise

Not Tested/Pass/Fail

Any observations or comments:

Test 4 - Homing

Not Tested/Pass/Fail

Any observations or comments:

Test 5 - Calibration

Not Tested/Pass/Fail

Any observations or comments:

Test 6 - LED Output Testing

Not Tested/Pass/Fail

Any observations or comments:

Test 7 - Accessory Output Testing

Not Tested/Pass/Fail

Any observations or comments:

General comments or feedback

Please share any general comments or feedback here:

Enable uni-directional rotation

Some stepper and turntable configurations end up being less accurate when turning in one direction vs. the other, or when alternating direction of travel, likely due to sloppiness in the internal stepper setup or the mating between the turntable components and stepper shaft.

We can enable a workaround for this by turning in the specified direction only (clockwise or counter clockwise).

To do: Add TT or similar macro to EX-RAIL

Having the turntable driven via the SERVO macro in EX-RAIL is ok, but it really should have a specific command set to remove confusion for end users, and to enable future extensions.

Something like MOVETT(Vpin, steps, activity).

This also requires a debug command for tuning positions and general testing such as <D TT vpin steps activity>.

Documentation Update: Turntable-EX documentation feedback

Feedback received from Alex in Discord:

Please provide a brief summary of the update being requested:

The need for an additional AVR board isn't clear in the overview, and the DCC phase inversion isn't clear enough.

If the update relates to an existing page, please provide the link to the page:

https://dcc-ex.com/turntable-ex/turntable-ex.html

Please provide details of the information that needs to be added, clarified, or corrected:

Reading the Overview Section, it wasn't immediately obvious to me that this was its own AVR board and completely separate to the Command Station and links via I2C. Not that it really matters as part way through that became obvious, but at an overview level might be useful to set things straight.

The description of the Phase Reversal seemed to finish without really saying how to select/set which of the 3 options the user wants to use and I presume its simply energises the relays when the turntable passes the 180 degree position. That could do with a few more sentences explaining the logic that will be applied or not.

Additional context

Add any other context or screenshots about the documentation request here.

typo in readme.md

#define TURNTABLE_EX(route_id, reserve_id, vpin, steps, activity, desc) \
  ROUTE(route_id, desc) \
    RESERVE(reserve_id) \
    MOVETT(vpin, steps, activit) \    <<<< activity
    WAITFOR(vpin) \
    FREE(reserve_id) \
    DONE

Add a calibration function

There are some slight variances reported in gear ratios for the ULN2003/28BYJ-48 stepper combos which will likely cause issues if not accommodated for in the defined number of steps for a full rotation.

In addition, other turntable/stepper applications may have gearing to take into consideration.

The simple answer is to add a calibration routine as a separate activity.

This should be able to be run from the CS via an activity flag, and directly on Turntable-EX so users can see the step numbers at each degree position.

We should also provide a printable template with the various degrees that users can put around their turntable to perform the calibration.

Add text based activity flags

To make it easier for Conductor level users, it's probably better to have activity flags written as text rather than integers to avoid confusion.

Suggestions:

  • Nothing (0)
  • SwitchPhase (1)
  • Home (2)

Bug Report: Test Bug Workflow

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Hardware

Include details of all hardware used such as microcontrollers, motorboards, stepper drivers/motors, turnouts, etc. as appropriate and applicable.

Additional context

Add any other context about the problem here.

Beta Test Results: Release v0.3.1-Beta

Testing configuration

  • CommandStation-EX version: V-4.0.2 add-turntable-controller branch
  • Turntable-EX version: 0.3.1-Beta
  • Microcontroller: Arduino Nano
  • Stepper driver: ULN2003
  • Stepper motor: 28BYJ-48
  • Homing sensor: A3144
  • Dual relay board: Keyestudio

If you have edited config.h in Turntable-EX or myHalcpp or myAutomation.h in CommandStation-EX, please upload those to this issue also.

Test 1 - Startup Sequence

Pass

Any observations or comments:

Test 2 - Turntable-EX is Available

Pass

Any observations or comments:

Test 3 - Basic Movement with Automatic Phase Switching

Test 3, Part 1 - Clockwise

Pass

Any observations or comments:

Test 3, Part 2 - Counter Clockwise

Pass

Any observations or comments:

Test 4 - Homing

Pass

Any observations or comments:

Test 5 - Calibration

Pass

Any observations or comments:

Test 6 - LED Output Testing

Pass

Any observations or comments:

Test 7 - Accessory Output Testing

Pass

Any observations or comments:

Test 8 - Manual Phase Switching

Pass

Any observations or comments:

General comments or feedback

Please share any general comments or feedback here:

Support Request: Test Support Request

Requester Name:

Just a first name or nickname will suffice, something to put a personal touch on replies.

Requestor Email:

Optional, as this email address will be publicly visible on the internet if provided.

Issue Title:

A brief title for the support request.

Describe Issue:

Please describe the issue being encounted as accurately and detailed as possible, and provide further specific information below to help us understand the nature of it, and the environment in which it was encountered.

Product Name:

CommandStation-EX/WebThrottle-EX/Turntable-EX/EX-RAIL

Release/Version :

Microcontroller: (Optional)

Arduino Mega/Arduino Nano/Arduino Uno/ESP32/Other

Motor Shield Name: (Optional)

Bug Report: Test Bug Workflow

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Hardware

Include details of all hardware used such as microcontrollers, motorboards, stepper drivers/motors, turnouts, etc. as appropriate and applicable.

Additional context

Add any other context about the problem here.

RAM optimisation

RAM can be optimised with Serial.print(F("Text")) etc.

Also check out the CS code's string formatter.

Lower RAM usage will likely be required to allow for the display option.

TTEX Beta 0.3.1 config untouched

Testing configuration

  • CommandStation-EX version: 4.0.2 (add-turntable-controller version)
  • Turntable-EX version: 0.3.1 Beta
  • Microcontroller: Nano V3
  • Stepper driver: ULN2003
  • Stepper motor: 28BYJ-48
  • Homing sensor: A3144
  • Dual relay board: Active Low

If you have edited config.h in Turntable-EX or myHalcpp or myAutomation.h in CommandStation-EX, please upload those to this issue also.

Test 1 - Startup Sequence

PASS

Any observations or comments:

Test 2 - Turntable-EX is Available

PASS

Any observations or comments:

Test 3 - Basic Movement with Automatic Phase Switching

Test 3, Part 1 - Clockwise

PASS

Any observations or comments:

Test 3, Part 2 - Counter Clockwise

PASS

Any observations or comments:

Test 4 - Homing

PASS

Any observations or comments:

Test 5 - Calibration

PASS

Any observations or comments:

Test 6 - LED Output Testing

PASS

Any observations or comments:

Test 7 - Accessory Output Testing

PASS

Any observations or comments:

Test 8 - Manual Phase Switching

PASS

Any observations or comments:

General comments or feedback

Please share any general comments or feedback here:

Testing switch moment (calibrated at 4100 half step modus):
Phase will switch at 495 steps from home, and revert at 2475 steps from home Turntable homed successfully Received notification to move to step postion 494 Position steps: 494, Auto phase switch - moving 494 steps Setting phase switch flag to: 0 Received notification to move to step postion 495 Position steps: 495, Auto phase switch - moving 1 steps

Beta Test Results: Test Beta Testing Workflow

Testing configuration

  • CommandStation-EX version:
  • Turntable-EX version:
  • Microcontroller:
  • Stepper driver:
  • Stepper motor:
  • Homing sensor:
  • Dual relay board:

If you have edited config.h in Turntable-EX or myHalcpp or myAutomation.h in CommandStation-EX, please upload those to this issue also.

Test 1 - Startup Sequence

Not Tested/Pass/Fail

Any observations or comments:

Test 2 - Turntable-EX is Available

Not Tested/Pass/Fail

Any observations or comments:

Test 3 - Basic Movement and Phase Inversion

Test 3, Part 1 - Clockwise

Not Tested/Pass/Fail

Any observations or comments:

Test 3, Part 2 - Counter Clockwise

Not Tested/Pass/Fail

Any observations or comments:

Test 4 - Homing

Not Tested/Pass/Fail

Any observations or comments:

Test 5 - Calibration

Not Tested/Pass/Fail

Any observations or comments:

Test 6 - LED Output Testing

Not Tested/Pass/Fail

Any observations or comments:

Test 7 - Accessory Output Testing

Not Tested/Pass/Fail

Any observations or comments:

General comments or feedback

Please share any general comments or feedback here:

Add issue templates and project workflows

Need to add the issue templates and project workflows as per the Support-Planning repo, as these are now ready to be tested and demo'd as part of improving how we track and organise work.

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.