Maestro - want Get max and min position

Hi

Ive been using the pololu 6 servo driver for many years and the last few using the maestro 6 in my camera mount system to run 2 CR servos and 2 STD ones

One issue has always been the fact I have to re-map the servo ranges in my software to the joystick ranges.
No big deal however over the years there are so many servos with slight variations that I have to use averages to cover most and this costs range as well as lags at end points.

It drives servos to mechanical limits to get about 180 degree and find the 7bit range fine enough to give good resolution but if the range in software is not exactly the same as the range the servo handles then the software sends position above what the servos handles.

Not a problem because I have the absolute limits saved in maestro board so it doesn’t over drive the servo but the software does scale past the stored end point and it has to come back which causes some delay just at the end point, this being because servos vary a bit even though Ive used the same brand and model servo for many years.

The other side of the coin as that if the software range is a bit lower then the servo limit set in maestro then the servos never reaches full range.

It’s been a minor issue up till now with new servos I got a box of vary slightly in end points to previous ones so now the maestro settings are a little more off the 2 above issues are even worse and noticeable.

Problem is a cant just change the range values in software to suit new servos because the software has to work for all older units over years as well and Ill have to have version for each servo types.
Older owners loose their software and then need to dload a copy so I need to be able to stick to the same version for all owners.

So I decided to only way around this is to use SSC commands to remap the input to 0-254 8 bit and that way I can set the new end points in maestro for the servos on that unit and use SSC limits hard coded on software to deal with it.

Failed.
The 255 range is just too coarse control for the servos and spread over 180 degree stop to stop each value increase jumps noticeably so it no good.

So next brain storm I decided Ill just send position command with a value well above the end points saved on board and then use “get position” and hopefully the board ignore values above the stored value I sent to it and I get back a “get position” value that gives me the maximum value saved on board the maestro.
Then do same for min value.
However to do this on start up Ill need another really to turn off servo power so the thing doesn’t starting moving all over the place just to find it min and max position range in the maestro board.
That’s nuts.

What I really need is a command like 'Get Position" that is “Get Min/Max” that returns the min and max position values stored in the maestro board.
Same as “Get position” from a given device number and servo but “Get Min/Max” just returns the end points set into the maestro for that servo number.

That way I can set the maestro board with the USB to put hard limits into it for the servos on the unit, then all the software needs to do is “Get Min/Max” values to be able to map it range to the joystick input values.

Also needed for the 2 constant rotation servos that have slight variation in center point that stops the servo moving.
using maestro control panel I can set the range so the centre of the range is exactly centre for the CR servo on that channel to assure no drift on centre as well as the same speed in each direction.

I have a setup in software to set this deadband and centre for the servo but every time the owner installs a new they have to do this setting and its not so easy for them.
Being able to set the CR servo values in maestro and just grab the end points with a command for each servo number at software start means the software can calibrate itself to the ranges set in maestro for constant rotation without the software users having to do it manually.

The one thing that is great about maestro over the old pololu6 is it can save the range values in it so its great to ensure no software errors can mechanically over drive the servos.

It just a shame we cant get the servo min/max range values back from it, from the software side I still have the issues that came with the polou 6 and cant make use of the stored values in maestro 6 to have the software benefit from the things the maestro can do the old one could not.
SSC is a poor fall back to re-mapping ranges from input to output.

Can this command be added ?

It can already get the position values stored for each servo, just not the min and max values set for each servo
That would be very useful for anyone controlling servos with a joystick or some other input to allow their software to re-map the input to put properly each time.
They can even use the software on various boards with different servo ranges and values in them, so long as the software can get the range values from the maestro in a simple command it can re-map easily to the input range.

At some point I am going to have so many version of software for each unit Ill end up sending someone the wrong one and it will have bugs and then trouble will start because they all use the gear for work not pleasure.

So far Ive set the hard limits in maestro board for each unit to suit the servos on it, dozens over some years.
If I can get this command added to maestro to get min and max stored values for each servo I can supply every owner the same software and know it wont have problems with servos not going to full range or lags at end points, or drifting of CR servos.

Regards
Dave

Hello, Dave.

You bring up some good points about why that information can be useful. There is no TTL serial command for getting parameters like the min and max values for each channel, but if you are controlling the Maestro over USB, you can use the native USB interface and run the UscCmd utility to get all of the settings from the Maestro, including the min and max values. You can find the source code for that in the Pololu USB SDK.

By the way, it sounds like you are building the Maestro into a product. That sounds really interesting, and we would love to hear more about it if you do not mind sharing.

-Brandon

Thanks for the reply Brandon

All my units I’ve sold over the years are wireless over Bluetooth so am limited to serial commands.

USB connection tethers it to a computer.
And the USB SDK requires a lot of coding and for purposes the serial commands cover pretty much evertything I need WRT to driving servos with it.
And besides I write PC apps in VB6 so USB is out other than serial.

Using serial I can drive it by other means from a PC to a PICAXE or over legacy serial comms and can allow buyers to drive it off in house applications once they know the simple code to use.
I am about to write apps in B4X for Android and iOS mobile using the phone BT for serial to drive the BT modem in the cam mount that is connected ot the Maestro.
I need to flexibilty the serial commands provide over TTL to drive it by various means.

Likewise I want to be able to avoid various versions of the software for variations in servos and have the software auto calibrate the input to output range mapping.
Like for a joystick that reports min and max, unlike old ones that required every program to have a joystick cal procedure coded.

If the Maestro reported the same it would be like the diff betwen old joysticks that only report position and new ones that reposrt min and max too.
Making coding to run it a lot simpler for anyone and am sure a lot of people run the boards using some scaled input device they need to map to the output.
And have a pile of hard coded and saved values in the software just to do that job, it makes the programing messy.

Anyone intending on using these in production will no doubt encounter this issue and at some point it will be the one remaining obstacle that has only 1 option
That is to look for another product that likeiwise takes serial commands, drives servos, has inputs to read, and reports set ranges to allow softwares to auto map input to put ranges.
I can do the serial to PWM with a PIC chip and store values to EEPROM for each hardware unit so the software can read range values and then send it suitable values.

Im not quite at the point this scaling issue is bugging me enough to make the move.
But Ive got the the point Im posting here in the hope this can be resolved.

As mentioned above even for one off users it would make input to output scaling precise and with less code to write and no nasty hard coding of range values.

Having the range read from the hardware to software removes the need to change the software hard coded values with every hardware change or risk the scalling being wrong.
For a joystick proportional postion control that means a dead gap at the maxium stick movements the servo doesnt move when the stick does, in the case of constant rotation servos it results in one direction being faster then the other.
So having the values match is important or it makes the joystick proportional control a bit sloppy.

As mentioned Mini SSC for this is too coarse, and too old to still use.

The real question I guess would be is it possible to add this command to the serial comand set.
Get min and Get max in 2 calls to get the full values for each back in the same format is Get position.
If it was possible to do in code could it be a firmware upgrade, it would not effect any other existing functions it would just be there for those who need to use it.

Cheers
Dave

Unfortunately, there is no room on the Maestros to add any features without taking others off. We expect to work on some new Maestros next year, and we will try to get these features built in. If you need something more immediate and your volume is high enough, we can probably make some custom firmware for the existing hardware, but you would need to decide which features to leave off. If this is something you are interested in, please contact us through email at support@pololu.com.

-Brandon

Thanks Brandon

I’m doubt I would be using enough volume to justify a special build for it, its more that I’ve been using them for a quite a few years which has amounted to a fair few of them.

This is the cam mount

FWIW if there was a feature in it I don’t need its the Mini SSC
And at a guess it’d be a very old bit of kit that would still be fixed to using it since its only a matter of code changes to revert to the newer one.
And for anyone that prefers the fixed range output, if there was Min and Max commands for the other protocols then that would provide the range to use in software making the hard coded 0 255 for Mini SSC a bit redundant
If the commands can return the range values to any software then having a pre mapped range as SSC has doesn’t really serve any purpose anymore.

Anyway if you can get it done at some stage Id appreciate it and am sure anyone using proportional input to drive servos would too to make mapping simple.

Cheers
Dave

Looking at another work around I mentioned before, I found that if a target command is sent that is above what is set in the Maestro board, when the Get position is called it returns the set maximum back not the value I sent it above the board value.

Likewise at the minimum end point, the return value matches the sent value but if the sent value is below the set minimum on board each command sent below that always returns the set minimum.

Meaning I can write a routine that calibrates the mapping for servos by moving each servo to past its on board set range in software and then reading Max value, then doing the same with a command under the on board set value to get the Min value set.
Then do that for each servo.
It will cause the servos to all to run to maximum end points set on board but if I save those values in a “first run” calibration routine in software initially then I can use those saved values on software startup without needing to get the values from the mount each time.

It’s a bunch of code to do the job and a not an optimal fix but for users the initial setup will only need to run once after install itself without input from them so it will do the job, and make the end points more exact to the joy inputs so that’s an overall improvement to the end user.
I tune the on board end points for the CR servos to get dead centre on each to stop drift so this will ensure the software is using dead centre in sync with the on board values and ensure same speed in both directions and 0 drift.