1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Animated Interactive demo of PSD

Discussion in 'Gen 2 Prius Technical Discussion' started by Ichabod, Aug 29, 2006.

  1. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    In terms of the direction of these parts spinning, the negative number is correct. The nomograph will verify that, as will the diagram. Try to visualize the ring and the sun spinning in the same direction without moving the planets and you'll strip your gears. You can see them spinning in the same direction by positioning both sliders at the same level. So it's sort of a question of semantics, but that would be fixed by indicating on the diagram which direction charges and which draws current from the battery.

    I do want to also incorporate a feature that will tell us whether MG1 is charging the battery or drawing power. One thing I don't know about that part is if MG1 can be allowed to spin freely in either direction without drawing a current... I'm also not sure if the directions of MG1 are tied to charge/discharge, or if it can do both in either direction. More homework!
     
  2. jkusnetz

    jkusnetz New Member

    Joined:
    Jan 16, 2006
    55
    0
    0
    <div class='quotetop'>QUOTE(Ichabod @ Aug 30 2006, 10:45 AM) [snapback]311570[/snapback]</div>
    Very cool stuff. It got me thinking about my project Mac Prius

    I'm reading in data from the CAN-view to drive a touch screen interface on my mac. I've been thinking about taking the other data coming from the CAN-view and making some sort of interface displaying that. Not being a graphics programmer I never really did much with it.

    But your flash program gives me some really cool ideas. What if we could have your flash driven by real time data coming from the CAN-view instead of the sliders? I've found some perl modules that let perl talk to flash programs. With those I could have my perl program that controls Front Row also talk to your flash program and display things real time. Cool huh?

    The cool thing about flash and perl is that it can run on any platform, mac, windows, linux so it may open up this project to be something much more then a mac project.

    That said, I've never done flash programming. I guess I would need to purchase macromedia. Can you give me pointers on where to start with flash? Any chance you would be willing to share your code with me so that I could start playing around with that interface?
     
  3. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    I'd happily share my code. Open Source rules apply ;)

    The flash app could certainly be made to read real-time input. An even simpler way to do it (i.e. dumber but not necessarily better) is if your CAN-view can spit out a text file with current numbers, the flash app can read directly from that.

    I'd LOVE to have a screen just like my demo installed in my car that showed me current RPMs and the nomograph. It would only be slightly more informative than the energy monitor, but it would make stealthing, dead-banding, and warp-stealthing easier.

    Here's where I reveal my art-nerd secret: I'd also just love to have the picture of the PSD spinning in relation to the real one, and I created this demo initially just because I love the the elegant simplicity of the PSD. I had no plan to understand its inner workings so well, but understanding its function just makes the form more appealing to me!


    As for starting with flash, the way I started was by getting flash and going through the built-in demos. Since then I've had a lot of jobs that required some level of flash animation and increasing levels of coding. I promise my clients just a little more than I know how to accomplish, and then I figure it out along the way :D www.moock.org and www.flashkit.com have been great reasources.
     
  4. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    I just saw this Java demo that I hadn't seen before in another thread:

    http://www.wind.sannet.ne.jp/m_matsu/prius...e=en?Country=US

    Pretty nice, but their "international" feature doesn't seem to work, although I'm not too sad about that since I'm not in UK or Japan. They provide the source, so I'll give that a look. I'm still happy to share my source with anyone who's curious, but I'm not going to link to it on my page until I have a stable, final-ish version.

    So my plan for future development is to make my demo into something more like John's word doc. I'd like to have buttons that demo what's happening during important phases of operation rather than the gas and break pedal slider as in the linked simulator.

    If anyone has suggestions, for features, I'd gladly entertain more. Keep in mind that I still want this to be a very basic, fairly non-technical intro to the PSD so that Prius drivers can understand just a little better how their car works.
     
  5. hobbit

    hobbit Senior Member

    Joined:
    Mar 23, 2005
    4,089
    468
    0
    Location:
    Bahstahn
    Vehicle:
    2004 Prius
    Model:
    N/A
    It would be really nice if there was a standalone flash player,
    rather than having to load a plugin into a browser and then have
    it put you at risk as you surf everything *else*. That way the
    SWF could simply be downloaded and played atomically, leaving the
    browser entirely out of the picture except maybe to do the download.
    .
    _H*
     
  6. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    Good idea. I'll make one as soon as I have the afore-mentioned stable, final-ish version ;) (or on request, if you're DYING to see it but really REALLY don't want flash in your browser)

    I'll most likely only be able to maintain a windoze-based projector file though :(
     
  7. jkusnetz

    jkusnetz New Member

    Joined:
    Jan 16, 2006
    55
    0
    0
    <div class='quotetop'>QUOTE(jkusnetz @ Aug 30 2006, 12:47 PM) [snapback]311640[/snapback]</div>
    Well thanks to a lot of help from Ichabod with the flash, I've finally cobbled together his flash with my perl reading the CAN-view and came up with this:

    Live PSD!

    Warning, it's blury and bouncy and you can't see the details but it will give you an idea where we are heading!
     
  8. efusco

    efusco Moderator Emeritus
    Staff Member

    Joined:
    Nov 26, 2003
    19,891
    1,191
    9
    Location:
    Nixa, MO
    Vehicle:
    2004 Prius
    Model:
    N/A
    <div class='quotetop'>QUOTE(jkusnetz @ Sep 8 2006, 09:35 PM) [snapback]316774[/snapback]</div>
    Ok, it is blurry, bouncy and little...but pretty dang cool! Does the PSD diagram look like it's moving so slowly b/c of the camera film rate or is it really turning that slowly?

    Can't wait to see details posted about how you did this.
     
  9. jkusnetz

    jkusnetz New Member

    Joined:
    Jan 16, 2006
    55
    0
    0
    <div class='quotetop'>QUOTE(efusco @ Sep 8 2006, 10:40 PM) [snapback]316779[/snapback]</div>
    It's really hard to see the gears spinning in place in the movie. Plus the flash is 1/400 true speed.
     
  10. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    The gear rotation speed can also be set to any arbirtrary scale, so if it actually is spinning too slowly the scale can be improved for quality/clarity.

    I also think I should make a specific color scheme for in-car use since this looks like it might be kinda bright and annoying for night driving :) I have to say, it's exciting to see that in action though!
     
  11. narussian

    narussian New Member

    Joined:
    Jun 26, 2006
    111
    0
    0
    <div class='quotetop'>QUOTE(Ichabod @ Aug 29 2006, 10:06 AM) [snapback]311106[/snapback]</div>

    Wow, that's amazing!! THANKS!!
     
  12. NuShrike

    NuShrike Active Member

    Joined:
    Feb 21, 2005
    1,378
    7
    0
    Vehicle:
    2005 Prius
    Model:
    Five
    The limits you have for the PSD in the text discussion in the middle seems to be different from what I understand should be for a Gen2 Prius. ICE should be limited for 0 - 5000 rpm, MG1 is between -10000 and 10000 rpm.

    Also, you need to put in some wait/sleep statements into the ActiveScript/code because your is Flash animation is taking 70-80% of available cpu (in Firefox) while it's just sitting there. If anything, limit yourself to 60fps or something sane. I don't get the same bogdown with the Java simulator.

    Also, at a certain point, the gear teeth for MG1, while in reverse, look like they stop spinning. It might be just the strobe effect.
     
  13. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    Thanks for the feedback NuShrike. There are still some bugs, and I'm working on getting better numbers for the 2nd Gen Prius. I've seen it quoted both ways, and I'm not 100% sure. Anyone who can offer a concrete answer, please do ;)

    The framerate is 24, but it does eat up processor power. There are a couple tricks I can do to make it run less intensively, but I'm waiting to have stable code that doesn't make the gears stop or slip.

    There's more to come, but in the meanwhile, my suggestion is to not run it for long periods of time, or while your computer is busy with other things :)
     
  14. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    Oh, and yes, strobe effect is an issue as well, which is why I added deatil on the gears themselves, so if the teeth are strobing and looking like they move backwards or not moving at all, you can still see the direction of rotation. I may add arrow overlays to show the rotation even more clearly.

    That effect is especially noticeable when MG1 is at roughly 14k rpm in either direction... but since that's outside even the 10k possible limit, I don' mind that it looks wrong at that speed.
     
  15. jkusnetz

    jkusnetz New Member

    Joined:
    Jan 16, 2006
    55
    0
    0
    <div class='quotetop'>QUOTE(efusco @ Sep 8 2006, 10:40 PM) [snapback]316779[/snapback]</div>
    No new movies or pictures, but I posted my new perl code, and a ActionScript (Flash programing language) snippet for talking to the perl code on my Prius Page for anyone who is interested.
     
  16. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    I posted the ActionScript source for my demo for those interested. It's linked at the bottom of the demo page at:

    http://eahart.com/prius/psd

    A significant amount of the code is now devoted to making it work for Mac Prius, so it's not all releveant to the demo page, but it's still somewhat easy to see where the functional parts are.

    I also addressed the performance issue noted by NuShrike, so it should run a bit less intensively.
     
  17. SoopahMan

    SoopahMan Member

    Joined:
    Sep 17, 2006
    118
    2
    0
    Hi Ichabod, thanks for posting this demo. It's really fantastic for understanding this deceptively simple gear system.

    One thing I'd like to see is a slider you can adjust for MG1, the sun gear. The current demo leads to the impression that if the ICE and MG2 are pushing, MG1 must be revolving in the opposite direction.

    It took me a long time to realize that in order to start the ICE, MG1 and MG2 must revolve in the same direction, or at least not in opposite directions.

    One thing you might consider is adding that 3rd slider, and a little lock on each the user can turn off or on. In the initial state at 0mph MG2 and ICE should be locked and MG1 unlocked.

    For example, if I dragged the MG2 slider up in your demo now, MG1 would go down and ICE would do nothing - which is exactly what should happen. It's as if those 2 locks are on right now.

    To demonstrate ICE starting at that point, I could unlock ICE, then drag MG1 upwards. What will happen is ICE is forced upwards, which is exactly how ICE is started as you accelerate above 25mph.

    I could then lock MG2 and ICE, unlock MG1, and drag ICE upwards. That causes MG1 to shoot up higher. This demonstrates ~30mph where the ICE is being run artificially fast, in its optimal range, and MG1 is generating electricity. Note that electric motors can generate electricity running in either direction: it's a matter of whether it's pushing, resisting (generating), or spinning freely that matters, not the direction itself. The lock helps convey which of those it's doing.

    Finally, to show accelleration to highway speeds I could lock ICE and MG1, and unlock MG2, then slowly drag MG1 downwards. This is the "eCVT" action of the transmission - MG1 is now using electricity to rotate more and more in the negative, and this causes the ICE to have to work harder to keep spinning at its constant rate (that's not entirely obvious from this diagram... but that's the infinitely variable gear ratio right there, how fast MG1 spins in the opposite direction of ICE).

    It might also be informative to see the forgotten gears get a single bar that should never be user-controllable: the 4 planets on the ICE ring. That 1 bar would have the same positive/negative 6500rpm range as the electric motors, but no lock control.

    Alternatively to locks you could just have a 4th bar that varies speed, and vary all the other 3 bars for the user (none of them user controllable), with the above actions taking place as you drag the bar upwards. That would certainly be more code to write though.
     
  18. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    Thanks for the great suggestions Soopah. I'm actually planning a slightly different kind of development for this project that will hopefully address some of your ideas.

    Since I still want to keep this as simple as possible for people who are just trying to begin to understand the PSD, I'm going to add some demo buttons that do exactly the type of things you describe, but in an animated "demo" moe that will simply demonstrate what happens when you accelerate, glide, stealth, etc.

    Also, with the help of Mac Prius, the demos might be able to use data that was captured in real-time from a Prius.

    Regarding the planet gears, they don't connect to anything directly, so their rotation speed is basically insignificant. Their speed can also go much higher than the RPM scale I have in place now too, and I don't think it's worth changing the scale of the whole diagram to show the movement of a part that doesn't contribute to the system. Think of those as ball-bearings. They can spin all day long, but what matters is the speed of what they're connected to.
     
  19. SoopahMan

    SoopahMan Member

    Joined:
    Sep 17, 2006
    118
    2
    0
    Hi Ichabod - awesome! A Demo would be perfect - I was just worried about how much coding you'd have to do to put it together.

    The inputs from a Demo perspective could be an Accelerator slider and Brake slider you increase or decrease "pressure" on.

    You might consider increasing the available RPMs on the motors to reflect the new 2004-2007 Prius by the way - it looks like the gas can do 7000rpm and the electrics 10000rpm. But I bet the brilliant minds here can get you more exact numbers, I've heard a few variations on those.

    The only reason I'd be interested to see the planetary gears is out of curiosity in which way they're going - for example, when all 3 motors are spinning in a positive direction at different speeds, what the planetaries are doing isn't trivial. But if you can see them spinning in the diagram that covers it, I'd say.

    Thanks for the great demo, Ichabod, it really is excellent.
     
  20. Ichabod

    Ichabod Artist In Residence

    Joined:
    Jul 21, 2006
    1,794
    19
    0
    Location:
    Newton, MA
    Vehicle:
    2006 Prius
    Just the direction of the planet gears is easy to know. If MG2 is spinning faster than MG1, then the planet gears are rotating in a positive direction (clockwise on my demo). If MG1 is faster, planet rotation is negative.