Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Advice on software approach

  1. #1

    Advice on software approach

    Hi
    I developed a board that makes use of a Teensy 3.6. The purpose of the board is to provide a general platform to creat CNC controller applications. Not motion control but syncronized linear movement of up to three axis. The board has these:
    1) 3 x step/dir channels
    2) 3 x PWM 0-10V outputs, fully buffered
    3) 3 x Encoder/linear scale inputs. TTL and RS422 selectable
    4) 8 x open collector 24V inductive drivers for output (I2C)
    5) 8 x 24V opto isolated inputs (I2C)
    6) 7.0" 4D systems LCD interface
    7) 1 x RS485 channel

    The idea is that I will have all the drivers written and then just do the custom application to control whatever with the board everytime.
    So my question is this:
    What is the best way to go about creating the drivers or base package to enable me to just write the top level stuff? Do I create classes for every hardware function or is there a better way?

    What would other developers do?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,828
    Have you used this library? If not, definitely worth a look.

    https://luni64.github.io/TeensyStep/

  3. #3
    Hi Paul
    Yes I have used it in a project before and it is included here as well. I have that already setup as I have all the other drivers (or in process of). With drivers I mean the low level setup and interface to the hardware functions. Almost like HAL or VXD.
    I want to make a pool of drivers or functions and then only have to code the HMI and the functionality around that. Almost like a BSP for my project but I am not sure what is the best approach. A layered framework I think is what the clever people call it.

    EDIT:
    It can use servo's or steppers or proportional contact control. I will have PID interfaces for each channel that will use an encoder and a servo (0-10v) channel.
    Last edited by mariusl; 01-27-2020 at 12:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •