×

Sale ends todayGet 30% off any course (excluding packages)

Ends in --- --- ---

C127 rotary encoder input

MoTeC M1 Software Tutorial

Forum Posts

Courses

Blog

Tech Articles

Discussion and questions related to the course MoTeC M1 Software Tutorial

= Resolved threads

Author
101 Views

Ultra noob so if this is obvious bear with me...

I want to add a couple rotary encoders to control functions with counters on C127, so that turning clock wise increments the counter and reverse decreases it. The counter part I figured out but I'm unsure how to setup the encoders and detecting if it's being turned clockwise\counter-clockwise. I think I should be able to do this with User Conditions, am I on the right track there?

Please describe the rotary encoder a little better. Is this a device that will send CAN messages, a multi-position rotary switch that has a resistor divider that can provide a unique voltage at each position, or a spring-loaded knob that looks like two momentary switches (one for up, and one for down)?

Here is an example of a CAN communications rotary control:

https://www.motec.com.au/products/5%20Button%20Rotary%20Controller

Here is an example of a multi-position rotary switch:

https://www.motec.com.au/products/9%20Position%20Rotary%20Switch

It's a rotary encoder like this: https://www.ctscorp.com/Files/DataSheets/Encoders/encoders-288-datasheet.pdf

I want to use it functionaly similar to how you would use the motec canbus one, so basically a 2 direction rotary button with no end stops, just smaller and I need a couple of them. Or like a mouse scroll wheel.

I was planning on using ecumaster canbus boards since I won't have enough inputs on the C127.

I think this would be pretty simple with the math channels of the C187, but feels bad to double the cost of the unit just for this relatively minor use of the feature so I am trying to figure out an alternative...

That is not a good choice to interface with the C127. Normally that would be connected to a small microprocessor to handle the decoding something like a PIC with a CAN interface. Something like this AutosportLabs DIY board might be a good starting point (and it could do additional CAN expansion):

https://www.autosportlabs.com/product-category/diy-development-boards/

If you did want to use it direct to the C127, get the 2-bit version which has basically a quadrature output, use two C127 digital inputs (DIG or SPD), and two user conditions to decode to an up and down trigger for the counter.

That seems like a nice product, will probably do something like that then, since it would also replace the ecumaster boards.

I did end figuring out how to do it in the motec (I think..), it's pretty simple logic but dash manager has some annoying restrictions on user conditions. I took a look a display creator and managed to do what I wanted pretty easily by combining them both, without using up a ton of the limited User Conditions in dash manager, or valuable digital inputs. I'll post how I did later in the motec forums (if I ever get the registration confirmation email).

I do have another question regarding user conditions in dash manager. I need dash manager to tell display creator if the encoder has turned, and then reset the value to false. Would something like I posted work? The help file has me a bit confused on the order of operations, or if the "Deactivate" part will even happen if "Activate" is true.

Would changed by 1 work for both a 1 -> 0 or 0 -> 1 change?

Thanks a lot for your help David, almost anytime I have a question I seem to be able to find a post of yours with some helpful info in it haha

Attached Files

If you just made it momentary, then it would go false when it stops changing.

We usually reply within 12hrs (often sooner)

Need Help?

Need help choosing a course?

Experiencing website difficulties?

Or need to contact us for any other reason?