Skip to toolbar
Motorised Painting Handle

Motorised Painting Handle

Supported by (Turn Off)

Testing an analogue joystick and stepper motors

Tutoring 8
Skill 8
Idea 8
No Comments

In theory, having an analogue joystick should mean about 500 degrees of control in each direction (since the joystick returns values 0-1023 for the x-axis and 0-1023 on the y-axis, if the centre point is 511,511 we should expect a nice range of values from one extreme to another).

In practice, getting a nice wide range on the joystick is really difficult. It has a large “dead spot” at the end of each travel, meaning the tiniest amount of movement makes the input values change by about a hundred. Just a few millimeters of movement and the joystick has “maxed out”.

With this in mind, I changed the code to change the speed of the motors over just a few discrete positions.

  • Barely touch it and the motor barely moves
  • Push it a little bit, and the motor turns at about 1/3 speed
  • Just before maxing out the travel on the joystick, the motor is running at about 2/3 speed
  • At the full limit of movement, the motor runs at full speed.

When connected up to a couple of motors, we can see how not only can the maximum speed of the motors be limited, but just by using the joystick (instead of constantly fiddling with the speed controller) we can get them to spin at faster/slower speeds

 

Leave a Reply

Supported by (Turn Off)