Notifications
Clear all

stepper control

20 Posts
6 Users
4 Likes
604 Views
(@banjobrad2)
Eminent Member
Joined: 10 months ago
Posts: 14
Topic starter  

@zander Ron, if I have some code that defines the x_pin for a joystick as input, what would be the equivalent pin on a rotary encoder that would accomplish the same input?

Thanks


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@banjobrad2 I just ordered some so have no experience, I would look at Bill's (DBWS) video/blog to see.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@banjobrad2 I think you mean output, a joystick has no electronic input, it translates human input to electronic output. I am unfamiliar with a joystick but can imagine it has a single terminal for X, an encoder is totally different. Maybe this article will help https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
Inst-Tech reacted
ReplyQuote
(@davee)
Noble Member
Joined: 2 years ago
Posts: 1301
 

Hi @banjobrad2,

  There is no 'universal' definition of the electrical interface of a joystick, but the most common is that of two potentiometers ... one in X direction and the other in the y direction. The circuit 'reading' each potentiometer position supplies a small voltage which is applied across the track of the pot, and the slider 'picks' off a fraction of the applied voltage, the voltage depending upon the position of the slider. Hence the input software will be measuring a voltage (from each pot).

The rotary converters are also provided with a small voltage, but the output consists of two possible voltage levels ... 0 and the applied voltage. Rotating the encoder knob causes the voltages levels to 'flip' and the resulting pulses can be converted into rotation signals.

These two interfaces are completely different and require differing software.

Best wishes,

Dave


   
Inst-Tech reacted
ReplyQuote
(@e-danil)
Eminent Member
Joined: 3 years ago
Posts: 16
 

To remove all these complications I would suggest you switch to a servo motor because it comes with its own feedback system. because you only need a stepper for precision like 3d printer

 

This post was modified 9 months ago by E.Danil

   
Inst-Tech reacted
ReplyQuote
Page 2 / 2