Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differential outputs #17

Closed
tuxcnc opened this issue May 19, 2023 · 9 comments
Closed

Differential outputs #17

tuxcnc opened this issue May 19, 2023 · 9 comments

Comments

@tuxcnc
Copy link

tuxcnc commented May 19, 2023

I think this is not a big problem to add to Stepgen and PWM negated output signals.
For example:
"step_pin": "J9: 0",
"step_pin_inv": "j9: 1",
This would give the possibility to control the output devices with a differential signal.
This won't spoil anything, if someone doesn't need it, they just won't use it.

@OJthe123
Copy link

I think this is already in progress, because the breakoutboards have the differential option
https://github.com/Peter-van-Tol/HUB-75-boards

@tuxcnc
Copy link
Author

tuxcnc commented May 21, 2023

I think this is already in progress, because the breakoutboards have the differential option https://github.com/Peter-van-Tol/HUB-75-boards

Evidently, the author started from the end ...

@kubabuda
Copy link

Why do you want two pins per diff line? Transceiver chip on daughter board normally handles this for you. You want to drive differential bus like RS422 straight from FPGA IO (without all protection in transceiver)?

@OJthe123
Copy link

And, would an inverted Pin really be "differential" ?
really diefferential would be +5V / -5V right?
inverted Pin on FPGA side can only be +5V and 0V....

@kubabuda
Copy link

@OJthe123 thats exactly my point

@tuxcnc
Copy link
Author

tuxcnc commented May 22, 2023

And, would an inverted Pin really be "differential" ? really diefferential would be +5V / -5V right? inverted Pin on FPGA side can only be +5V and 0V....

The voltage is measured between two points, and the potential to the third (and others) does not matter.
(Did you know H bridge ?)

BTW.
This topic is about ADD inverted signals, no existing will be changed.
The differential output is only one of the possible purpose.
Note that STEP and PWM signals are NOT symmetric, someone may needs one but inverted signal...
Apart from that, as I wrote, if someone doesn't need inverted signals, he just won't use it.
The discussion about "why you need" has no sense.

@Peter-van-Tol
Copy link
Owner

The differential stepgen is available from Litex-CNC. The way it is implemented in the JSON-configuration is:

"modules": [
    "modules": [
        ...,
        {
            "module_type": "stepgen",
            "instances": [
                {
                    "pins" : {
                        "stepgen_type": "step_dir_differential",
                        "step_pos_pin": "j9:6",
                        "step_neg_pin": "j9:5",
                        "dir_pos_pin": "j9:4",
                        "dir_neg_pin": "j9:2"
                    },
                    "soft_stop": true
                },
                ...
            ]
        }
    ]

To stand corrected: the module has been developed first and then the BOB.

The BOB outputs 0 and 5 Volt, analog to the encoder I had laying around. If this is considered to be not 'true' differential, one can also opt to use the stepgen_type step_dir and use the suggester tranceiver. But for 400 kHz pulse train this seems overkill in my opinion.

My rationale for using 2 pins for each signal of the stepper is the abundance of outputs available. My machine (EMCO5 CNC) is almost finished, and still ample outputs left over. If anybody sees an opportunity to contribute in the development of BOB's, please do so for the community. Improvements are welcome!

@OJthe123
Copy link

is the module in the "standard" LiteX-CNC branch? Or in "add-external-extensions" ?

@Peter-van-Tol
Copy link
Owner

This is in #11 . This branch is to be merged this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants