Hi everyone,
nice to be at this forum. This is so cool
I finally got this to work, although as Iām not the brightest light in the house, I need some pointers please.
Setup:
1 x Micro Maestro 6ch Item #1350
1 x Analog servo, range in 784-3280 (Ch settings tab) binding occurs if less or more than those numbers
Power = V(in) + V(servo) pin (bridged mode)
Project: to move a servo into position at pc startup. (actually a panel cover for a radiator)
see you-tube link :
Description:
when PC psu is switched on, the uMaestro gets 5VSB
when pc on button is pressed, Meastro gets 5v high signal (from PSU) goes to channel 05 analog input pin, sweet
servo moves to position and stays there .
When PC shuts down 5V goes low, and servo moves back to āhomeā position.Also sweet!
(optional switch off PC PSU at switch.)
When the power hits the Maestro, it jumps a bit to the position in the script
I cant figure how to get the servo to move a tiny bit only (maybe servo resolution ?)
What to do ?
Hereās the code :
begin
2000 delay
30 0 speed
5 get_position #get the value of input 5 as a number from 0 to 1023
512 less_than # test whether it is less than 512 (2.5v) -> 1 if true, 0 if false if
1 0 servo # this part is run when input5 < 512 (2.5v)
else
10000 0 servo # this part is run when input5 >= 512 (2.5v)
1000 delay
endif
repeat
Are you asking how to control its position during the 2-second delay before you set the position the first time? Why not set the position to exactly what you want on startup? Servos often twitch a little when they are first powered up if they are not receiving any control signal.
I donāt think you answered my second question. Why not set the position to exactly what you want on startup? That is, before your 2-second delay, set the position.
Also, I am a little confused - as far as I can tell, you are setting the servo to the start of its range with ā1 0 servoā, but you say that is not what you want. The default lower limit is 6000 (edit: I should have said 3968), so that is what it will go to if you try to set it to a position of 1.
quote
I donāt think you answered my second question. Why not set the position to exactly what you want on startup? That is, before your 2-second delay, set the position.
Ah, thanks. Cant see the forest for the trees.
this:
1 0 servo
begin
Fixed
Um, could you explain a bit further on this,
Quote:
The default lower limit is 6000, so that is what it will go to if you try to set it to a position of 1.
What do you mean by āFixed :)ā? Does it work the way you want now?
The commands ā1 0 servoā set servo 0 to a position of 1, which will set it to whatever you have the channelās minimum configured to. By default the minimum is actually 3968, or about 1ms, which is a safe minimum value for typical servos (I accidentally wrote 6000 in my post - sorry). I wonder why you are writing 1 instead of the actual position that you want it to go to.
To your question:
1)quote
"The commands ā1 0 servoā set servo 0 to a position of 1, which will set it to whatever you have the channelās minimum configured to "
OK that makes sense.
The analog servo, range in 784-3280 (Ch settings tab) binding occurs if less or more than those numbers
2)quote
"By default the minimum is actually 3968, or about 1ms, which is a safe minimum value for typical servos (I accidentally wrote 6000 in my post - sorry). I wonder why you are writing 1 instead of the actual position that you want it to go to"
Writing 1 (line 1) prevents the servo from swinging at full speed before the servos next position command.
Writing 1 (line 6) sets the default start position, after the servo initialized (line 1).
Whatever the case it works very well and there is only the slightest hint of jitter.
I have tried various integers other than using ā1ā in 2 separate commands (line 1 & 6) and it has proved to be useless. The servo either jumps at high speed to its āenabledā position, or it moves fwd then moves back without reaching itās preset enabled position.
Anyways, its going well, though if there is a better or efficient way to do this Iād be very open to any suggestions.
Iām certain there is a better way to code this but I just dunno, I just copied from the manual and experimented
I already told you that I am confused by why you use 1 and 10000 instead of the actual positions that you want it to go to. If you can post example programs that use the actual positions and tell me what goes wrong, I would be happy to help you debug them. Otherwise, your script is fine - are there any improvements that you are looking for?
Are you trying to say that 784 to 10000 is the full range of your servo? Have you configured the minimum and maximum to something other than the default? If that is the case, this is totally reasonable. I just did not understand why you were going from 1 to 10000 without mentioning that you had changed the limits.
Hi Paul,
quote
Are you trying to say that 784 to 10000 is the full range of your servo?
yep
quote
Have you configured the minimum and maximum to something other than the default?
yes
The channel settings tab shows min/max at 784/3280
Why this doesnāt reflect actual positions in the code is beyond meā¦
So I am using 784 as minimum, and 10000 as maximum in the code
quote
I just did not understand why you were going from 1 to 10000 without mentioning that you had changed the limits.
Sorry, what change in limits ?
Iām baffled, considering Iām not the brightest light in the house, but some how this code seems to work. I really cant figure out why the limits are not the same as in the channel settings tab.
Why arenāt the limits 784/3280 work instead of 1 to 10000 ???
dawg, I havenāt followed this thread too closely, but from your last thread it sounds like maybe you arenāt aware that the position values displayed in the status/channel settings tabs are in microseconds while the values you need to use in your code are in quarter-microseconds. You need to take the number you see in the status/channel settings tabs and multiply it by 4 to get the correct value for your script commands. So if your servoās range is 784 to 3280 microseconds, then the valid values to use in your script are 3136 to 13120.