Quantcast
Channel: Forums - Recent Threads
Viewing all 262198 articles
Browse latest View live

Inquiry regarding output voltage on LM2902PWR

$
0
0

Hello, all

Now we have one inquiry regarding output voltage (VOL) on LM2902PWR from our customer.

When referring on datasheet, this parameter is defined as 5mV (TYP) and 20mV (MAX).

They would like to know how much sink current is corresponded on each case above.

We would appreciate If you could release graph which describes this characteristic.

We thank you in advance for your information.

Best regards,


PCM5102EVM-U Rev A

$
0
0

I am trying to get the PCM5102EVM-U to work but nothing I have done has got it do anything.  I have set the jumpers and switches to the following;

SW3: LLLL (All pointing left)

W1: I2C

W2: I2C

W3: All set

W4: set

W5: MCLK

Below is the script I am attempting, although I have tried all the examples as well and nothing happens:

# The following script is used for playback via USB

# RESET RESET THIS IS MASTER RESET FOR SRC (48kHz)

# Page 0 = DEFAULT for Control

# Write to page 0

#

w E0 7F 00

# Register 01, Bit 7 = 1 resets to default

d 100

w E0 01 80

# Delay 0.1 sec to allow part to reset

d 100

# Register 01, Bit 7 = 0 for normal operation

w E0 01 00

d 100

w E0 7F 00

# Register 01, Bit 7 = 1 resets to default

#----- Setup Port A ------#

# 24bit I2S, Master mode, DIR source, at mute

# Divide by 256, MCLK input source
# Unmute Port A Output



# power on port A and B
w E0 01 38
r E0 01 01


# set up port A as master, 24 bit I2S sourced from port B

w E0 03 19
r E0 03 01

# select MCLK as source at 256fs
w E0 04 01
r E0 04 01


# port B slave, 24 bit I2S
w E0 05 01
r E0 05 01

#----- Setup DIR ------#

#DIR Config 1

# Input source: RX2 - S/PDIF RCA (default)

#w E0 0D 01


# Input source: RX1 - S/PDIF optical, RX_MUX = RX1

w E0 0D 08
r E0 0D 01

#DIR Config 2 - default

w E0 0E 00
r E0 0E 01

#----- Setup DIT -----#

# DIT COnfig 1

# Port A data in, DIv 256

w E0 07 00
r E0 07 01

# DIT Config 2

# Default is to output to RCA

# Commment out RCA and uncomment Optical for optical outputs

#Output to RCA

# TX - ON, TX MUTE - ON, Optical disabled

w E0 08 06
r E0 08 01

# TX Mute - OFF

w E0 08 04
r E0 08 01

#Output to Optical

# TX - OFF, TX MUTE - ON, optical disabled

#w E0 08 03

# TX MUTE - OFF

#w E0 08 01

#----- PLL Configuration -----#

# Set P=1, J=8, D=7075

w E0 0F 12
r E0 0F 01

w E0 10 1B
r E0 10 01

w E0 11 A3
r E0 11 01

# GPIO1 Config

# GPIO1 = RCVR non-audio data

w E0 1B 06
r E0 1B 01

# GPIO2 Config

# GPIO2 = RCVR non-valid data

w E0 1C 07
r E0 1C 01

# Power Status

# Disable RCVR (/PDRX) and Port B(/PDPB) power down and enable All Function power down

#w E0 01 14

r E0 01 01

#w E0 03 29

There are no signals on TP27, TP28 or TP29.  Also when I try and read Register 01, all I get is 00 even after I've set it.

All I want to do is send audio in from either USB or Toslink out to the RCA ports.

Advice greatly appreciated,


Gavin

TPS7A8300 Vbias PSRR- PSNR ???

$
0
0

HI

Does TI have any numbers on the PSNR/PSRR  for the Vbias input ?

Other LDOs in the TI domain that use Vbias have Vbias PSRR graphs and numbers. On the chip block diagram, I see Vbias goes into a charge pump.  Presumably with say V bias at 5V and Vout at 1.2V, the charge pump does not have to do very much to get the volts it needs to turn the pass mosfet on hard. 

fantastic device.  just what we need to run a switcher  to feed the the LDO  with minimum of overhead.

Regards

glen english

BQ2476x Input Current Limit

$
0
0

Hello,


I am working towards a (non-host) smart battery with integrated charger, firstly using the bq20z65EVM and the BQ2476x EVM and have used SLUA533 as a guide.  I would like to use the Input Current limit feature provided by the charger, but want to avoid having to use a host.  I understand that the InputCurrentLimit register is volatile and defaults to 256mA when reset.  Is it possible to have the coulomb counter configure the charger using a broadcast, (like the charge current and voltage), or will I need to add a host?

Thank you,

Jeremy.

Protect customer developed miniDSP algorithms from piracy

$
0
0

Hi 

Is there a way to protect customer developed miniDSP algorithms from piracy? It seems by simply monitoring I2C writing to the miniDSP configuration, anyone could get the .cfg (miniDSP firmware).

Is it possible to pre-load the algorithms into miniDSP ROM, I understand there are processing blocks available but they are quite standard and not flexible to meet our need?

Thanks,

T I Codecs

$
0
0

Hi, Application is Digital Voice Communication Emergency Calling System. Which T I codecs are recommended for this application ?

Regards

Atul Bhakay

PMSM motor identification problem

$
0
0

Hi,

I'm working on a surface-mount PMSM.

manufacturer data reads:

Rs=40mOhm (L-L), Ls=65 uH (L-L), nominal voltage-28V, power-250W, Ke-0.0123, poles-4.

My user.h file is at the end of this post (pasted "as-is", sorry for all the unnecessary text...)

The motor is unloaded during the identification process.

Now, I'm trying to run through the identification, but getting some trouble figuring out what is happening:

1. Running through RoverL - this works and produces the best results - 0.019 Ohm,32uH.

2. going to Rs id - doesn't give good results - 0.032 Ohm.

3. going to ramp-up - sometimes it works and sometimes it doesn't - I tried playing with the USER_MOTOR_RES_EST_CURRENT and other variables, but I can't seem to understand, even after reading the UG, which parameters effect, and how, on this ramp-up (like to slope etc.). ok, let's assume it's working and it got to the desired frequency...(20Hz)

4. going to flux id - at some point, the frequency drops to about 7Hz (USER_MOTOR_FLUX_EST_FREQ_Hz=20) and it runs for more than a minute.. even though I set the timeouts as follows:

pUserParams->estWaitTime[EST_State_RampUp]          = (uint_least32_t)((1.5F * USER_MOTOR_FLUX_EST_FREQ_Hz / USER_MAX_ACCEL_EST_Hzps) * USER_EST_FREQ_Hz); // was 5.0 + USER_MOTOR_FLUX_EST_FREQ_Hz / USER_MAX_ACCEL_EST_Hzps
  pUserParams->estWaitTime[EST_State_IdRated]         = (uint_least32_t)(10.0 * USER_EST_FREQ_Hz);
  pUserParams->estWaitTime[EST_State_RatedFlux_OL]    = (uint_least32_t)( 0.2 * USER_EST_FREQ_Hz);
  pUserParams->estWaitTime[EST_State_RatedFlux]       = 0;
  pUserParams->estWaitTime[EST_State_RampDown]        = (uint_least32_t)( 2.0 * USER_EST_FREQ_Hz);

5. then, moving to Ls id, the frequency decreases more, and sometimes the rotor stops. I can hear the motor making sounds, so it probably lost synchronization. not sure why. Furthermore, the identified Ls is totally wrong (giving 5-10 times more than is expected).

can you please explain the behavior ?

one thing I thought about is that the control cannot reach the current values specified in user.h for Rs and Ls stages... If I could debug it somehow, to see the Id,Iq feedback :)

thanks a lot

#define USER_IQ_FULL_SCALE_FREQ_Hz        (800.0)   // 800 Example with buffer for 8-pole 6 KRPM motor to be run to 10 KRPM with field weakening; Hz =(RPM * Poles) / 120

//! \brief Defines full scale value for the IQ30 variable of Voltage inside the system
//! \brief All voltages are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST meet the following condition: USER_IQ_FULL_SCALE_VOLTAGE_V > 0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps,
//! \brief WARNING: otherwise the value can saturate and roll-over, causing an inaccurate value
//! \brief WARNING: this value is OFTEN greater than the maximum measured ADC value, especially with high Bemf motors operating at higher than rated speeds
//! \brief WARNING: if you know the value of your Bemf constant, and you know you are operating at a multiple speed due to field weakening, be sure to set this value higher than the expected Bemf voltage
//! \brief It is recommended to start with a value ~3x greater than the USER_ADC_FULL_SCALE_VOLTAGE_V and increase to 4-5x if scenarios where a Bemf calculation may exceed these limits
//! \brief This value is also used to calculate the minimum flux value: USER_IQ_FULL_SCALE_VOLTAGE_V/USER_EST_FREQ_Hz/0.7
#define USER_IQ_FULL_SCALE_VOLTAGE_V      (36.0)   // 24.0 Example for drv8301_revd typical usage and the Anaheim motor

//! \brief Defines the maximum voltage at the input to the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the voltage sensing and scaling to the ADC input
#define USER_ADC_FULL_SCALE_VOLTAGE_V       (66.32)      // 66.32 drv8301_revd voltage scaling

//! \brief Defines the voltage scale factor for the system
//! \brief Compile time calculation for scale factor (ratio) used throughout the system
#define USER_VOLTAGE_SF               ((float_t)((USER_ADC_FULL_SCALE_VOLTAGE_V)/(USER_IQ_FULL_SCALE_VOLTAGE_V)))

//! \brief Defines the full scale current for the IQ variables, A
//! \brief All currents are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST be larger than the maximum current readings that you are expecting from the motor or the reading will roll over to 0, creating a control issue
#define USER_IQ_FULL_SCALE_CURRENT_A          (10.0)   // 41.25 Example for drv8301_revd typical usage

//! \brief Defines the maximum current at the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the current sensing and scaling to the ADC input
#define USER_ADC_FULL_SCALE_CURRENT_A        (82.5)     // 82.5 drv8301_revd current scaling

//! \brief Defines the current scale factor for the system
//! \brief Compile time calculation for scale factor (ratio) used throughout the system
#define USER_CURRENT_SF               ((float_t)((USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A)))

//! \brief Defines the number of current sensors used
//! \brief Defined by the hardware capability present
//! \brief May be (2) or (3)
#define USER_NUM_CURRENT_SENSORS            (3)   // 3 Preferred setting for best performance across full speed range, allows for 100% duty cycle

//! \brief Defines the number of voltage (phase) sensors
//! \brief Must be (3)
#define USER_NUM_VOLTAGE_SENSORS            (3) // 3 Required

//! \brief ADC current offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
#define   I_A_offset    (4.157922864)
#define   I_B_offset    (4.096167088)
#define   I_C_offset    (4.125657082)

//! \brief ADC voltage offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
#define   V_A_offset    (0.3830444813)
#define   V_B_offset    (0.380874753)
#define   V_C_offset    (0.3834980726)


//! \brief CLOCKS & TIMERS
// **************************************************************************
//! \brief Defines the system clock frequency, MHz
#define USER_SYSTEM_FREQ_MHz             (90.0)

//! \brief Defines the Pulse Width Modulation (PWM) frequency, kHz
//! \brief PWM frequency can be set directly here up to 30 KHz safely (60 KHz MAX in some cases)
//! \brief For higher PWM frequencies (60 KHz+ typical for low inductance, high current ripple motors) it is recommended to use the ePWM hardware
//! \brief and adjustable ADC SOC to decimate the ADC conversion done interrupt to the control system, or to use the software Que example.
//! \brief Otherwise you risk missing interrupts and disrupting the timing of the control state machine
#define USER_PWM_FREQ_kHz                (60.0) //30.0 Example, 8.0 - 30.0 KHz typical; 45-80 KHz may be required for very low inductance, high speed motors

//! \brief Defines the maximum Voltage vector (Vs) magnitude allowed.  This value sets the maximum magnitude for the output of the
//! \brief Id and Iq PI current controllers.  The Id and Iq current controller outputs are Vd and Vq.
//! \brief The relationship between Vs, Vd, and Vq is:  Vs = sqrt(Vd^2 + Vq^2).  In this FOC controller, the
//! \brief Vd value is set equal to USER_MAX_VS_MAG*USER_VD_MAG_FACTOR.  Vq = sqrt(USER_MAX_VS_MAG^2 - Vd^2).
//! \brief Set USER_MAX_VS_MAG = 1.0 for a pure sinewave with a peak at SQRT(3)/2 = 86.6% duty cycle.  No current reconstruction is needed for this scenario.
//! \brief Set USER_MAX_VS_MAG = 2/SQRT(3) = 1.1547 for a pure sinewave with a peak at 100% duty cycle.  Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief Set USER_MAX_VS_MAG = 4/3 = 1.3333 to create a trapezoidal voltage waveform.  Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief For space vector over-modulation, see lab 10 for details on system requirements that will allow the SVM generator to go all the way to trapezoidal.
#define USER_MAX_VS_MAG_PU        (1.0)    // Set to 1.0 if a current reconstruction technique is not used.  Look at the module svgen_current in lab10a-x for more info.


//! \brief Defines the Pulse Width Modulation (PWM) period, usec
//! \brief Compile time calculation
#define USER_PWM_PERIOD_usec       (1000.0/USER_PWM_FREQ_kHz)

//! \brief Defines the Interrupt Service Routine (ISR) frequency, Hz
//!
#define USER_ISR_FREQ_Hz           ((float_t)USER_PWM_FREQ_kHz * 1000.0 / (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)

//! \brief Defines the Interrupt Service Routine (ISR) period, usec
//!
#define USER_ISR_PERIOD_usec       (USER_PWM_PERIOD_usec * (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)


//! \brief DECIMATION
// **************************************************************************
//! \brief Defines the number of pwm clock ticks per isr clock tick
//!        Note: Valid values are 1, 2 or 3 only
#define USER_NUM_PWM_TICKS_PER_ISR_TICK        (3)

//! \brief Defines the number of isr ticks (hardware) per controller clock tick (software)
//! \brief Controller clock tick (CTRL) is the main clock used for all timing in the software
//! \brief Typically the PWM Frequency triggers (can be decimated by the ePWM hardware for less overhead) an ADC SOC
//! \brief ADC SOC triggers an ADC Conversion Done
//! \brief ADC Conversion Done triggers ISR
//! \brief This relates the hardware ISR rate to the software controller rate
//! \brief Typcially want to consider some form of decimation (ePWM hardware, CURRENT or EST) over 16KHz ISR to insure interrupt completes and leaves time for background tasks
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK       (1)      // 2 Example, controller clock rate (CTRL) runs at PWM / 2; ex 30 KHz PWM, 15 KHz control

//! \brief Defines the number of controller clock ticks per current controller clock tick
//! \brief Relationship of controller clock rate to current controller (FOC) rate
#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK   (1)      // 1 Typical, Forward FOC current controller (Iq/Id/IPARK/SVPWM) runs at same rate as CTRL.

//! \brief Defines the number of controller clock ticks per estimator clock tick
//! \brief Relationship of controller clock rate to estimator (FAST) rate
//! \brief Depends on needed dynamic performance, FAST provides very good results as low as 1 KHz while more dynamic or high speed applications may require up to 15 KHz
#define USER_NUM_CTRL_TICKS_PER_EST_TICK       (1)      // 1 Typical, FAST estimator runs at same rate as CTRL;

//! \brief Defines the number of controller clock ticks per speed controller clock tick
//! \brief Relationship of controller clock rate to speed loop rate
#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK  (10)   // 15 Typical to match PWM, ex: 15KHz PWM, controller, and current loop, 1KHz speed loop

//! \brief Defines the number of controller clock ticks per trajectory clock tick
//! \brief Relationship of controller clock rate to trajectory loop rate
//! \brief Typically the same as the speed rate
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK   (10)   // 15 Typical to match PWM, ex: 10KHz controller & current loop, 1KHz speed loop, 1 KHz Trajectory

//! \brief Defines the controller frequency, Hz
//! \brief Compile time calculation
#define USER_CTRL_FREQ_Hz          (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK)

//! \brief Defines the estimator frequency, Hz
//! \brief Compile time calculation
#define USER_EST_FREQ_Hz           (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_EST_TICK)

//! \brief Defines the trajectory frequency, Hz
//! \brief Compile time calculation
#define USER_TRAJ_FREQ_Hz          (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK)

//! \brief Defines the controller execution period, usec
//! \brief Compile time calculation
#define USER_CTRL_PERIOD_usec      (USER_ISR_PERIOD_usec * USER_NUM_ISR_TICKS_PER_CTRL_TICK)

//! \brief Defines the controller execution period, sec
//! \brief Compile time calculation
#define USER_CTRL_PERIOD_sec       ((float_t)USER_CTRL_PERIOD_usec/(float_t)1000000.0)

// TIMEOUTS
#define USER_CTRL_OFFLINE_TIMEOUT        (1.0)
//! \brief LIMITS
// **************************************************************************
//! \brief Defines the maximum negative current to be applied in Id reference
//! \brief Used in field weakening only, this is a safety setting (e.g. to protect against demagnetization)
//! \brief User must also be aware that overall current magnitude [sqrt(Id^2 + Iq^2)] should be kept below any machine design specifications
#define USER_MAX_NEGATIVE_ID_REF_CURRENT_A     (-4.0)   // -2.0 Example, adjust to meet safety needs of your motor

//! \brief Defines the low speed limit for the flux integrator, pu
//! \brief This is the speed range (CW/CCW) at which the ForceAngle object is active, but only if Enabled
//! \brief Outside of this speed - or if Disabled - the ForcAngle will NEVER be active and the angle is provided by FAST only
#define USER_ZEROSPEEDLIMIT   (0.002)     // 0.002 pu, 1-5 Hz typical; Hz = USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz

//! \brief Defines the force angle frequency, Hz
//! \brief Frequency of stator vector rotation used by the ForceAngle object
//! \brief Can be positive or negative
#define USER_FORCE_ANGLE_FREQ_Hz            (1.0)      // 1.0 Typical force angle start-up speed

//! \brief Defines the maximum current slope for Id trajectory during EPL mode
//! \brief For Induction motors only, controls how fast Id input can change under EPL control
#define USER_MAX_CURRENT_SLOPE_EPL   (0.3*USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz)  // 0.3*RES_EST_CURRENT / IQ_FULL_SCALE_CURRENT / TRAJ_FREQ Typical to produce 1-sec rampup/down

//! \brief Defines the starting maximum acceleration AND deceleration for the speed profiles, Hz/s
//! \brief Updated in run-time through user functions
//! \brief Inverter, motor, inertia, and load will limit actual acceleration capability
#define USER_MAX_ACCEL_Hzps                 (20.0)      // 20.0 Default

//! \brief Defines maximum acceleration for the estimation speed profiles, rad/sec^2
//! \brief Only used during Motor ID (commission)
#define USER_MAX_ACCEL_EST_Hzps           (5.0)         // 5.0 Default, don't change

//! \brief Defines the maximum current slope for Id trajectory during estimation
#define USER_MAX_CURRENT_SLOPE           (USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz)      // USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz Default, don't change

//! \brief Defines the fraction of IdRated to use during rated flux estimation
//!
#define USER_IDRATED_FRACTION_FOR_RATED_FLUX (0.5)      // 0.5 Default, don't change

//! \brief Defines the fraction of IdRated to use during inductance estimation
//!
#define USER_IDRATED_FRACTION_FOR_L_IDENT    (0.5)      // 0.5 Default, don't change

//! \brief Defines the IdRated delta to use during estimation
//!
#define USER_IDRATED_DELTA                  (0.0001)   // 0.0001 Default, don't change

//! \brief Defines the fraction of SpeedMax to use during inductance estimation
//!
#define USER_SPEEDMAX_FRACTION_FOR_L_IDENT  (1.0)      // 1.0 Default, don't change

//! \brief Defines flux fraction to use during inductance identification
//!
#define USER_FLUX_FRACTION           (1.0)            // 1.0 Default, don't change

//! \brief Defines the EPL (Efficient Partial Load) gain for computing Id reference
//! \brief Induction motors only
#define USER_EPL_GAIN                   (1.0)         // 1.0 Default, don't change

//! \brief Defines the R/L estimation frequency, Hz
//! \brief User higher values for low inductance motors and lower values for higher inductance
//! \brief motors.  The values can range from 100 to 300 Hz.
#define USER_R_OVER_L_EST_FREQ_Hz (500)               // 300 Default


//! \brief POLES
// **************************************************************************
//! \brief Defines the analog voltage filter pole location, Hz
//! \brief Must match the hardware filter for Vph
#define USER_VOLTAGE_FILTER_POLE_Hz  (335.648)   // 335.648, value for drv8301_revd hardware

//! \brief Defines the analog voltage filter pole location, rad/s
//! \brief Compile time calculation from Hz to rad/s
#define USER_VOLTAGE_FILTER_POLE_rps  (2.0 * MATH_PI * USER_VOLTAGE_FILTER_POLE_Hz)

//! \brief Defines the software pole location for the voltage and current offset estimation, rad/s
//! \brief Should not be changed from default of (20.0)
#define USER_OFFSET_POLE_rps            (20.0)   // 20.0 Default, do not change

//! \brief Defines the software pole location for the flux estimation, rad/s
//! \brief Should not be changed from default of (100.0)
#define USER_FLUX_POLE_rps              (100.0)   // 100.0 Default, do not change

//! \brief Defines the software pole location for the direction filter, rad/s
#define USER_DIRECTION_POLE_rps             (6.0)   // 6.0 Default, do not change

//! \brief Defines the software pole location for the speed control filter, rad/s
#define USER_SPEED_POLE_rps           (100.0)   // 100.0 Default, do not change

//! \brief Defines the software pole location for the DC bus filter, rad/s
#define USER_DCBUS_POLE_rps           (100.0)   // 100.0 Default, do not change

//! \brief Defines the convergence factor for the estimator
//! \brief Do not change from default for FAST
#define   USER_EST_KAPPAQ               (1.5)   // 1.5 Default, do not change

// **************************************************************************
// end the defines


//! \brief USER MOTOR & ID SETTINGS
// **************************************************************************

//! \brief Define each motor with a unique name and ID number
// BLDC & SMPM motors
#define Estun_EMJ_04APB22           101
#define Anaheim_BLY172S             102
#define My_Motor                    104
#define hobby_3p5T                  105
#define hobby_4p5T                  106
#define small_hobby                 107
#define teknic_2310P                108
#define hobbywing_ezrun_8p5T        109
#define eflite_helicopter_420       110
#define Bodine_34B3FEBL             114
#define Pittman_elcom_5233B599      115
#define medical_instrument          117
#define MY_MOTOR                    113

// IPM motors
// If user provides separate Ls-d, Ls-q
// else treat as SPM with user or identified average Ls
#define Belt_Drive_Washer_IPM       201

// ACIM motors
#define Marathon_5K33GN2A           301

//! \brief Uncomment the motor which should be included at compile
//! \brief These motor ID settings and motor parameters are then available to be used by the control system
//! \brief Once your ideal settings and parameters are identified update the motor section here so it is available in the binary code
//#define USER_MOTOR Estun_EMJ_04APB22
#define USER_MOTOR MY_MOTOR
//#define USER_MOTOR hobby_3p5T
//#define USER_MOTOR hobby_4p5T
//#define USER_MOTOR My_Motor
//#define USER_MOTOR small_hobby
//#define USER_MOTOR Belt_Drive_Washer_IPM
//#define USER_MOTOR Marathon_5K33GN2A
//#define USER_MOTOR teknic_2310P
//#define USER_MOTOR hobbywing_ezrun_8p5T
//#define USER_MOTOR eflite_helicopter_420
//#define USER_MOTOR Bodine_34B3FEBL
//#define USER_MOTOR Pittman_elcom_5233B599
//#define USER_MOTOR medical_instrument

#if (USER_MOTOR == MY_MOTOR)                            // Name must match the motor #define
#define USER_MOTOR_TYPE                 MOTOR_Type_Pm    // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)
#define USER_MOTOR_NUM_POLE_PAIRS       (2)                        // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only
#define USER_MOTOR_Rr                   (NULL)                // Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Rs                   (0.01744834)                // Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Ls_d                 (0.002372358)            // For Induction, Identified average stator inductance  (Henry, float)
#define USER_MOTOR_Ls_q                 (0.002372358)            // For Induction, Identified average stator inductance  (Henry, float)
#define USER_MOTOR_RATED_FLUX           (0.02087141)        // sqrt(2/3)* Rated V (line-line) / Rated Freq (Hz)
#define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)                    // Identified magnetizing current for induction motors, else NULL
#define USER_MOTOR_RES_EST_CURRENT      (2.5)                    // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current
#define USER_MOTOR_IND_EST_CURRENT      (-1.5)                    // not used for induction
#define USER_MOTOR_MAX_CURRENT          (10.0)                    // CRITICAL: Used during ID and run-time, sets a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller
#define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

MSP430 - Bluetopia - how to send a string automatically?

$
0
0

Hi,
i am experimenting with the MSP430F5438A + PAN1326 + Android Phone + Bluetopia + SPPDemo

everything works fine so far with the debug-console and i already implemented some adoptions to the code:
i managed autopairing, store/read a link-key to flash memory and so on...

now i tried to run some commands automatically one after each other, but i cannot solve the problem:
i entered a new command "test" at the debug-console to open a new method:

void Test(){
ClientMode();
ReadKeyFromFlashToSystem();
OpenRemoteServer();
Write();
CloseRemoteServer();}

i hope it is clear what this program should do:
change to client mode, read the stored linkkeys, open the port to the server, write a string and finally close the server!

when i run those methods step by step at the debug-console everything works fine!!! no problems!
but when the comands shall be called automatically by my method it throws an error...

i think i already found out the problem with debugging:
it seems to me, that no event-callbacks occur between the commands!?
so it tries to write the string before the etPort_Open_Confirmation - Event is called.

i also tried to put delays between the commands, but this doesnt help!?
i also tried to put a while(connected!=true), but this loops forever, because the Event never comes...

so the question is, where shall i place the code, or how shall i call those methods that there is time in between for the events?!? interrupts? the scheduler?

thanks for your help!


Zombie connection status of BLE stack v1.4

$
0
0

This is repost of my another post (which I posted in the wrong section)

http://e2e.ti.com/support/low_power_rf/f/538/t/313674.aspx

I did some stress test to test the connection between iOS7 device and
our MSP430+CC2564 based BLE peripheral ( running Stonestreetone v1.4 stack).

The test App running on iOS7 simply repeats following activities continuously  in every 2 second interval:
*) Connect with BLE device
*) Discover service and characteristics, perform some GATT read/write
*) Disconnect

I have some interesting findings I would like to share with fellow engineers.


----------------------- iOS7 BLE --------------------------------------

On iOS7 side, after repeatedly connection and disconnection with BLE peripheral 
after 3~ 7 minutes, iOS7 would fail to discover GATT service after making a connection.

Packet sniffers shows that iOS7 is doing some weird thing after connection, 
it keeps sending LL_Version packet instead of discover ATT attributes.

----------------------- TI/SS1 BLE --------------------------------------

On Stonestreeone stack side, under stress test sometimes the stack would 
enter a zombie status, it thinks it's in connected status, but its peer 
(iOS7 device) has already disconnected from it, therefore, iOS7 would not 
be able to connect with the BLE device any more.

A normal sequence of events from Stonestreetone BLE stack should be

A) etLE_Connection_Complete 
B) etGATT_Connection_Device_Connection 
C) GATT Transcations
D) etGATT_Connection_Device_Disconnection 
E) etLE_Disconnection_Complete

In short, correct sequence of events should be: Idle -> A->B->C ->D->E -> Idle ->...


From UART log, I can observe that the zombie status happened due to incorrect event sequences.


Scenario 1)
Idle -> B --------> zombie
Somehow event B) triggers even before event A), it stays here forever although 
iOS7 did not connect successfully (normally sniffer shows the link layer error code 0x13 or 0x14), 
and could not connect anymore since "the line is busy" from BLE devcie perspective.


Scenario 2)
Idle -> B -> A -> B -------> zombie
Incorrect sequence of events, similar to scenario 1), not be able connect to it any more.

Scenario 3)
Idle -> B -> C -> Idle -> A ->B -> C -> D -> E -> Idle
Similar to Scenario 1), but it is followed by C, then back to Idle then have normal 
sequence of events, it fully recovered and can be connected to again.

Compiler Optimization

$
0
0

Hello, 

I'm running into an issue with the compiler optimization and looking for a few ideas/suggestions on how to avoid what is occurring if at all possible.

I have two functions. Func1 runs at a periodic rate, and Func2 is interrupt driven. Between the two of them, they share a global variable which is an index into global arrays of data for read/write access. Both variables are global in scope and NOT volatile. Below are some snippets to give you an general idea of what is going on. 

func1()
{
     .....
     ReadBuff_T = DataAccess_G;
     WriteBuff_T = ReadBuff_T ^ 1;
     DataAccess_G = WriteBuff_T;

     x = x[ReadBuff_T];
     y = y[ReadBuff_T];
     z = z[ReadBuff_T];
     .....
} 

func2()
{
     x[DataAccess_G] = x';
     y[DataAccess_G] = y';
     z[DataAccess_G] = z';
}


Just in case this isn't clear, _T = temp variable, _G = global variable

The issue I'm running into is that the compiler places the line "DataAccess_G = WriteBuff_T;" in Func1 towards the end of the function (after the data access of x,y, and z). Now in the scope of Func1, that isn't a problem since we do not use the global variable, but the temp variable. The problem is the func2 can interrupt Func1, and as a result, would be writing to the same buffer as Func1 is reading from giving me an inconsistent set of data. 

There are two solutions we thought of to counter-act this, but was looking for any more suggestions that the community may have. 

1) Drop the optimizations to 0 or off for this file only. From a quick test, this kept the source order as written, which eliminates the change of the interrupt from changing the buffer mid way through reading it. However, this adds a hit on memory and execution usage.

2) Make the index variable volatile. The only problem is the increased access time in the func2 by referencing the index each time. This interrupt is frequent so we try to keep this as quick as possible (besides just dropping C and going to assembly for this file). My thought around that would be to assign it to a temp variable, and then use the temp variable throughout func2 which would keep access time down since the variable isn't supposed to change during execution of func2.

However one question I have will the arrays need to be volatile as well? As they sit today, you would have to reference the memory location for based on the index, so in my mind it would be acting the same as if it was a single volatile variable, or am I in the weeds on that thought? 

Anyway, ideally I would like to avoid number 1. Besides the performance hit, we have validated the compiler using the current settings for ISO 26262 and I would like to not have to re-test it again if at all possible. But as stated earlier, I'm just looking to see other options that may be available to get around this issue. 

Thanks,
-Kevin

Output pin simple

$
0
0

Hello guys, okay?

I'm working with the Stellaris LM3S6965, and have a simple question, but not found the answer forum.

I want to use the F port pin 0 as output. I simply want to configure it as an output and put it on high level. I do this using the following code:

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
    
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_PIN_0);

When I check the output at the plate through the multimeter, it marks 2.87V and not 3.3V. I wonder if I will reach the value of 3.3V only with PWM0 configured or can I have this value only placing the F port pin 0 as output and setting its level to High.

Thank you.

MSP430F5529 REV I USB BSL not work

$
0
0

Hi,


I get an error if I try to download firmware to a 5529 REV I device over USB BSL. In Erratasheet "http://www.ti.com/lit/er/slaz314i/slaz314i.pdf" the rev i should not have this problem. For another test board with REV E everything work fine. The USB works fine. A solution is needed urgently!


Thanks a lot for any idea!

------------------------------------------------------------

Here the message from BSL_USB_GUI tool:

Starting
Password Sent Successfully
Sending RAM BSL v00.07.07.37
Done RAM BSL v00.07.07.37
Failed to read data from RAM BSL
Unsuccessful in starting the BSL. Restarting.
Password Sent Successfully
Sending RAM BSL v00.07.07.37
Done RAM BSL v00.07.07.37
Failed to read data from RAM BSL

KeyFobDemo Not Working

$
0
0

Hi, I have programmed the KeyFobDemo application using IAR onto my MSP-EXP430F5438 board which has the CC256XQFNEM evaluation module attached, but when I run the TI BLE Multitool I do not see the device under devices in the multitool. Am I missing something? Also, I see the MSP-EXP430F5438's LEDs alternate from red to yellow which would indicate an error occured...so, why won't I see the device under multitool?

Edit: It looks like the following code returns a Result of -4 which indicate the BT stack was not initialized:

/* Initialize the Stack */
Result = BSC_Initialize(HCI_DriverInformation, 0);

Not sure what's causing this. Does anybody have any ideas as to why this might happen?

TMS320F28069MPZT InstaSPIN custom drive bring up

$
0
0

I have been using the DVR8312EVM revD board to get a feel for InstaSpin and verify how ADC scaling should look on a functioning system.

I have adapted the motorware_1_01_00_11 software to run on my company's custom drive. This involved setting the low side gate signals using the dead time module, arranging the ADC inputs to our layout, and exercising some enable circuitry. Using proj_lab1.c I ran fixed PWM duty cycles to drive 1 and 2 amps of phase current through the Anaheim motor using both boards. This allowed me to verify that the scaling and bias values yielded current and voltage feedback of the same magnitude and sign on our board and on the DVR8312EVM hardware.

I can successfully run the motor identification routine on the DVR8312EVM hardware using proj_lab2b.c.

When I attempt to run the same motor identification routine on my drive, the Est_State goes directly from EST_State_Idle where the bias values are detected straight to EST_State_Rs. It skips the EST_State_RoverL state even though the Flag_MotorIdentified flag is not set and the corresponding wait time is set to 5s in user.c. In the EST_State_Rs state, the phase currents are not well regulated. I am using the default estimation currents for the Anaheim_BLY172S motor in user.h of 1.0A. The EST_State_Rs behavior I get is that it either folds my supply because it pulling 5A of phase current or regulates less than 0.1A of phase current.

The chip markings on the control card in the DVR8312EVM revD kit are:

TMS            980

F28069MPZT

CB-29ALJ7W

               G4

The chip on my custom drive that is not part of a control card has the following markings:

TMS320     980

F28069MPZT

CB-37A912W

               G4

I have included the user.h file for my custom drive below:

#ifndef _USER_H_
#define _USER_H_
/* --COPYRIGHT--,BSD
* Copyright (c) 2012, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/

//! \file solutions/instaspin_foc/boards/drv8312kit_revD/f28x/f2806xF/src/user.h
//! \brief Contains the public interface for user initialization data for the CTRL, DRV, and EST modules
//!
//! (C) Copyright 2012, Texas Instruments, Inc.


// **************************************************************************
// the includes

// modules
#include "sw/modules/types/src/types.h"
#include "sw/modules/motor/src/motor.h"
#include "sw/modules/est/src/32b/est.h"
#include "sw/modules/est/src/est_states.h"
#include "sw/modules/est/src/est_Flux_states.h"
#include "sw/modules/est/src/est_Ls_states.h"
#include "sw/modules/est/src/est_Rs_states.h"
#include "sw/modules/ctrl/src/32b/ctrl_obj.h"


// platforms
#include "sw/modules/fast/src/32b/userParams.h"

//!
//!
//! \defgroup USER USER
//!
//@{


#ifdef __cplusplus
extern "C" {
#endif

// **************************************************************************
// the defines


//! \brief CURRENTS AND VOLTAGES
// **************************************************************************
//! \brief Defines the full scale frequency for IQ variable, Hz
//! \brief All frequencies are converted into (pu) based on the ratio to this value
//! \brief this value MUST be larger than the maximum speed that you are expecting from the motor
#define USER_IQ_FULL_SCALE_FREQ_Hz (800.0) // 800 Example with buffer for 8-pole 6 KRPM motor to be run to 10 KRPM with field weakening; Hz =(RPM * Poles) / 120

//! \brief Defines full scale value for the IQ30 variable of Voltage inside the system
//! \brief All voltages are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST meet the following condition: USER_IQ_FULL_SCALE_VOLTAGE_V > 0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps,
//! \brief WARNING: otherwise the value can saturate and roll-over, causing an inaccurate value
//! \brief WARNING: this value is OFTEN greater than the maximum measured ADC value, especially with high Bemf motors operating at higher than rated speeds
//! \brief WARNING: if you know the value of your Bemf constant, and you know you are operating at a multiple speed due to field weakening, be sure to set this value higher than the expected Bemf voltage
//! \brief It is recommended to start with a value ~3x greater than the USER_ADC_FULL_SCALE_VOLTAGE_V and increase to 4-5x if scenarios where a Bemf calculation may exceed these limits
//! \brief This value is also used to calculate the minimum flux value: USER_IQ_FULL_SCALE_VOLTAGE_V/USER_EST_FREQ_Hz/0.7
#define USER_IQ_FULL_SCALE_VOLTAGE_V (79.40) // 24.0 Example for drv8312_revd typical usage and the Anaheim motor

//! \brief Defines the maximum voltage at the input to the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the voltage sensing and scaling to the ADC input
#define USER_ADC_FULL_SCALE_VOLTAGE_V (79.40) // 66.32 drv8312_revd voltage scaling

//! \brief Defines the voltage scale factor for the system
//! \brief Compile time calculation for scale factor (ratio) used throughout the system
#define USER_VOLTAGE_SF ((float_t)((USER_ADC_FULL_SCALE_VOLTAGE_V)/(USER_IQ_FULL_SCALE_VOLTAGE_V)))

//! \brief Defines the full scale current for the IQ variables, A
//! \brief All currents are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST be larger than the maximum current readings that you are expecting from the motor or the reading will roll over to 0, creating a control issue
#define USER_IQ_FULL_SCALE_CURRENT_A (20.0) // 10.0 Example for drv8312_revd typical usage

//! \brief Defines the maximum current at the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the current sensing and scaling to the ADC input
#define USER_CURRENT_SENSOR_VOLTS_PER_AMP (0.028*3.3/5.0)
#define USER_ADC_FULL_SCALE_CURRENT_A (3.3/USER_CURRENT_SENSOR_VOLTS_PER_AMP) // 17.30 drv8312_revd current scaling

//! \brief Defines the current scale factor for the system
//! \brief Compile time calculation for scale factor (ratio) used throughout the system
#define USER_CURRENT_SF ((float_t)((USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A)))
//#define USER_CURRENT_SF ((float_t)((-USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A)))

//! \brief Defines the number of current sensors used
//! \brief Defined by the hardware capability present
//! \brief May be (2) or (3)
#define USER_NUM_CURRENT_SENSORS (3) // 3 Preferred setting for best performance across full speed range, allows for 100% duty cycle

//! \brief Defines the number of voltage (phase) sensors
//! \brief Must be (3)
#define USER_NUM_VOLTAGE_SENSORS (3) // 3 Required

//! \brief ADC current offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
#define I_A_offset (4.506577373)
#define I_B_offset (4.451033115)
#define I_C_offset (4.516377687)

//! \brief ADC voltage offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
// 30V offset
#define V_A_offset (0.4645) //(0.3937675357)
#define V_B_offset (0.4625) //(0.3921670914)
#define V_C_offset (0.4645) //(0.3931038976)


//! \brief CLOCKS & TIMERS
// **************************************************************************
//! \brief Defines the system clock frequency, MHz
#define USER_SYSTEM_FREQ_MHz (90.0)

//! \brief Defines the Pulse Width Modulation (PWM) frequency, kHz
//! \brief PWM frequency can be set directly here up to 30 KHz safely (60 KHz MAX in some cases)
//! \brief For higher PWM frequencies (60 KHz+ typical for low inductance, high current ripple motors) it is recommended to use the ePWM hardware
//! \brief and adjustable ADC SOC to decimate the ADC conversion done interrupt to the control system, or to use the software Que example.
//! \brief Otherwise you risk missing interrupts and disrupting the timing of the control state machine
#define USER_PWM_FREQ_kHz (45.0) //(20) //30.0 Example, 8.0 - 30.0 KHz typical; 45-80 KHz may be required for very low inductance, high speed motors

//! \brief Defines the maximum Voltage vector (Vs) magnitude allowed. This value sets the maximum magnitude for the output of the
//! \brief Id and Iq PI current controllers. The Id and Iq current controller outputs are Vd and Vq.
//! \brief The relationship between Vs, Vd, and Vq is: Vs = sqrt(Vd^2 + Vq^2). In this FOC controller, the
//! \brief Vd value is set equal to USER_MAX_VS_MAG*USER_VD_MAG_FACTOR. Vq = sqrt(USER_MAX_VS_MAG^2 - Vd^2).
//! \brief Set USER_MAX_VS_MAG = 1.0 for a pure sinewave with a peak at SQRT(3)/2 = 86.6% duty cycle. No current reconstruction is needed for this scenario.
//! \brief Set USER_MAX_VS_MAG = 2/SQRT(3) = 1.1547 for a pure sinewave with a peak at 100% duty cycle. Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief Set USER_MAX_VS_MAG = 4/3 = 1.3333 to create a trapezoidal voltage waveform. Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief For space vector over-modulation, see lab 10 for details on system requirements that will allow the SVM generator to go all the way to trapezoidal.
#define USER_MAX_VS_MAG_PU (1.0) // Set to 1.0 if a current reconstruction technique is not used. Look at the module svgen_current in lab10a-x for more info.


//! \brief Defines the Pulse Width Modulation (PWM) period, usec
//! \brief Compile time calculation
#define USER_PWM_PERIOD_usec (1000.0/USER_PWM_FREQ_kHz)

//! \brief Defines the Pulse Width Modulation (PWM) dead time, usec
//!
#define USER_PWM_DEAD_TIME_usec (1.0)

//! \brief Defines the Interrupt Service Routine (ISR) frequency, Hz
//!
#define USER_ISR_FREQ_Hz ((float_t)USER_PWM_FREQ_kHz * 1000.0 / (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)

//! \brief Defines the Interrupt Service Routine (ISR) period, usec
//!
#define USER_ISR_PERIOD_usec (USER_PWM_PERIOD_usec * (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)


//! \brief DECIMATION
// **************************************************************************
//! \brief Defines the number of pwm clock ticks per isr clock tick
//! Note: Valid values are 1, 2 or 3 only
#define USER_NUM_PWM_TICKS_PER_ISR_TICK (3) //(1)

//! \brief Defines the number of isr ticks (hardware) per controller clock tick (software)
//! \brief Controller clock tick (CTRL) is the main clock used for all timing in the software
//! \brief Typically the PWM Frequency triggers (can be decimated by the ePWM hardware for less overhead) an ADC SOC
//! \brief ADC SOC triggers an ADC Conversion Done
//! \brief ADC Conversion Done triggers ISR
//! \brief This relates the hardware ISR rate to the software controller rate
//! \brief Typcially want to consider some form of decimation (ePWM hardware, CURRENT or EST) over 16KHz ISR to insure interrupt completes and leaves time for background tasks
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1) //(2) // 2 Example, controller clock rate (CTRL) runs at PWM / 2; ex 30 KHz PWM, 15 KHz control

//! \brief Defines the number of controller clock ticks per current controller clock tick
//! \brief Relationship of controller clock rate to current controller (FOC) rate
#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK (1) // 1 Typical, Forward FOC current controller (Iq/Id/IPARK/SVPWM) runs at same rate as CTRL.

//! \brief Defines the number of controller clock ticks per estimator clock tick
//! \brief Relationship of controller clock rate to estimator (FAST) rate
//! \brief Depends on needed dynamic performance, FAST provides very good results as low as 1 KHz while more dynamic or high speed applications may require up to 15 KHz
#define USER_NUM_CTRL_TICKS_PER_EST_TICK (1) // 1 Typical, FAST estimator runs at same rate as CTRL;

//! \brief Defines the number of controller clock ticks per speed controller clock tick
//! \brief Relationship of controller clock rate to speed loop rate
#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK (15) // 15 Typical to match PWM, ex: 15KHz PWM, controller, and current loop, 1KHz speed loop

//! \brief Defines the number of controller clock ticks per trajectory clock tick
//! \brief Relationship of controller clock rate to trajectory loop rate
//! \brief Typically the same as the speed rate
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (15) // 15 Typical to match PWM, ex: 10KHz controller & current loop, 1KHz speed loop, 1 KHz Trajectory

//! \brief Defines the controller frequency, Hz
//! \brief Compile time calculation
#define USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK)

//! \brief Defines the estimator frequency, Hz
//! \brief Compile time calculation
#define USER_EST_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_EST_TICK)

//! \brief Defines the trajectory frequency, Hz
//! \brief Compile time calculation
#define USER_TRAJ_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK)

//! \brief Defines the controller execution period, usec
//! \brief Compile time calculation
#define USER_CTRL_PERIOD_usec (USER_ISR_PERIOD_usec * USER_NUM_ISR_TICKS_PER_CTRL_TICK)

//! \brief Defines the controller execution period, sec
//! \brief Compile time calculation
#define USER_CTRL_PERIOD_sec ((float_t)USER_CTRL_PERIOD_usec/(float_t)1000000.0)


//! \brief LIMITS
// **************************************************************************
//! \brief Defines the maximum negative current to be applied in Id reference
//! \brief Used in field weakening only, this is a safety setting (e.g. to protect against demagnetization)
//! \brief User must also be aware that overall current magnitude [sqrt(Id^2 + Iq^2)] should be kept below any machine design specifications
#define USER_MAX_NEGATIVE_ID_REF_CURRENT_A (-2.0) // -2.0 Example, adjust to meet safety needs of your motor

//! \brief Defines the low speed limit for the flux integrator, pu
//! \brief This is the speed range (CW/CCW) at which the ForceAngle object is active, but only if Enabled
//! \brief Outside of this speed - or if Disabled - the ForcAngle will NEVER be active and the angle is provided by FAST only
#define USER_ZEROSPEEDLIMIT (0.002) // 0.002 pu, 1-5 Hz typical; Hz = USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz

//! \brief Defines the force angle frequency, Hz
//! \brief Frequency of stator vector rotation used by the ForceAngle object
//! \brief Can be positive or negative
#define USER_FORCE_ANGLE_FREQ_Hz (1.0) // 1.0 Typical force angle start-up speed

//! \brief Defines the maximum current slope for Id trajectory during EPL mode
//! \brief For Induction motors only, controls how fast Id input can change under EPL control
#define USER_MAX_CURRENT_SLOPE_EPL (0.3*USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) // 0.3*RES_EST_CURRENT / IQ_FULL_SCALE_CURRENT / TRAJ_FREQ Typical to produce 1-sec rampup/down

//! \brief Defines the starting maximum acceleration AND deceleration for the speed profiles, Hz/s
//! \brief Updated in run-time through user functions
//! \brief Inverter, motor, inertia, and load will limit actual acceleration capability
#define USER_MAX_ACCEL_Hzps (20.0) // 20.0 Default

//! \brief Defines maximum acceleration for the estimation speed profiles, rad/sec^2
//! \brief Only used during Motor ID (commission)
#define USER_MAX_ACCEL_EST_Hzps (5.0) // 5.0 Default, don't change

//! \brief Defines the maximum current slope for Id trajectory during estimation
#define USER_MAX_CURRENT_SLOPE (USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) // USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz Default, don't change

//! \brief Defines the fraction of IdRated to use during rated flux estimation
//!
#define USER_IDRATED_FRACTION_FOR_RATED_FLUX (0.5) // 0.5 Default, don't change

//! \brief Defines the fraction of IdRated to use during inductance estimation
//!
#define USER_IDRATED_FRACTION_FOR_L_IDENT (0.5) // 0.5 Default, don't change

//! \brief Defines the IdRated delta to use during estimation
//!
#define USER_IDRATED_DELTA (0.0001) // 0.0001 Default, don't change

//! \brief Defines the fraction of SpeedMax to use during inductance estimation
//!
#define USER_SPEEDMAX_FRACTION_FOR_L_IDENT (1.0) // 1.0 Default, don't change

//! \brief Defines flux fraction to use during inductance identification
//!
#define USER_FLUX_FRACTION (1.0) // 1.0 Default, don't change

//! \brief Defines the EPL (Efficient Partial Load) gain for computing Id reference
//! \brief Induction motors only
#define USER_EPL_GAIN (1.0) // 1.0 Default, don't change

//! \brief Defines the R/L estimation frequency, Hz
//! \brief User higher values for low inductance motors and lower values for higher inductance
//! \brief motors. The values can range from 100 to 300 Hz.
#define USER_R_OVER_L_EST_FREQ_Hz (300) // 300 Default


//! \brief POLES
// **************************************************************************
//! \brief Defines the analog voltage filter pole location, Hz
//! \brief Must match the hardware filter for Vph
#define USER_VOLTAGE_FILTER_POLE_Hz (723.79) // 723.79, value for MacroAir Alpha hardware

//! \brief Defines the analog voltage filter pole location, rad/s
//! \brief Compile time calculation from Hz to rad/s
#define USER_VOLTAGE_FILTER_POLE_rps (2.0 * MATH_PI * USER_VOLTAGE_FILTER_POLE_Hz)

//! \brief Defines the software pole location for the voltage and current offset estimation, rad/s
//! \brief Should not be changed from default of (20.0)
#define USER_OFFSET_POLE_rps (20.0) // 20.0 Default, do not change

//! \brief Defines the software pole location for the flux estimation, rad/s
//! \brief Should not be changed from default of (100.0)
#define USER_FLUX_POLE_rps (100.0) // 100.0 Default, do not change

//! \brief Defines the software pole location for the direction filter, rad/s
#define USER_DIRECTION_POLE_rps (6.0) // 6.0 Default, do not change

//! \brief Defines the software pole location for the speed control filter, rad/s
#define USER_SPEED_POLE_rps (100.0) // 100.0 Default, do not change

//! \brief Defines the software pole location for the DC bus filter, rad/s
#define USER_DCBUS_POLE_rps (100.0) // 100.0 Default, do not change

//! \brief Defines the convergence factor for the estimator
//! \brief Do not change from default for FAST
#define USER_EST_KAPPAQ (1.5) // 1.5 Default, do not change

// **************************************************************************
// end the defines


//! \brief USER MOTOR & ID SETTINGS
// **************************************************************************

//! \brief Define each motor with a unique name and ID number
// BLDC & SMPM motors
#define Estun_EMJ_04APB22 101
#define Anaheim_BLY172S 102
#define ETM_170_Nm 104
#define teknic_2310P 108

// IPM motors
// If user provides separate Ls-d, Ls-q
// else treat as SPM with user or identified average Ls
#define Belt_Drive_Washer_IPM 201

// ACIM motors
#define Marathon_5K33GN2A 301

//! \brief Uncomment the motor which should be included at compile
//! \brief These motor ID settings and motor parameters are then available to be used by the control system
//! \brief Once your ideal settings and parameters are identified update the motor section here so it is available in the binary code
//#define USER_MOTOR Estun_EMJ_04APB22
#define USER_MOTOR Anaheim_BLY172S
//#define USER_MOTOR ETM_170_Nm
//#define USER_MOTOR My_Motor
//#define USER_MOTOR Belt_Drive_Washer_IPM
//#define USER_MOTOR Marathon_5K33GN2A
//#define USER_MOTOR teknic_2310P


#if (USER_MOTOR == Estun_EMJ_04APB22) // Name must match the motor #define
#define USER_MOTOR_TYPE MOTOR_Type_Pm // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)
#define USER_MOTOR_NUM_POLE_PAIRS (4) // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only
#define USER_MOTOR_Rr (NULL) // Induction motors only, else NULL
#define USER_MOTOR_Rs (2.303403) // Identified phase to neutral resistance in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Ls_d (0.008464367) // For PM, Identified average stator inductance (Henry, float)
#define USER_MOTOR_Ls_q (0.008464367) // For PM, Identified average stator inductance (Henry, float)
#define USER_MOTOR_RATED_FLUX (0.38) // Identified TOTAL flux linkage between the rotor and the stator (V/Hz)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL) // Induction motors only, else NULL
#define USER_MOTOR_RES_EST_CURRENT (1.0) // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current
#define USER_MOTOR_IND_EST_CURRENT (-1.0) // During Motor ID, maximum current (negative Amperes, float) used for Ls estimation, use just enough to enable rotation
#define USER_MOTOR_MAX_CURRENT (3.82) // CRITICAL: Used during ID and run-time, sets a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller
#define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0) // During Motor ID, maximum commanded speed (Hz, float), ~10% rated

#elif (USER_MOTOR == Anaheim_BLY172S)
#define USER_MOTOR_TYPE MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS (4)
#define USER_MOTOR_Rr (NULL)
#define USER_MOTOR_Rs (0.4051206)
#define USER_MOTOR_Ls_d (0.0006398709)
#define USER_MOTOR_Ls_q (0.0006398709)
#define USER_MOTOR_RATED_FLUX (0.03416464)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
#define USER_MOTOR_RES_EST_CURRENT (1.0)
#define USER_MOTOR_IND_EST_CURRENT (-1.0)
#define USER_MOTOR_MAX_CURRENT (5.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)

#elif (USER_MOTOR == ELECTROCRAFT_)
#define USER_MOTOR_TYPE MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS (4)
#define USER_MOTOR_Rr (NULL)
#define USER_MOTOR_Rs (0.5746802)
#define USER_MOTOR_Ls_d (0.002537206)
#define USER_MOTOR_Ls_q (0.002537206)
#define USER_MOTOR_RATED_FLUX (0.1623715)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
#define USER_MOTOR_RES_EST_CURRENT (2.0)
#define USER_MOTOR_IND_EST_CURRENT (-2.0)
#define USER_MOTOR_MAX_CURRENT (5.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)

#elif (USER_MOTOR == ETM_170_Nm)
#define USER_MOTOR_TYPE MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS (4)
#define USER_MOTOR_Rr (NULL)
#define USER_MOTOR_Rs (NULL)//(0.08900000)
#define USER_MOTOR_Ls_d (NULL)//(0.00051000)
#define USER_MOTOR_Ls_q (NULL)//(0.00051000)
#define USER_MOTOR_RATED_FLUX (NULL)//(0.03955824)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
#define USER_MOTOR_RES_EST_CURRENT (2.0)
#define USER_MOTOR_IND_EST_CURRENT (-2.0)
#define USER_MOTOR_MAX_CURRENT (5.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)

#elif (USER_MOTOR == Belt_Drive_Washer_IPM)
#define USER_MOTOR_TYPE MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS (4)
#define USER_MOTOR_Rr (NULL)
#define USER_MOTOR_Rs (2.832002)
#define USER_MOTOR_Ls_d (0.0115)
#define USER_MOTOR_Ls_q (0.0135)
#define USER_MOTOR_RATED_FLUX (0.5022156)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
#define USER_MOTOR_RES_EST_CURRENT (1.0)
#define USER_MOTOR_IND_EST_CURRENT (-1.0)
#define USER_MOTOR_MAX_CURRENT (4.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)

#elif (USER_MOTOR == Marathon_5K33GN2A) // Name must match the motor #define
#define USER_MOTOR_TYPE MOTOR_Type_Induction // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)
#define USER_MOTOR_NUM_POLE_PAIRS (2) // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only
#define USER_MOTOR_Rr (5.508003) // Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Rs (10.71121) // Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Ls_d (0.05296588) // For Induction, Identified average stator inductance (Henry, float)
#define USER_MOTOR_Ls_q (0.05296588) // For Induction, Identified average stator inductance (Henry, float)
#define USER_MOTOR_RATED_FLUX (0.8165*220.0/60.0) // sqrt(2/3)* Rated V (line-line) / Rated Freq (Hz)
#define USER_MOTOR_MAGNETIZING_CURRENT (1.378) // Identified magnetizing current for induction motors, else NULL
#define USER_MOTOR_RES_EST_CURRENT (0.5) // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current
#define USER_MOTOR_IND_EST_CURRENT (NULL) // not used for induction
#define USER_MOTOR_MAX_CURRENT (2.0) // CRITICAL: Used during ID and run-time, sets a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller
#define USER_MOTOR_FLUX_EST_FREQ_Hz (5.0) // During Motor ID, maximum commanded speed (Hz, float). Should always use 5 Hz for Induction.


#else
#error No motor type specified
#endif

#ifndef USER_MOTOR
#error Motor is not defined in user.h
#endif

#ifndef USER_MOTOR_TYPE
#error The motor type is not defined in user.h
#endif

#ifndef USER_MOTOR_NUM_POLE_PAIRS
#error Number of motor pole pairs is not defined in user.h
#endif

#ifndef USER_MOTOR_Rr
#error The rotor resistance is not defined in user.h
#endif

#ifndef USER_MOTOR_Rs
#error The stator resistance is not defined in user.h
#endif

#ifndef USER_MOTOR_Ls_d
#error The direct stator inductance is not defined in user.h
#endif

#ifndef USER_MOTOR_Ls_q
#error The quadrature stator inductance is not defined in user.h
#endif

#ifndef USER_MOTOR_RATED_FLUX
#error The rated flux of motor is not defined in user.h
#endif

#ifndef USER_MOTOR_MAGNETIZING_CURRENT
#error The magnetizing current is not defined in user.h
#endif

#ifndef USER_MOTOR_RES_EST_CURRENT
#error The resistance estimation current is not defined in user.h
#endif

#ifndef USER_MOTOR_IND_EST_CURRENT
#error The inductance estimation current is not defined in user.h
#endif

#ifndef USER_MOTOR_MAX_CURRENT
#error The maximum current is not defined in user.h
#endif

#ifndef USER_MOTOR_FLUX_EST_FREQ_Hz
#error The flux estimation frequency is not defined in user.h
#endif


// **************************************************************************
// the functions


//! \brief Sets the user parameter values
//! \param[in] pUserParams The pointer to the user param structure
extern void USER_setParams(USER_Params *pUserParams);


#ifdef __cplusplus
}
#endif // extern "C"

//@} // ingroup
#endif // end of _USER_H_ definition

TMS            980

F28069MPZT

CB-29ALJ7W

               G4

PGA117 for volt and current measurement

$
0
0

i need help to calculate volt and current measurement with pga117 ic where i want to measure 0 to +/- 1000 volt dc in one input and other input i want to measure 0 to +/- 10 ampere dc using shunt resistor in application note i am not very clear that how to configure inputs for this requirement so plz help me


Real current feedback requirements - Hall sensors

$
0
0

Hello,

What are the InstaSPIN-FOC requirements on the current feedback sensors in case of the hall effect type?

I've read a lot about the ideal sampling windows for current sensing with shunt resistors, 2 or 3 shunts, op-amp slew rate for each case.. Could you please post some recommendations for the hall-effect sensors?

I already saw LEM manufacturer mentioned somewhere here, but I couldn't find any info on the actual bandwidth needed for the correct current sensing. Should the bandwidth match the PWM frequency? Is op-amp like AD8226 with a slew rate around 0.4 V/us fast enough? Since those sensors does not have an infinite bandwidth, would you recommend a filter to remove high frequency (noisy environment, long cables..)?

Thank you.

DMD

$
0
0
Helloeveryone.
I wonderifthere isalistof modelsofDLP projectorsthat usetheDMD's1076-6039,8060-6318.Amongothers.


Thanks

TM4C129x EMAC problems

$
0
0

I'm having problems getting the EMAC Ethernet peripheral to work. I'm using a DK-TM4C129X board with unqualified XM4Cxxx part on it. I'm using the internal PHY.

I think I found an error in the Data Sheet and I have made some progress.

It appears that the following statement on page 1608 of "Tiva TM4C129XNCZAD Microcontroller Data Sheet" is not true.

Quote from Data Sheet:

TBS1: Transmit Buffer 1 Size
These bits indicate the First Data Buffer byte size. If this field is 0, the DMA ignores this buffer and uses Buffer
2 or next descriptor depending on the value of TCH (Bit 24).

End Quote.

I cannot make that work at all. I just get FBI errors (fatal bus error) and AE field is 3 (Error during TX DMA Read Data access). This is when I make buffer 1 size 0 to try to use only 2nd buffer. I suspect the same is true of RX descriptors.

I tried using just buffer 1 with buffer 2 size 0. I also tried using chained TX descriptors. In both cases I don't get FBI errors any more. The transmit DMA seems to be working - sort of. It activates interrupts at completion and moves the hw TX DMA descriptor pointer as expected. There appears to be no output from the PHY so I cannot see any packets on the wire. I have not tested if the TX DMA engine wraps at the end of the TX descriptor list.

The TCP/IP stack that I use breaks a transmit packet up into 2 or 3 or more non-contiguous buffers. The first buffer has 14 bytes in it (size of ethernet header, I think). The remaining buffer(s) have the rest of the packet. I create TX descriptors to match these buffers.

The receiver DMA can receive packets okay. It signals interrupts on completion and I can retrieve the packets and I can give ownership of descriptor back to DMA. But it has a major problem. It will not wrap back to the base of the RX descriptor ring. I have tried using chained descriptors and using the RER bit in the final descriptor (and also tried with both together) but it just won't wrap back even when it owns the descriptors at the start of the ring. To debug, I read EMAC_HOSRXDESC register and it shows that the DMA did not wrap to RX descriptor base.

When the RX DMA reaches the end of the descriptor list, it is still running and continues to give interrupts that say RX overflow every time a packet is received. Of course it doesn't actually receive the packet because it does not have a place for it because it did not wrap back to the start of the descriptors.

I'm using my own routines to manage the EMAC and the GCC tool-chain for building. I'm using only "normal" DMA descriptors and both descriptors and buffers are in SRAM. Both RX and TX buffers in the descriptors (only using buffer 1 in each descriptor) is 128 bytes in size.

I notice that all the examples use the enhanced/extended DMA descriptors instead of the normal descriptors. I don't know if that is the cause of my problems. I notice also that the FS, LS, and other DMA control bits move around in the descriptors based on using normal or extended descriptors. That seems odd to me.

Thanks for any help you can provide.

TSW1400EVM (Rev D) JESD204B connector

$
0
0

Hi,

I notice on both schematics and board photo that the TSW1400EVM (Rev D) has a JESD connector (at J2).  Are there high speed DAC evaluation boards that interface directly to that port?  Alternatively, is there an adapter to interface that port with, say, a DAC3XJ8XEVM board?

Thanks very much,

Stephen Ryan

C6678 Core file analysis

$
0
0

Hi,

I need some help and guidance on DSP core file analysis on Shannon platform (C6678 platform). My problem is I do get these DSP core dump that are generated because the DSP crashes, however I do not have any mechanism to know where and at what point the DSP crashed. 

Since the DSP has 8 cores would it be possible to know at what point the DSP was on each of these cores when the DSP hit an exception or encountered a segmentation fault. Knowing this would help in debugging the issue faster.

I would assume that there would be some capability with CCS where in one could open the core file with the C6678 executable (.out) to know the exact cause of crash and do a back trace (like in gdb).

I would really appreciate if one could share more information on the exact procedure of doing this.

Regards,

Nikhil

Viewing all 262198 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>