The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Assignment after coordinate transformation
https://designers-guide.org/forum/YaBB.pl?num=1302506599

Message started by Richardsim on Apr 11th, 2011, 12:23am

Title: Assignment after coordinate transformation
Post by Richardsim on Apr 11th, 2011, 12:23am

Part of a model I've implemented is shown below:

module Modulename (ttranstip, tphitip);
   inout [0:1] ttranstip;
   inout tphitip;
   kinematic [0:1] ttranstip;
   kinematic gnd;
   rotational tphitip, rotgnd;
   ground gnd, rotgnd;

parameter real alpha = 0;

parameter real k1=2;
parameter real k2=1;
parameter real k3=1;
parameter real k4=2;
parameter real k5=1;

// temp values
 
   real  gl11, gl12, gl21, gl22, Fxtip, Fytip, Mtip, xtip, ytip, phitip, T, Iz, ke,
   kb, A, kFxd_xwumind, kFxd_xwdminu, Lb, Tautemp, xglobal, yglobal;

//alpha,k1, k2, k3, k4
   
analog begin

gl11 = cos(alpha);
gl12 = -sin(alpha);
gl21 = sin(alpha);
gl22 = cos(alpha);

xtip = k1*Fxtip + k2*Fytip;
ytip = k3*Fxtip + k4*Fytip;

Tautemp = Tau(tphitip,rotgnd);
Theta(tphitip) <+ k5*Tautemp;

Pos(ttranstip[0]) <+ gl11*xtip + gl12*ytip;
Pos(ttranstip[1]) <+ gl21*xtip + gl22*ytip;

F(ttranstip[0],gnd) <+ gl11*Fxtip + gl12*Fytip;
F(ttranstip[1],gnd) <+ gl21*Fxtip + gl22*Fytip;

end

endmodule



This compiles succesfully. However, in simulation errors occur. Intuitively, only the Theta(tphitip) <+ assignment is a neat link between through and across variables at the terminals (no coordinate transformation for the angular coordinate). Apart from rewriting the set of equation to obtain a direct expression between through and across variables, can I adjust the code above to get it to work?

Title: Re: Assignment after coordinate transformation
Post by Geoffrey_Coram on Apr 11th, 2011, 6:30am

Did you intentionally leave out the assignments to Fxtip and Fytip?

Why do you have "gnd" only in
F(ttranstip[0],gnd) <+
and not in
Pos(ttranstip[0])
?

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.