Novice Programmer Questions

I dont want to litter the place with nonsense, but I'm trying to learn and have hit a brick wall.  I took Jean-Louis' tricopter code which runs on IMU V2 and tried many different ways to add IMU V3.  I assembled a PPM encoder, Cut up an old GWS Rx for the pins, made all the connections, modified the code the best I could and it almost works.  The almost part is driving me crazy. 

The problem is when the MPU6000_Init() is added, it stops communicating with the Rx and the ESC's.  If I take that out of the code, the ESC's arm and I have control of throttle and sticks.

I see that Ardupilot 2.7.1 has fast medium and slow loops.  The way this IMU/copter is written it has one loop running at 70 Hz. 

 

The first question seems to be how do I divide up the time?  Will that even solve the problem?

What are the principles behind that?  Do I just follow how Ardupilot did it and hope I get lucky?

 

 

  AutoStab_IMUV32-120728a.zip

 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I think I know what your problem is. The pins labeled MOSI, MISO, and SCK can not be used on the IMU3 as these are pins that the MPU6000 uses for SPI communication. They are only brought out on the board because they are needed to load the boot loader firmware. On the IMU 2 they might have been used for digital lines as no SPI was being used. You can use the analog pins for servo outputs if you generate the pulses with timer interrupts. You don't need to use the PWM modules. I have the IMU3 reading PPM or PWM and outputting PWM or PPM. I use this for a camera stabilizer and now a head tracker. You can download my gimbal stabilizer here. All of the servo stuff is driven from the one 16 bit timmer. Don't use the other 2, 8 bit timers or you will mess up the delay() function. I don't even use the millis() function, the main loop is interrupt driven. Just please put me in the credits if you use my code. BTW i was planning on doing just what you are attempting, ass soon as I finish hacking my transmitter to interface with the IMU3 head tracker.

This reply was deleted.

Activity

DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
yesterday
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Saturday
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Thursday
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9
DIY Robocars via Twitter
RT @JoeSpeeds: Sat Nov 6 Virtual DonkeyCar (and other cars, too) Race. So bring any car? @diyrobocars @IndyAChallenge https://t.co/nZQTff5…
Oct 31
DIY Robocars via Twitter
RT @JoeSpeeds: @chr1sa awesomely scary to see in person as our $1M robot almost clipped the walls as it spun at 140mph. But it was also awe…
Oct 29
DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
Oct 25
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Oct 23
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Oct 23
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Oct 23
DIY Robocars via Twitter
RT @DAVGtech: Another incident: https://t.co/G1pTxQug6B
Oct 23
More…