Close

Ideas to improve Claw Machine Control Options

A project log for Toy Claw Machine

Full size Claw machine made from misc. parts.

willbadenwillbaden 01/08/2015 at 12:200 Comments

The way the app is built, will allow for an analog style of control of the claw machine. This would allow for a varying speed of the claw according to that control input. Right now the claw machine is incapable of taking in different speeds in a real time fashion. Instead a user would have to go into program mode to change the speed which would stop all movement.

So some more options for the I,J,K,L commands is wanted. The thought now is to add a single byte prior to the control command (I,J,K,L) that would contain the speed. This will range from 0 - 255. Similar to changing the speed of the claw machine in program mode only now it will be byte instead of ASCII. This way I will not have to use the ASCII to byte converter that is currently used.

The thought is to use the following format:

<begin byte speed input><byte speed><direction command>

Where:

<begin byte speed input> Single byte that will signal the claw machine that a speed/command string will be sent

<byte speed> Single byte containing the speed ranging from 0 - 255

<direction command> Currently used claw control commands I, J, K, and L.

This would be integrated into the serial interrupt routine. Currently the interrupt detects the I, J, K and L characters and fills a step count down timer and does not fill the receive buffer with the control character.

To sense the speed, the receive buffer will need to be used to remember the speed input. The speed will be placed into the buffer only if it sees the begin byte speed input. After it sees the speed it will adjust the stepper speed timer to the speed requested.

This opens up an issue where the with the current stepper speed timer. If this value is changed with the claw machine app, then the physical joystick will be forced to use that value for its control. It could be setup to allow for separate timers, one for the app control and one for the joystick control.

Along with creating speed adjust, it would be nice to include an accel decel feature. The abrupt starting and stopping of the claw movement would then be a nice transition.

This would have to be implemented into the stepping routine and would require another counter for the length of time to accel/decel. Which would be nice to be able to control in the menu structure.

As this is developing into more control and features, I would like to explore common protocols that are used in machine movement/control along a serial communications path. This might require a rewrite of the program which would force a spin off of this project with a completely different controller.

Discussions