Sign in to follow this  
Followers 0
Marxon

Simulating hardware encoders

2 posts in this topic

 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

Share this post


Link to post
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.

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0