Developer

ArduPilotMega Hardware in the Loop block for Scicoslab



This ardupilotmega hardware in the loop block for scicoslab marks the completion of an open source, completely free autopilot design and testing tool chain. The jsbsimcomm block communicates with the ardupilotmega hil block to simulate an actual flight. Servos move in response to the autopilot and may also be manually controlled with the radio receiver. This isn't polished yet, but it's working and I'll be cleaning it up this week. I've used the boost asio library for serial communication so the scicoslab blocks should also compile on windows if your lucky. Will probably take some work if anyone wants to volunteer. :-). Source code is on http://hsl.dynalias.com/git/?p=JSBSim;a=summary
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • How to calculate a cotfficient (smooth and other)?
    Where from they will dependent?
    Should it be a static or variable?
    And how this 'low pass filter' implement to APM code?
  • Hey James really nice job. Can you give me more information about the trim solutions of a JSBSim model.
    I think that you need the dynamic model for the Rascal if you want to find the trim solution isn't?
    Also...
    Can I use also Matlab instead of Scicoslab?
  • Developer
    I think they both employ a successive loop closure PID controller. So they should be virtually the same. But with real hardware you have to worry about noise in the derivative channels. APM should probably implement a low pass filter in the derivative channel of the PID. It is easy enough to do yourself though. deriv = deriv0 * smooth + deriv * (1-smooth), see http://en.wikipedia.org/wiki/Low-pass_filter
  • Hi James,
    I need your advise as an expert.
    What do you suggest if compare a APM and Autopilot implemented in FG. How match autopilot implemented by FG more quality vs APM?
  • Developer
    Thanks! Yeah, I'm wrapping up an Ms. in aerospace engineering at Purdue.
  • Nice job James.

    Still at Uni?
  • Developer
    The main advantage of using scicoslab is that it is built for control design. If I want to see the effect of adding a wash out filter to the runner channel I can add it in the diagram without having to recompile the autopilot code. Also I have built in functions for determining the trim of an airframe using JSBSim dynamics and a nelder mead simplex algorithm for minimizing the derivatives of the trim state. Once you have a trim condition you know where the airplane likes to fly naturally, and if you lucky enough most states will be stable about it. So you just have to add some compensators (i.e. PID's) to stabilize the system. I have also written code to linearize the system about the trim state, so you can then use root locus and bode plot methods for control design. The backside controller block I have written follows the same control structure as the ardupilotmega so it can be used as a software emulation of the autopilot for initial control gain design. Since the JSBSimComm block calculates the derivatives fo the airframe using the nonlinear equaitons of motion and scicoslab manages the integration, you can set integration tolerances to choose your desired level of simulation accuracy at the price of slower speed. You are correct to point out that it is not necessary to use flightgear with the JSBSimComm block. If you are just interested in step response plots etc there is no need to communicate with FlightGear. However, I feel it is easier to visualize the system behaviour in FlightGear than looking at plots.
  • Another question.
    Is it possible to implement a JSBSim inside Ardumega and use it not like simulation but like another kind of AP autopilot engine?
  • Hi James,
    tell me please, what benefit will I get if I'll use yours simulating instead Flight Gear for example?
    As I see your and FG solutions use one phisic engine.
    1. Is it more convinient?
    2. Has it more accuracy?
    3.??
This reply was deleted.