Software Support > Automated Projects
Starting monitor rotation project
DaOld Man:
Unfortunately, since startcom gets it's commands from Mala, I dont think there is anyway to do this.
I can research it a bit to see if Mala will pass button presses, but dont think it will.
raph:
I think I can do an AHK script to intercept the keystrokes, call the rotation, and then pass the keystroke through anyway so that Mala rotates.
raph:
I still get some buzzing, mostly because the weight on the monitor is not evenly distributed, so as it rotates, it tends to sag slightly to one side. The servo notices and fights it. Am currently dealing with it by attaching weights to the back of the monitor to try to get it balanced. I seem to recall one of the other projects had a similar issue...
I also notice that stuff like a machine reboot or disconnecting power will make the servo reset rather vigorously, enough to throw it a little out of true. Apparently setting the max speed in the driver doesn't cover the restart case. :badmood:
raph:
An update for you all: this is now working well, after a year of neglect and some redesign!
I ended up needing to redo the actual mount for the servo to eliminate binding. I also had to modify the software I was using to control the servo.
Here is the batch file I ended up with:
--- Code: ---if "%1"=="90" goto vert
:horiz
d:\Utilities\Pololu\Maestro\bin\usccmd.exe --servo 0,3456
start /wait d:\Utilities\Pololu\Maestro\bin\usccmd.exe --accel 0,0
start /wait d:\Utilities\Pololu\Maestro\bin\usccmd.exe --speed 0,30
d:\Utilities\Pololu\Maestro\bin\usccmd.exe --servo 0,7680
goto end
:vert
d:\Utilities\Pololu\Maestro\bin\usccmd.exe --servo 0,7680
start /wait d:\Utilities\Pololu\Maestro\bin\usccmd.exe --accel 0,0
start /wait d:\Utilities\Pololu\Maestro\bin\usccmd.exe --speed 0,30
d:\Utilities\Pololu\Maestro\bin\usccmd.exe --servo 0,3456
:end
timeout /t 2 /nobreak
d:\Utilities\Pololu\Maestro\bin\usccmd.exe --servo 0,0
exit
--- End code ---
This code turns the servo off entirely between rotations. The servo therefore loses its memory of where it was; that's why it issues the command to take it to where it already is first. Given its current location, the speed and acceleration commands are then possible, because it apparently uses the distance between the two servo positions to calculate the movement curve on the fly. If you don't set the servo to current position after turning it off, speed and acceleration will instead be at maximum, and this will throw the monitor really hard, causing bounce at the far end of travel, likely torque damage to the servo, and probably loosening the mount.
I have a magnet at the far end of travel and a homemade latch to hold the monitor in the right vertical position; on the horizontal I just use a small rubber bumper disc, because the weight of the monitor wants to turn that way anyway. These are both hit by a physical stop I built onto the back of the bumper plate. I tried a magnet latch there and it was actually too strong! I do have some weaker magnets, so may try this again at some point.
Given the much better mount with no binding, I was able to make this work with my original HiTec 645MG servo. Which is good, because the other servo I got needed 7.4V and could draw spikes of 8A, way over what my 6V/3A wallwart could supply.
Once I get some photos uploaded, I will post the full details of the mount for the servo.
DaOld Man:
Glad you got those nagging problems worked out Raph!!!
I see people on here having a lot of trouble with the servos and having to jump through some hoops to get it to work.
Makes me wonder if they are really worth all that work, when DC motors will do the job apparently a lot easier. I do see where servos are good when space is limited, due to the small size of the motor.
Oh well, whats life without challenges?
Good work raph, and thanks for sharing your trials and what you learned.
Now whats your next project?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version