Flight testing of "AileronAssist" is complete. This is the firmware that I had in mind when I started out. It controls ailerons and elevator to stabilize neutrally stable aircraft and performs return to launch. I was able to use it to fly a Goldberg Endurance with some confidence and ease. This is an aircraft that I crashed 5 times last summer. I have finally soloed with it, though most of the credit goes to "AileronAssist", to Paul Bizard, and to everyone else who has helped me so far.Above is a picture of my Endurance, with the electronics mounted on top with velcro, just like I tell everyone else not to doThe firmware and documenation is available on the main page for UAV DevBoard. For those of you who have the board and have tried MatrixNav, the next step is to try AileronAssist in a neutrally stable aircraft. I think you are going to like it. Its smoother and more precise than I ever imagined it could be.The weather is good today, I am going to get out of here and go do some flying.Best regards to everybody,Bill PremerlaniPS For those of you waiting for restocking of the UAV DevBoard, the first board off the production line is on its way to me. When it arrives, I am going to do thorough flight testing with it before releasing it. I will make an announcement.
Hi Bill,
I got the Roll-Pitch-Yaw demo uploaded using the Olimex ICD2 and MPLAB IDE 7.5 but no such luck with the aileronassistRv1.7. After converting the program in project wizard and attempting a project “make”, I get the following errors:
rudderCntrl.c:9: error: 'YAWKD' undeclared here (not in a function) rudderCntrl.c:11: error: 'YAWBOOST' undeclared here (not in a function) rudderCntrl.c: In function 'rudderCntrl': rudderCntrl.c:35: error: 'ruddtrim' undeclared (first use in this function) rudderCntrl.c:35: error: (Each undeclared identifier is reported only once rudderCntrl.c:35: error: for each function it appears in.)
I am pleased that you are having fun. That is why I am doing this.
A couple more tips before you fly:
I recently revised aileronassist. You should use version 1.7.
You have the option of using altitude hold or not. I suggest starting off without altitude hold, it will be easier to be able to see the response to adjustments that you make to the gains.
You can get the gains pretty close to what you need by doing some ground testing: roll and pitch your plane in stabilized mode, and see if the amount of aileron and elevator response is about what you would do in the same situation.
Finally, be aware that too much vibration will disrupt the operation of the LISY gyros. To check whether you are going to need to isolate the board from the vibration generated by your motor, run the rollpitchyaw demo with the board mounted in your plane, with and without the motor running. You can connect the ailerons and elevator to the board as indicators. If the demo is still normal after a couple of minutes with the motor running, replace the demo with aileronassist, and you are cleared for takeoff.
However, if there are unexplained deflections of the ailerons or elevator, or if there is a difference in performance with and without the motor running, you will need to take some steps to isolate the board from vibration. In that case, contact me, I will give you some suggestions.
Success...I was able to upload the rollpitchyawdemo with the Olimex ICD2 by reverting back to the older version of MPLAB IDE. I had written to Sparkfun about the Olimex/MPLAB issue and here is their response:
“Are you programming dsPICs? As far as I've heard, this was only the
case with those. It is true that our newest batch of these programmers
should alleviate this problem. As long as your ICD2 is unmodified,
you're welcome to return it and get it replaced with one of the newer
ICD2s.”
This sounds good but I don’t know if my programmer is from the old or new batch so I don’t really know if the issues have been resolved. Either way, I’ve got things working now and also have a Pickit2 coming in the mail to make uploads easier in the future.
This is a lot of fun learning about Bill’s approach to autonomous control and then downloading his code and watching it in action. There is so much clear, easy to read documentation for the DevBoard and he is always willing to share his knowledge. I’ve been through the self test firmware and rollpitchyawdemo. Next up is aileronassist and then it’s time to fly.
Bryan,
One more thing. You are "good to go" with MPLAB version 7.50, if you want. Your ICD2 is working now, as far as I can tell from you comments. The last hurdle for you to get over is for you to use the project wizard to rebuild the projects in the older format. Once you do that, I fully expect that you can build the software and program your board. So, you are in business, if you want to keep your ICD2.
I think the PICkit2 is the best solution for you. If it turns out that the problem is with MPLAB and you still have trouble, then Microchip would help you.
In any case, please contact Sparkfun, they need to know that the problem has not been fixed.
Regarding the warning "Unable to load the workspace because the format of the workspace file has changed.”, that is because the older version of MPLAB does not recognize the format of the project files generated by the newer version of MPLAB. So, you have to recreate the project using the MPLAB project wizard. I think the instructions for that are in one of John Mac's posts. Here are a couple of gotcha's to watch out for:
1. In the projects that I created, I made the red/green board selection with a project macro. It would probably be simpler for you when you recreate the project to go into the options file and explicitly select the configuration for either the red board, or the green board, depending.
2. Depending on which version of the firmware you are using, in some of the older versions of the firmware there were some files in zip file that were not used in the project. They generally had something like "bak" in their names. Do not include them in the project, otherwise you will get compiler errors.
3. There are a couple of Microchip files that you will have to find and add to the project in order for you to be able to finish compiling and building it. One file is a linker script for the dsPIC30F4011. The other is a library file for the matrix and vector routines that I use. I do not remember the names of them off hand, but if you cannot find them, let me know, I will give you more specific info.
I am sorry that you ran into trouble with the ICD2.
Personally, I think there is some sort of strange system issue that involves both the hardware and MPLAB. I notice that Microchip is offering a trade-in discount on a new ICD3 if you send in an old ICD2, so maybe they are aware of the problem. Who knows.
One more note: I just reread the previous posts and noticed John Mac had the exact same issues I'm going through so I guess one solution is to follow his fix. I'd rather use the latest IDE and an ICD2 that is compatable.
My Olimex is only a few weeks old so you'd think it was one of the new ones that are supposed to be compatable. Not so sure a replacement would be any better.
You had mentioned, "Also, I bought a PICkit2 from Microchip for $40, just to see. It works just fine for me with the latest release of MPLAB. The only thing is, you have to remove the polarizing tab from the ICSP connector on the UAV DevBoard." I'm thinking this might be the best solution.
Thanks
Bill,
Sorry to bug you again but this is my last attempt before returning the Olimex ICD2.
1) Gave up on Vista and successfully downloaded drivers by switching to my desktop that runs XP.
2) During the “Connect” execution, I got the ICDWarn0020 that you described in your problems section but after clicking “OK”, I got a “passed” so I went on to the next step.
3) During “program” execution, I got “Warning, ICD2 cannot validate a target device. Make sure target is connected and powered.” Programming failed.
So I took the following steps:
a) Looked under the power tab and the voltages were fine.
b) Replaced the programming cable with three wire servo cables.
c) Made sure dsPIC30F4011 was selected.
I repeated the Program execution but got the same error.
Next step:
Removed latest version of IDE and replaced with version 7.50.
Now I’m getting the following warning when I attempt to open the rollpitchyaw demo:
“Unable to load the workspace because the format of the workspace file has changed.”
Any final advice before I attempt to return the Olimex back to SparkFun?
I have some more information for you that may help you.
I just installed MPLAB on my wife's laptop computer, which is running Vista. (By the way, for whatever reason, my wife's laptop runs incredibly slow, I suspect that the problem is with Vista.) And, MPLAB connects ok to the ICD2. The following observations that I made during the installation may help:
1. I installed MPLAB IDE first, without the ICD2 being connected. I think that is important. Otherwise, plug and play will look for a driver for the ICD2 when you connect it, and it will install default drivers, and then you are hosed.
2. I am pretty sure that the installation of MPLAB IDE included the drivers for the ICD2. Particularly because:
3. Near the end of the installation, there were several security popup notices telling me that Vista was not able to verify the publisher of a driver that was trying to install, did I want to install anyway. Of course, I said yes.
4. At the end of the installation, there was a popup that said that I would need to restart the computer before I could do anything else with MPLAB. Of course, I hated to do that, but what choice did I have?
5. After the restart, there were several more popups asking me if I wanted to install drivers. Of course, I said yes.
6. After the popups stopped popping up, I plugged in the ICD2. Then there were a couple more popups telling me that new hardware had been found, and then plug and play found the new drivers that had been installed with MPLAB, and everything was cool.
So, if by the time you read this, you do not have your ICD2 working, I suggest the following:
1. Disconnect your ICD2 from your computer.
2. Reinstall MPLAB. Pay attention to the popups, and permit any drivers that need to be installed.
3. As much as you hate to do it, restart the computer when you get that request.
4. After the restart, wait a bit to see if you get any more requests for driver installations.
5. Connect your ICD2, and read the popups that you get to see if you get the right drivers.
I did not realize that you were running Vista, it might be different for Vista. I am runnng Windows XP, for that you install MPLAB IDE first, then you connect the ICD2, and installation completes by itself. With XP, you run into trouble if you plug in the ICD2 before you install MPLAB. They warn you about that.
I am not familiar with Vista, I am hoping that someone reading this can give you more help than I can. Otherwise, based on what you are telling me, I suggest the following:
Disconnect the ICD2. Check under the hardware manager and see if there is some unknown hardware that has failed installation. If so, delete it. Then plug the ICD2 back in, and see if you can find the drivers.
You might also browse the Microchip site, and see if there is any information about problems with MPLAB and Vista.
Thanks for the quick response. I'm following the MPLAB IDE instructions for ICD 2 USB Device Driver, First Time Installation ;For Windows Vista® 32 OS.
The first step says to plug in the ICD2 to the PC. This prompts the "Found new hardware" dialoge box to open. Then the instructions say to use this box to browse for the driver software in the Microchip folder.
How do you install the drivers without connecting the ICD2? Could this be a Vista issue?
Comments
I got the Roll-Pitch-Yaw demo uploaded using the Olimex ICD2 and MPLAB IDE 7.5 but no such luck with the aileronassistRv1.7. After converting the program in project wizard and attempting a project “make”, I get the following errors:
rudderCntrl.c:9: error: 'YAWKD' undeclared here (not in a function) rudderCntrl.c:11: error: 'YAWBOOST' undeclared here (not in a function) rudderCntrl.c: In function 'rudderCntrl': rudderCntrl.c:35: error: 'ruddtrim' undeclared (first use in this function) rudderCntrl.c:35: error: (Each undeclared identifier is reported only once rudderCntrl.c:35: error: for each function it appears in.)
Any ideas on where I’m going wrong?
Thanks again
I am pleased that you are having fun. That is why I am doing this.
A couple more tips before you fly:
I recently revised aileronassist. You should use version 1.7.
You have the option of using altitude hold or not. I suggest starting off without altitude hold, it will be easier to be able to see the response to adjustments that you make to the gains.
You can get the gains pretty close to what you need by doing some ground testing: roll and pitch your plane in stabilized mode, and see if the amount of aileron and elevator response is about what you would do in the same situation.
Finally, be aware that too much vibration will disrupt the operation of the LISY gyros. To check whether you are going to need to isolate the board from the vibration generated by your motor, run the rollpitchyaw demo with the board mounted in your plane, with and without the motor running. You can connect the ailerons and elevator to the board as indicators. If the demo is still normal after a couple of minutes with the motor running, replace the demo with aileronassist, and you are cleared for takeoff.
However, if there are unexplained deflections of the ailerons or elevator, or if there is a difference in performance with and without the motor running, you will need to take some steps to isolate the board from vibration. In that case, contact me, I will give you some suggestions.
Best regards,
Bill
“Are you programming dsPICs? As far as I've heard, this was only the
case with those. It is true that our newest batch of these programmers
should alleviate this problem. As long as your ICD2 is unmodified,
you're welcome to return it and get it replaced with one of the newer
ICD2s.”
This sounds good but I don’t know if my programmer is from the old or new batch so I don’t really know if the issues have been resolved. Either way, I’ve got things working now and also have a Pickit2 coming in the mail to make uploads easier in the future.
This is a lot of fun learning about Bill’s approach to autonomous control and then downloading his code and watching it in action. There is so much clear, easy to read documentation for the DevBoard and he is always willing to share his knowledge. I’ve been through the self test firmware and rollpitchyawdemo. Next up is aileronassist and then it’s time to fly.
One more thing. You are "good to go" with MPLAB version 7.50, if you want. Your ICD2 is working now, as far as I can tell from you comments. The last hurdle for you to get over is for you to use the project wizard to rebuild the projects in the older format. Once you do that, I fully expect that you can build the software and program your board. So, you are in business, if you want to keep your ICD2.
Best regards,
Bill
I think the PICkit2 is the best solution for you. If it turns out that the problem is with MPLAB and you still have trouble, then Microchip would help you.
In any case, please contact Sparkfun, they need to know that the problem has not been fixed.
Regarding the warning "Unable to load the workspace because the format of the workspace file has changed.”, that is because the older version of MPLAB does not recognize the format of the project files generated by the newer version of MPLAB. So, you have to recreate the project using the MPLAB project wizard. I think the instructions for that are in one of John Mac's posts. Here are a couple of gotcha's to watch out for:
1. In the projects that I created, I made the red/green board selection with a project macro. It would probably be simpler for you when you recreate the project to go into the options file and explicitly select the configuration for either the red board, or the green board, depending.
2. Depending on which version of the firmware you are using, in some of the older versions of the firmware there were some files in zip file that were not used in the project. They generally had something like "bak" in their names. Do not include them in the project, otherwise you will get compiler errors.
3. There are a couple of Microchip files that you will have to find and add to the project in order for you to be able to finish compiling and building it. One file is a linker script for the dsPIC30F4011. The other is a library file for the matrix and vector routines that I use. I do not remember the names of them off hand, but if you cannot find them, let me know, I will give you more specific info.
I am sorry that you ran into trouble with the ICD2.
Personally, I think there is some sort of strange system issue that involves both the hardware and MPLAB. I notice that Microchip is offering a trade-in discount on a new ICD3 if you send in an old ICD2, so maybe they are aware of the problem. Who knows.
Best regards,
Bill
My Olimex is only a few weeks old so you'd think it was one of the new ones that are supposed to be compatable. Not so sure a replacement would be any better.
You had mentioned, "Also, I bought a PICkit2 from Microchip for $40, just to see. It works just fine for me with the latest release of MPLAB. The only thing is, you have to remove the polarizing tab from the ICSP connector on the UAV DevBoard." I'm thinking this might be the best solution.
Thanks
Sorry to bug you again but this is my last attempt before returning the Olimex ICD2.
1) Gave up on Vista and successfully downloaded drivers by switching to my desktop that runs XP.
2) During the “Connect” execution, I got the ICDWarn0020 that you described in your problems section but after clicking “OK”, I got a “passed” so I went on to the next step.
3) During “program” execution, I got “Warning, ICD2 cannot validate a target device. Make sure target is connected and powered.” Programming failed.
So I took the following steps:
a) Looked under the power tab and the voltages were fine.
b) Replaced the programming cable with three wire servo cables.
c) Made sure dsPIC30F4011 was selected.
I repeated the Program execution but got the same error.
Next step:
Removed latest version of IDE and replaced with version 7.50.
Now I’m getting the following warning when I attempt to open the rollpitchyaw demo:
“Unable to load the workspace because the format of the workspace file has changed.”
Any final advice before I attempt to return the Olimex back to SparkFun?
I have some more information for you that may help you.
I just installed MPLAB on my wife's laptop computer, which is running Vista. (By the way, for whatever reason, my wife's laptop runs incredibly slow, I suspect that the problem is with Vista.) And, MPLAB connects ok to the ICD2. The following observations that I made during the installation may help:
1. I installed MPLAB IDE first, without the ICD2 being connected. I think that is important. Otherwise, plug and play will look for a driver for the ICD2 when you connect it, and it will install default drivers, and then you are hosed.
2. I am pretty sure that the installation of MPLAB IDE included the drivers for the ICD2. Particularly because:
3. Near the end of the installation, there were several security popup notices telling me that Vista was not able to verify the publisher of a driver that was trying to install, did I want to install anyway. Of course, I said yes.
4. At the end of the installation, there was a popup that said that I would need to restart the computer before I could do anything else with MPLAB. Of course, I hated to do that, but what choice did I have?
5. After the restart, there were several more popups asking me if I wanted to install drivers. Of course, I said yes.
6. After the popups stopped popping up, I plugged in the ICD2. Then there were a couple more popups telling me that new hardware had been found, and then plug and play found the new drivers that had been installed with MPLAB, and everything was cool.
So, if by the time you read this, you do not have your ICD2 working, I suggest the following:
1. Disconnect your ICD2 from your computer.
2. Reinstall MPLAB. Pay attention to the popups, and permit any drivers that need to be installed.
3. As much as you hate to do it, restart the computer when you get that request.
4. After the restart, wait a bit to see if you get any more requests for driver installations.
5. Connect your ICD2, and read the popups that you get to see if you get the right drivers.
Best regards,
Bill
I did not realize that you were running Vista, it might be different for Vista. I am runnng Windows XP, for that you install MPLAB IDE first, then you connect the ICD2, and installation completes by itself. With XP, you run into trouble if you plug in the ICD2 before you install MPLAB. They warn you about that.
I am not familiar with Vista, I am hoping that someone reading this can give you more help than I can. Otherwise, based on what you are telling me, I suggest the following:
Disconnect the ICD2. Check under the hardware manager and see if there is some unknown hardware that has failed installation. If so, delete it. Then plug the ICD2 back in, and see if you can find the drivers.
You might also browse the Microchip site, and see if there is any information about problems with MPLAB and Vista.
Best regards,
Bill
The first step says to plug in the ICD2 to the PC. This prompts the "Found new hardware" dialoge box to open. Then the instructions say to use this box to browse for the driver software in the Microchip folder.
How do you install the drivers without connecting the ICD2? Could this be a Vista issue?