Jump to content

Simulating hardware encoders


Marxon
 Share

Recommended Posts

 Hi Midiboxers,
 
 while i was tinkering with my midiboxes i wondered if it would be possible
 to use a Midibox NG to simulate a encoder. Something like an "encoder generator" simply by using a Dout board and a .NGR script.
 Some quadrature encoder signal may could be generated like this:

 if ^section == 1
  set LED:0 0
  delay_ms 2
  set LED:1 0
  delay_ms 2
  set LED:1 1
  delay_ms 2
  set LED:2 1
  delay_ms 2
  set LED:0 0
  delay_ms 2
  set LED:1 1
  delay_ms 2
  endif
 


I guess connecting DOUT pins directly to the encoder inputs on the destination device
requires some kind of adjustment but should work too?

What do you think?
Is something like that in genaral possible?

Best regards
Marxon

Link to comment
Share on other sites

Since Encoders short their pins to ground in most cases, i'd use optocouplers between DOUT and the device you want to control.

That way the voltage level present on the device wont matter, as long as the coupler can take it.  Polarity does matter though.

The isolation between Box and device might save the Box, but fry the coupler. I'd go for sockets and keep some spares.

If i  understand your code correctly, you plan to use 3 outs per encoder.  Usually  encoders do have 3 pins, common, a and b. You only need to simulate a and b.

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...