TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
All posts discussing pricing or where to buy TurboCAD will be deleted.

Controlling speed
Read 457 times
* November 09, 2017, 05:05:52 PM
Background 1st: just doing some research for an idea!
Can you control and objects speed of rotation by any other method?

Im not working in tcw at this moment or looking at the anilab editor now either!
eg:  if I want to control the speed of rotation of say a ball then I think its relative to the number of frames ( start & stop ).

Therefore take an example like a cars tachometer, put ya foot down on the accelerator pedal and the tacho revs increase, likewise if ya back off the revs drop. Can anilab simulate the same action as the tacho needle changing by using any of the preset commands to control speed of rotation?

Thanks

Daz

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 10, 2017, 03:46:12 AM
#1
Can anilab simulate the same action as the tacho needle changing by using any of the preset commands to control speed of rotation?

There is no pre-set 'command' for acceleration/deceleration, however using keyframes, under keyframe properties there is a 'law of changing' one can set each keyframe to accelerate of decelerate, so with just 2 keyframe (3 if one includes the start one) on can simulate a needle going up and down.

Using commands it will be necessary to write a little custom script to handle the calculation, which ideally should result in a curve not straight lines, I guess a sine curve would be best but I'm not good at that type of maths (other on the forum are a lot better with that stuff).

The attached is a bit rough but shows one way of producing it using keyframes and one way for commands using custom script, - the script really needs someone with better mathematical knowledge to come up with the correct calculation.   File save way back to v20 so should open ok in any recent version.
« Last Edit: November 10, 2017, 03:51:05 AM by Andy H »

Logged


* November 10, 2017, 02:35:24 PM
#2
Andy H your bloody marvelous thats almost what Im looking at doing and youve done it for me, wow.

Okay now that Ive got the render done http://forums.turbocad.com/index.php/topic,21879.0.html the next step is to animate the key parts for training and that should be straight forward. As I said in the 1st post was to control the speed of rotation based on a control mechanism.

So what Ive gotta do now is:
1. Rotate shaft with all connected parts - simple
2. When rotating 1 above show how the weights move against spring tension, mechanical advance principles
3. Show the balls rotating within the bearing itself
4. Show the points opening and closing against the points cam ( camshaft )
5. Show the vacuum advance diaphram moving to demonstrate the vacuum advance principles
6. Show a spark when the rotor button aligns to each postion in the cap
7. Show the contact points spring ( not clearly visible in the gallery post ) moving   

For all those points 1 -7 hence I need speed control in anilab. From how I see it its not necessary to show infinitely switchable speed of rotation but just enough for video and animation demos.

Thanks

Daz

 

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 10, 2017, 06:32:28 PM
#3
Andy are -accel & -decel variable names inside the sdk? just wondered where they came from.

Daz

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 11, 2017, 02:06:27 AM
#4
Re - accel / decel, 

No, they are just names I gave to variable so I wouldn't forget which variable needed to go against the commands,  the name 'factor' I just used as its a constant figure, and 'tmp' was going to be a temporary variable but ended up storing a figure ready for the next frame' calculation.

To check things I just typed the calculations into an excel sheet and just played around with altering 'factor' and 'tmp start' figures until I got the accel total around 128 degrees.

But like I said the calculation is a bit rough as the' decel' doesn't return the pointer to where it started from, needs playing around with a bit more.

Logged


November 11, 2017, 03:04:10 AM
#5
Daz,

    if I may, just add a little to what Andy has said.

    The variable names are not inside the SDK, as such.
    They are created prior to running the code, Sub {a code routine} StepCustomAction, by use of the Dim statement.
    This Dim statement creates a slot in memory to store the changing variable values, before doing anything else.
    This is common to most BASIC programming languages/scripts.

    It's a whole new world!

Regards Tim
« Last Edit: November 11, 2017, 03:10:08 AM by Tim Stewart »

Logged
You can design without engineering, but you cannot engineer without design.
Using Win 10 with Designer 2017 and TurboCAD Pro. Plat. 2016 - 64-bit versions.


* November 11, 2017, 01:42:55 PM
#6
Hey Tim, I didnt know that you could declare/use a variable within the editor param-3 value, that really threw me out the window. Hence the question, I too did a lot of programming 25-30 years ago and it looks like I will have get back into the saddle to understand more about the sdk within anilab.

Thanks

Daz

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 11, 2017, 01:47:45 PM
#7
Just wondering if from yours or Andy point of view can the animation be done with little or no prgramming for the items 1 - 7 in a prev post on this topic with the exception of speed control?

Will start the animation in approx 2 days as Ive gotta get other ignition parts designed and completed 1st, as they compliment the complete package for the trainees.

Daz

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 11, 2017, 04:22:16 PM
#8
Just wondering if from yours or Andy point of view can the animation be done with little or no prgramming

There are a few ways to accomplish it and no doubt Tim will likely come up with different solutions, so I'll just jot down a few ways how I would tackle it - you shouldn't need to do any custom coding.

1. Rotate shaft with all connected parts - simple
group all part which are to move as a connected unit,  using nested groups when necessary which allows child objects to animate independently whilst still being controlled by the parent,  if you haven't looked at nested groups before see - running man thread.
   
2. When rotating 1 above show how the weights move against spring tension, mechanical advance principles
see below regarding springs

3. Show the balls rotating within the bearing itself
rotate command on all balls, then group all the balls, ensure reference point to centre of group, rotate command on group
 
4. Show the points opening and closing against the points cam ( camshaft )
rotate command (ref point moved to point of rotation) or use keyframes

5. Show the vacuum advance diaphragm moving to demonstrate the vacuum advance principles
revolve with compound profile, either morphing command  or node editing via keyframes, Note - morphing is buggy in RedSDK 2017 for me (ok in 2016), no idea about Lightworks.
 
6. Show a spark when the rotor button aligns to each position in the cap
I'd use layer switching for the spark.

7. Show the contact points spring ( not clearly visible in the gallery post ) moving  
Springs,   there are a number of ways depending on how involved or realistic one wants to get.
stretching and contracting will give some distortion, but in many cases this will not be noticeable in the finished movie, avoid using the scale command with RedSDK - its buggy.   
or,  using sweep with compound profile, the spline (exploding from a helix) can be altered and recorded using keyframes, the sweep will alter between 2 keyframes, (again buggy in RedSDK 2017), 
or,  sweep, then cut a full length slot out of the back where it cannot be see, explode into separate solids and use keyframes to record minimum spring and maximum spring - keyframes editor will work out the rest. works well with RedSDK.
or, if there was no intermediate movement needed one could just used 2 layer switching.


Logged


* November 11, 2017, 11:48:17 PM
#9
Hi Andy

Thanks for the feedback, I hope I didnt get you to write that all up just for me. Point is I obviously wasnt clear in that I just wanted to know if you thought that it was reasonable to animate those aspects with little or no code. Anyway that done check this out.

Ive completed the camshaft rather than it being driven by the oil pump ( its from a Mitsubishi ), spark plug is done and ignition coil also. I will include these in the render from the gallery soon.

So I did some basic animation and found buggy things happening, crashed once so bad that I had to turn the power of to the pc, could run taskmanger by ctrl-alt-del-keys.

Check the difference between Anibug1.png - Anibug2.png images, on the Acis Solid I set the rotate angleZ to -.5, Id then run the animation and could work out why the points opened and closed in the wrong direction. Thats when I found that the values in the AngleZ column had jumped to the AngleY column ( Param-2 ) go figure. Thats when it crashed and that was no fun as I had to re do it all.

So after changing things around and checking my I got it right. This is the basis for the complete animation, just that I have to work out the timings for frames to 360 degree rotation and open and close the points at precise times. So far ive just gone the long route as youll see. see Ani Test Points1.png - Ani Test Points2.png

Thanks to Tim and yourself so much for your help!

Daz


Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 12, 2017, 01:03:43 AM
#10
Looking good Darryl,    regarding the first two pics, I don't know if that's how you actually had them or but try to ensure the parameters for a particular command have something in them, even if its a nought, leaving a parameter blank can upset AL  (usually throwing up a error message). 

Logged


November 12, 2017, 02:35:10 AM
#11
Daz,

    Andy's suggestions are more than thorough.
    Personally, I would tend towards using the Key Frames Editor more.
    The vacuum advance might be worth showing in a simplified slow-mo animation, if the intention is towards education.
    The wire-frame animation looks very promising.
    It might not matter that much, but, does the heel of the moving arm visibly follow the surface of the cam, when rendered?

Regards Tim

Logged
You can design without engineering, but you cannot engineer without design.
Using Win 10 with Designer 2017 and TurboCAD Pro. Plat. 2016 - 64-bit versions.


* November 13, 2017, 01:18:49 AM
#12
Hey Tim your right on the mark, Andy is a wealth of knowledge on animation aspects!

Yes I agree on using keyframes more, its just thats the way I initially did it for quick and dirty starting point. The 1st problem I encountered was anilab by default starts with 17 frames ( easily changed though ), so I started to divide 17 keyframes by 360 ( as one whole revolution ) then realised that was just too many frames. Then decided that 36 frames was sufficient and just animate at selected intervals as per the prev posts eg: 4-5, 5-6, 6-7 & 7-8 represent 44 - 46 degrees and so on would open and close the points at suitable intervals.

Vacuum advance: most likely show by a separate animation, why because it may confuse the trainees. Point here is that its a primary function just like the mechanical advance, for clarity I will probable show this as a 2nd animation with a clear description.

Yes the heel of the points does follow the PointsCam ( thats my reference name in tcw.

see http://forums.turbocad.com/index.php/topic,21879.0.html for updated pics

I should have the final done by tomorrow hopefully.

Thank you Tim & Andy
 
Daz


Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 14, 2017, 06:25:01 PM
#13
Got the animation working ok but its small, as soon as I get the render right then I will post the results, in the meantime here a sample.

Anilab sometimes show the scenario window and other times it doesnt, just wondering why?


Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 14, 2017, 11:31:31 PM
#14
So Ive got the animation done nearly, but I need to get the flash animation from the old FilmProjector.tcw file.

By the way there are differences between the:
FilmProjector.tcw
FilmProjector-Ani.tcw
which took me some to understand & resolve, mostly differences with lighting as its an older version from 2012.

Ive attached just the bare bones from the distributor to this post so that I can debug and understand why Im not getting the results I need. Simply the anilab light switching for the Lamp does not switch on or off, why?

All source lights just copied from the filmprojector.tcw file. Just noticed then in the testani No2.gif that the points dont appear to be opening either, must add that I did discover that when I pasted into anilab scenario editor it did modify my target scenario frames data as well. This occurred when I had to files open  ( tiled windows ) FilmProjector.tcw and TestAni No.tcw. What Im saying is that when I copied from source to destination inside anilab the destination frames data was modifeid as well.

I was copying a light object, this does appear to be a bug.

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 16, 2017, 02:24:22 PM
#15
Can anyone confirm and or test why my previous posts TestAni No2.gif file does not do the lightswitching with the Lamp object?

Please download the Testani.tcw file

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 16, 2017, 03:49:07 PM
#16
Daz,   wasn't sure if you had posted the correct file,  I opened it in v2017 and it didn't have a light actor to turn on/off,  nor a LightSwitch command.

One needs to create a light (or use an existing one),  make it an actor, select it and use the  LightSwitch command (which only appears once a light has been made an actor) to control it, with 1 being on and 0 being off. 

 

Logged


* November 16, 2017, 03:57:48 PM
#17
Andy I will retest the suspect file and re-post in 10 minutes.

Thanks for your quick reply.

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 16, 2017, 04:15:21 PM
#18
Andy something got mixed up, try this file.

Why doesnt the lamp work?  this was just a quick hack to find out whats not working.


Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 16, 2017, 05:07:17 PM
#19
Not sure what to say as it worked for me,  but -

Maybe the light is sometimes getting confuse,  you have
2 999 lightswitch 1
3 999 lightswitch 0

I know its how the projectior had it, but what I'd expect to happen is 
frame 2 light turns on,  frame 3 light turns on then turns off, frame 4 light turns on / off then on,  frame 5 on/off/on/off, etc.  one wouldn't see this extra switching as its all done internally, but is probably adding unnecessary internal switching, and also the animation will run for 1000 frames,

Another oddity is that the light actor is being called a lamp, I've no idea why that is,   maybe something to do with older versions, normally its just called a light actor unless the name is change using propertied - general attribute .

Personally I'd suggest deleting the light,  making a new light, and create it as an actor, the use something like
2 2 LightSwitch 1
4 4 LightSwitch 0
6 6 LightSwitch 1
etc.  as a test, then adjust the frame numbers to suit your animation.

#Edited## edited frame numbers in the last bit as there is no need to switch the light on in both frames 2 and 3 etc. ##End Edit##



« Last Edit: November 16, 2017, 11:08:11 PM by Andy H »

Logged


* November 16, 2017, 11:11:03 PM
#20
Got it mostly solved, now the points open close and it now produces a spark as well. The main problem was that I used the same naming convention from the Filmprojector file and that caused a conflict with anilab v5. Further the light souce used in the Filmprojector also caused problems with ani lab also as they were set to directional, but when I changed them to spot bingo it worked. So now I will add the spark plus x 4 and the coil. With the coil I can now add a simulation of the magnetic current buildup prior the the points flash.

Oh and thanks to Andy H he is supreme, can I buy yo a beer? ;D   Happy boy.

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


November 17, 2017, 02:20:57 AM
#21
Daz,

I think it's you, that deserves a beer, for persevering with this.
It's looking very good.
Yes, a real beer, one that's not out of a can! :)
I can't comment on the file, as I'm stuck with TC 2016.  :(

As a matter of interest - I'm sure you are aware of this - in the real world, sparking across the points was best kept to a minimum.
Are you going to render in full-size AVI mode, when finished?

Regards Tim

Logged
You can design without engineering, but you cannot engineer without design.
Using Win 10 with Designer 2017 and TurboCAD Pro. Plat. 2016 - 64-bit versions.


* November 17, 2017, 03:49:56 PM
#22
Darryl,   Totally agree with Tim,  its looking really good,  looking forward to seeing the rest of it.

Logged


* November 17, 2017, 04:05:18 PM
#23
Thankyou and then some to you both Andy & Tim. I appreciated your comments here on this topic.

Tim Im now working on the finer points of the design like:
1. rotating bearing is done, just that it shows so little because its chrome!
2. working with 3D mesh to simulate the vac advance, do you know if tcw can create a round mesh and then use the morphing example from the ani lab samples to simulate this?
3. mechanical advance simulation was easy, but its problematic trying to achieve in the complete model. will most likely split the animation into two parts ( one for the distributor, other for vac and mechanical advance ). Tim I may convent to 2016 for your input here and 2017 for Andy to look into options if that ok. Tim pm me with your email address if that suits. Just finalising the plug leads design and then I will put it all together. If either of you manage to come downunder then ya got a free bed and beer!


Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


November 18, 2017, 05:22:56 AM
#24
Daz,

    email connection is via my Avatar, or direct: [email protected].
    Either way, is fine by me.  :)

Regards Tim

Logged
You can design without engineering, but you cannot engineer without design.
Using Win 10 with Designer 2017 and TurboCAD Pro. Plat. 2016 - 64-bit versions.


* November 18, 2017, 02:32:26 PM
#25
Hey Tim I need to clearly document how the ignition systems works ( points based with other parts ) and Im wondering if yourself or others have either the time or experience ( auto mechanic, simple electronics) to check my work prior to posting?

This should be no more than a page or two at the most.

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


* November 19, 2017, 01:50:23 AM
#26
Just checked the anilab tutorial again and it says that the key frames editor can be used to control speed of rotation plus others. Therefore can this be used to vary the animation speed by a bezier curve?

If so the I can simulate vac advance and show the weights simulation also

Logged
Thanks Daz ( Darryl )
Using TCW 2015, 2016 & 2017 Platinum, Animation Lab V5, Graficalc & Windows 10 using Lightworks mostly

Good better best
Never let it rest
Until your good is better
And your better is best


November 19, 2017, 02:29:55 AM
#27
Hey Tim I need to clearly document how the ignition systems works ( points based with other parts ) and Im wondering if yourself or others have either the time or experience ( auto mechanic, simple electronics) to check my work prior to posting?

This should be no more than a page or two at the most.

Hi Daz,

    pleased to help.  Send it along . .

Regards Tim

Logged
You can design without engineering, but you cannot engineer without design.
Using Win 10 with Designer 2017 and TurboCAD Pro. Plat. 2016 - 64-bit versions.