EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Hardcoded scale factor on pmac
From: Wayne Lewis via Tech-talk <[email protected]>
To: George Nicolas Kontogiorgos <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 30 Jul 2019 10:03:34 -0700
Hi George,

The scale factor is there to allow for the fact that the .RRBV field of
the motor record is an integer. This lets you work in floating point
engineering units in the PMAC, and scales the coordinate system axis
position value before sending it to the coordinate system axis motor
record.

You can control this scale factor value using the
pmacSetCoordStepsPerUnit IOC shell command if you want something other
than the default value. See below for an example.

<st.cmd>
...
epicsEnvSet("PPMAC_IP", "192.168.0.201")
epicsEnvSet("PPMAC_SSH_PORT", "PPMAC_SSH")
epicsEnvSet("PPMAC_PORT", "PPMAC1")
epicsEnvSet("PPMAC_CS2_PORT", "CS2")
...

# Attach to the SSH port
#drvAsynPowerPMACPortConfigure(port_name, host_address, username,
password, priority, noAutoConnect, noProcessEos)
drvAsynPowerPMACPortConfigure("$(PPMAC_SSH_PORT)", "$(PPMAC_IP)",
"root", "deltatau", 0, 0, 0)

# Configure Model 3 controller driver
# powerPmacCreateController(controller_port, low_level_port, address,
axes, moving_poll, idle_poll)
pmacCreateController("$(PPMAC_PORT)", "$(PPMAC_SSH_PORT)", 0 , 32, 100,
200)
...
# Set up for running coordinate system
#pmacCreateCS(coordinate_system_port, controller_port_name,
coordinate_system_number, motion_program_number)
pmacCreateCS("$(PPMAC_CS2_PORT)", "$(PPMAC_PORT)", 2, 2)
# Create the coordinate system axes
#pmacCreateCSAxes(coordinate_system_port, num_coordinate_system_axes)
pmacCreateCSAxes("$(PPMAC_CS2_PORT)", 9)

# Define coordinate step resolution
#pmacSetCoordStepsPerUnit(coordinate_system_port, cs_axis,
counts_per_egu)
pmacSetCoordStepsPerUnit("$(PPMAC_CS2_PORT)", 8, 1000000)
...
</st.cmd>

Finally, you should set the MRES value in the relevant motor record to
1/scale_factor to show the position in the motor record in the same
units as the PMAC coordinate system.

Hope that helps.

Wayne


On Tue, Jul 30, 2019 at 12:51:10PM +0000, George Nicolas Kontogiorgos via Tech-talk wrote:
> Dear Giles,
> 
> Hope this e-mail finds you well.
> 
> I am working on a custom tripod system with its own kinematics. The hardware I am using is Power PMAC, as before with slits (Those e-mails about DMOV bug).
> 
> I had a problem in this project with scale factors. I am giving you my configuration to illustrate the problem:
> 
> 
>   *   Q89 = -24383899 (read on Power PMAC IDE)
>   *   MRES = 1 (This value was set to this in order to debug my problems)
>   *   SREV = 1
> 
> With this values I got 2147483648 with caget on my configured virtual motor. When I set MRES = 50e-6 mm/step (My encoder resolution) I got the correct value with caget instead of a factor 1e+4. So I started to search where is this factor and I found scale_=10000; on pmacCSAxis.cpp, line 24. Just for test, I changed this value to 1 and my caget get the correct answer.
> 
> Am I setting something wrong or there is a bug on this hardcoded scale_? Why there is a hardcoded scale factor? Note that  2147483648 is the saturated negative value for 2 complement with 32 bits because my Q89*1e4 is too big.
> 
> Best regards
> George Nicolas Kontogiorgos
> Electrical Engineer
> Beamline Software Group (SOL)
> Brazilian Synchrotron Light Laboratory (LNLS)
> www.lnls.cnpem.br<http://www.lnls.cnpem.br/>
> 
> 
> Aviso Legal: Esta mensagem e seus anexos podem conter informa??es confidenciais e/ou de uso restrito. Observe atentamente seu conte?do e considere eventual consulta ao remetente antes de copi?-la, divulg?-la ou distribu?-la. Se voc? recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.
> 
> Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.

-- 
  Wayne Lewis
  e: [email protected]
  w: https://ospreydcs.com
  p: +1 631 905 1964

References:
Hardcoded scale factor on pmac George Nicolas Kontogiorgos via Tech-talk

Navigate by Date:
Prev: Hardcoded scale factor on pmac George Nicolas Kontogiorgos via Tech-talk
Next: Request for information Sinclair, John William via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Hardcoded scale factor on pmac George Nicolas Kontogiorgos via Tech-talk
Next: Request for information Sinclair, John William via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024