I'm trying to get this code cleaned up and added to the OBEX. I also plan to start a thread in the multirotor forum to hlep describe the features of the various versions of the ESC programming code.
I'm hoping some of you would look over the output from the Parallax Serial Terminal version of the program and let me know if you have any suggestions on improving the content or formatting of output.
To make sure the user has had time time open PST, I have the program display:
Press any key to begin.
Press any key to begin.
Press any key to begin
The "Press any key to begin" line is displayed four times a second until a key is pressed.
Once a key has been pressed, an instructions screen is displayed:
ESC Programmer
This program allows you to program your Electronic Speed Controller (ESC) with
a Propeller microcontroller.
ESC Connectors
The ESC has eight wires. Three of these wires connect with the motor. It is not
required to have a motor connected to the ESC when programming the ESC. Two of
eight wires are used to provide power to the ESC. You will be instructed by the
program when you should connect the ESC to the power supply. The remaining three
wires are physically joined together to form a multi-color ribbon cable. This
three wire cable will be used to program the ESC.
The signal wire (often colored white or orange) should be connected to P26.
The ground wire (often colored black or brown) should be connected to the ground
on the Propeller board.
Do NOT connect the center wire to the Propeller board.
Cycling ESC Power
The ESC only transmits the current settings when first powered on. In order to
confirm the ESC has been properly programmed, the power to the ESC will need to
be disconnected and connected again.
The program will provide a prompt when the power to the ESC should be cycled.
Pull-Up Resistor
Some speed controllers will not be able to communicate with the Propeller
without a pull-up resistor on the I/O pin used to interface with the signal line.
For more information about using a pull-up resistor see the following thread in the
Parallax Multirotor Forum:
http://forums.parallax.com/showthread.php/154854 PLACE HOLDER URL
Press any key to continue.
I know no one wants to read a screen full of instructions but I felt like the user should be provided with some information about how to use the program. I'm open to suggestions if any of you think more information should be displayed or if less information is needed. I'm also open to changes in how the instructions are worded or formatted.
One a key is pressed a second time, a new window will appear with the various parameters and their settings. I'll add post the output from these other windows in a bit.
I've also been working on adding information about each parameter as it is selected. I'll post my "help" sections soon in hopes of getting feedback on what I've written.
For now, I'm hoping for feedback on this initial instructions section.
I'm attempting to add some information about each parameter to be displayed whenever the parameter is made active for editing. I'm debating about adding double quotes around parameter names and setting names.
Here's and example of parameter information being displayed both without and with double quotes.
Without quotes:
Start Mode determines how quickly power is applied to the motor as the
throttle is changed.
The Soft and Very Soft settings can be useful when used with helicopters.
The relatively massive blades of a helicopter may require the motors to
spool up as power is applied.
Start Mode should be set to Normal for quadcopters and airplanes.
With quotes:
"Start Mode" determines how quickly power is applied to the motor as the
throttle is changed.
The "Soft" and "Very Soft" settings can be useful when used with helicopters.
The relatively massive blades of a helicopter may require the motors to
spool up as power is applied.
"Start Mode" should be set to "Normal" for quadcopters and airplanes.
I'm inclined to use the double quotes. I think they help identify when a word is a parameter or setting.
I like the quotes, they flag the jargon without hurting readability.
Agreed.
Adding quotes sure makes the Spin code hard to read.
byte "Always use ", QUOTE, "Soft-Cut", QUOTE, " as the ", QUOTE, "Cut Off Type", QUOTE, " when using the ESC with a quadcopter."
byte Debug#CE, 13
byte "The only time to use ", QUOTE, "Cut-Off", QUOTE, " is when you are using the ESC with an airplane."
byte Debug#CE, 13
byte "When ", QUOTE, "Cut Off Type", QUOTE, " is set to ", QUOTE, "Cut-Off", QUOTE, ", the ESC will turn off power to the motor"
byte Debug#CE, 13
byte "once the cut off voltage is reached."
byte Debug#CE, 13
byte "When ", QUOTE, "Cut Off Type", QUOTE, " is set to ", QUOTE, "Soft-Cut", QUOTE, ", the ESC will gradulally reduce power to"
byte Debug#CE, 13
byte "the motor when the cut off voltage is reached."
byte Debug#CE, 13
byte "The power cut off feature may be disabled by setting the ", QUOTE, "Battery Type", QUOTE, " to ", QUOTE, "Ni-xx", QUOTE
byte Debug#CE, 13
byte "and ", QUOTE, "Cut Off Voltage", QUOTE, " to ", QUOTE, "Low", QUOTE, "."
byte Debug#CE, 13, Debug#CE, 13, Debug#CE, 13, Debug#CE, 13, 0 '7 + 4 carriage returns
Above is the "Cut Off Type" text. Obviously the constant "QUOTE" is being used to represent the double quote character. I think having the quotes in the displayed text will be worth the extra effort.
Here's what it will look like when it's displayed.
Always use "Soft-Cut" as the "Cut Off Type" when using the ESC with a quadcopter.
The only time to use "Cut-Off" is when you are using the ESC with an airplane.
When "Cut Off Type" is set to "Cut-Off", the ESC will turn off power to the motor
once the cut off voltage is reached.
When "Cut Off Type" is set to "Soft-Cut", the ESC will gradulally reduce power to
the motor when the cut off voltage is reached.
The power cut off feature may be disabled by setting the "Battery Type" to "Ni-xx"
and "Cut Off Voltage" to "Low".
I'm just about ready to post the information for the other parameters.
I'm trying to provide information so the correct settings will be selected and give reasons why a particular setting is best when the ESC is used in a quadcopter.
Here's the information provided for each parameter.
Brake:
When "Brake" is on, the ESC will force the motor to slow down.
When "Brake" is off the motor will coast.
Battery Type:
The ESC uses the "Battery Type" parameter to know when to shut off the motors.
If you are using an alarm with your quadcopter, you may want to completely
disable the cut off feature by setting the "Battery Type" to "Ni-xx".
If you do not have an alarm, set the "Battery Type" to "Li-xx".
Cut Off Type:
Always use "Soft-Cut" as the "Cut Off Type" when using the ESC with a quadcopter.
The only time to use "Cut-Off" is when you are using the ESC with an airplane.
When "Cut Off Type" is set to "Cut-Off", the ESC will turn off power to the motor
once the cut off voltage is reached.
When "Cut Off Type" is set to "Soft-Cut", the ESC will gradulally reduce power to
the motor when the cut off voltage is reached.
The power cut off feature may be disabled by setting the "Battery Type" to "Ni-xx"
and "Cut Off Voltage" to "Low".
Cut Off Voltage:
"Cut Off Voltage" is used to indicate the voltage level the ESC should cut power to motor. This voltage level will depend on
which "Battery Type" was selected. If the "Li-xx" type was selected, the ESC will automatically detect the number of cells in
your pack and the ESC will cut power to the motors when the following voltage levels are reached.
If "Battery Type" = "Li-xx" then: "Low" = 2.6V per cell. "Middle" = 2.85V per cell. "High" = 3.1V per cell.
If "Battery Type" was set to "Li-xx", then "Cut Off Voltage" should be set to "High" in order to reduce damage to the
battery pack. LiPo batteries can be damaged if the voltage is allowed to drop below a safe level. This safe level is between
3.3V and 3.5V. Using a battery alarm will likely prolong the life of your LiPo packs.
If "Battery Type" was set to "Ni-xx", the ESC uses a percentage of the initial voltage to determine when to cut power to the
motor.
If "Battery Type" = "Ni-xx" then: "Low" = Cut Off disable. "Middle" = 45% initial voltage. "High" = 60% initial voltage.
In order to disable the "Cut Off" feature the "Battery Type" needs to be set to "Ni-xx".
Start Mode:
"Start Mode" determines how quickly power is applied to the motor as the
throttle is changed.
The "Soft" and "Very Soft" settings can be useful when used with helicopters.
The relatively massive blades of a helicopter may require the motors to
spool up as power is applied.
"Start Mode" should be set to "Normal" for quadcopters and airplanes.
Timing Mode:
The best Timing Mode setting will depend on the type of motor being used.
Most quadcopter motors will work well with the "Middle" setting.
Music/Li-Po Cells:
The "Music/Li-Po Cells" setting will either set which song the ESC will
play on start up or it is used to set the number of "Li-Po Cells" in your
battery pack. ESCs with the postfix HV (for high voltage) can use this
setting to indicate the number of cells in the pack.
Most ESCs do not support setting the number of cells and this feature
is not presently supported by this program.
The "Music" feature is also not supported.
Governor Mode:
The "Governor Mode" should be left "Off" when using the ESC in a
quadcopter or airplane.
When using the ESC in a helicopter with "Governor Mode" turned "On",
the ESC will attempt to maintain the rotor's speed as the pitch of
the blade is changed. The "Governor Mode" should only be turned "On"
when the throttle and collective pitch are controlled with separate
RC channels.
I tried to make it clear how to disable the power cut off feature. After reading about these various parameters, I finally understood why I saw so many suggestions to set the Battery Type to Ni-xx even when using LiPo cells. The only way to disable the cut off feature is to set Battery Type to Ni-xx and Cut Off Voltage to Low.
Let me know if I got any of the above wrong.
If any of you think more should be added, let me know.
Hopefully I can find a "HV" (high voltage) ESC so I can properly add the "Li-Po Cell" parameter to the program. Apparently this parameter is only used on high voltage ESCs.
I wanted to mentions a couple of sources of information I found about the various parameters.
Kyle gave a lot of great information in his earlier post to this thread. In the information posted above, I suggested the user set the "Cut Off Voltage" to "High" while Kyle suggests "Middle". I figure if you're going to let the ESC tell you when your battery is low, you want as much warning as possible. It could be argued it's not a good idea to have the ESC interfere with the throttle setting until absolutely required. If you wanted to delay the time the ESC would interfere with the throttle, then the setting Kyle suggested is a better option.
While the "Cut Off Voltage" setting could be debated, I don't think you'll find many who don't agree an alarm on the battery is a good idea.
I couldn't find the post, but I remember Kyle said he was testing a bunch of different alarms trying to decide which one Parallax should sell. I don't know if Kyle stayed around long enough to decide on the alarm but it looks like Parallax decided to go with one almost identical to the one suggested in post #34.
This is the one I suggested (after erco told me about it).
I'm willing to wager one of my meter/alarms, the two devices are the same except for the case. I think the meter/alarm Parallax sells looks like good one.
I had thought the code attached to post #113 was pretty much finished (except for needing some additional information about the parameters), but as I test the code now, I keep finding "rough edges" in need of smoothing. I'll get these small issues fixed within the next few days so I can submit a proper program to the OBEX.
OK. So I purchased a used older Elev 8 from a Parallax member. However, there is no ESC card and he said he does not believe they were pre programmed. So, is using a QS board now an option and if so, how do I connect it and is there code in the OBEX for it?
Comments
Jim
I'm hoping some of you would look over the output from the Parallax Serial Terminal version of the program and let me know if you have any suggestions on improving the content or formatting of output.
To make sure the user has had time time open PST, I have the program display:
The "Press any key to begin" line is displayed four times a second until a key is pressed.
Once a key has been pressed, an instructions screen is displayed:
I know no one wants to read a screen full of instructions but I felt like the user should be provided with some information about how to use the program. I'm open to suggestions if any of you think more information should be displayed or if less information is needed. I'm also open to changes in how the instructions are worded or formatted.
One a key is pressed a second time, a new window will appear with the various parameters and their settings. I'll add post the output from these other windows in a bit.
I've also been working on adding information about each parameter as it is selected. I'll post my "help" sections soon in hopes of getting feedback on what I've written.
For now, I'm hoping for feedback on this initial instructions section.
Here's and example of parameter information being displayed both without and with double quotes.
Without quotes:
With quotes:
I'm inclined to use the double quotes. I think they help identify when a word is a parameter or setting.
Any opinions one way or the other?
my 2 cents....
-Russ
Agreed.
Adding quotes sure makes the Spin code hard to read.
Above is the "Cut Off Type" text. Obviously the constant "QUOTE" is being used to represent the double quote character. I think having the quotes in the displayed text will be worth the extra effort.
Here's what it will look like when it's displayed.
I'm just about ready to post the information for the other parameters.
I'm trying to provide information so the correct settings will be selected and give reasons why a particular setting is best when the ESC is used in a quadcopter.
Brake:
Battery Type:
Cut Off Type:
Cut Off Voltage:
Start Mode:
Timing Mode:
Music/Li-Po Cells:
Governor Mode:
I tried to make it clear how to disable the power cut off feature. After reading about these various parameters, I finally understood why I saw so many suggestions to set the Battery Type to Ni-xx even when using LiPo cells. The only way to disable the cut off feature is to set Battery Type to Ni-xx and Cut Off Voltage to Low.
Let me know if I got any of the above wrong.
If any of you think more should be added, let me know.
Hopefully I can find a "HV" (high voltage) ESC so I can properly add the "Li-Po Cell" parameter to the program. Apparently this parameter is only used on high voltage ESCs.
Kyle gave a lot of great information in his earlier post to this thread. In the information posted above, I suggested the user set the "Cut Off Voltage" to "High" while Kyle suggests "Middle". I figure if you're going to let the ESC tell you when your battery is low, you want as much warning as possible. It could be argued it's not a good idea to have the ESC interfere with the throttle setting until absolutely required. If you wanted to delay the time the ESC would interfere with the throttle, then the setting Kyle suggested is a better option.
While the "Cut Off Voltage" setting could be debated, I don't think you'll find many who don't agree an alarm on the battery is a good idea.
I couldn't find the post, but I remember Kyle said he was testing a bunch of different alarms trying to decide which one Parallax should sell. I don't know if Kyle stayed around long enough to decide on the alarm but it looks like Parallax decided to go with one almost identical to the one suggested in post #34.
Here's the alarm/meter Parallax sells.
This is the one I suggested (after erco told me about it).
I'm willing to wager one of my meter/alarms, the two devices are the same except for the case. I think the meter/alarm Parallax sells looks like good one.
Besides Kyle's post about the various parameters and the programming card's instructions, I also found some information about the various parameters on the Flitetest website.
I had thought the code attached to post #113 was pretty much finished (except for needing some additional information about the parameters), but as I test the code now, I keep finding "rough edges" in need of smoothing. I'll get these small issues fixed within the next few days so I can submit a proper program to the OBEX.