Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

AMC, H-Bridge projects etc.
Please use the image gallery for your pictures, a short tutorial can be found here.
The first image in the first post will be shown in the project gallery.

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby prilad » Thu 18. Oct 2012, 08:33

speedy wrote:Hi Prilade: The Nuclear digital mind
;) :lol: :lol:

speedy wrote:Final question is the start question ... so we can come to some conclusion ... and EOD "end of discussion".


Ooo. This is a VERY SIMPLE QUESTION.
The practice is the best verification of theory (c)

I hope I will make FW with both types of PWM and we will compare its and will found (or not) difference at practice...

Regards for all,
Ale
Last edited by prilad on Thu 18. Oct 2012, 10:46, edited 1 time in total.
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby speedy » Thu 18. Oct 2012, 09:22

Hi Prilad:

Ok ...I'll wait your move ...

BTW ... I've finished the opt-coupler problem it's working now ... the actuators now working with the Live For Speed game ...
they are installed and adjusted on the tower computer ... I'll post a screen capture for the xSimCTRL SW from this computer later ... or maybe try to install the capture SW on that computer just for you my friend ... wait for my video .

regards
spe ;) edy
User avatar
speedy
 
Posts: 148
Images: 4
Joined: Thu 19. Apr 2012, 06:46
Location: Alexandria, Egypt
Has thanked: 14 times
Been thanked: 2 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby speedy » Fri 19. Oct 2012, 22:08

Hi Prilad:
Excuse me my friend ... I was using a 270 degree Feedback pot with a reduction plastic gear 3:1 on it's axle ...
But it seems that they are very poor quality that they are broken before starting :cry: ... lucky again ... I decided to use a good 10turn pots ...
I know I should give another test before asking ... but I have already a broken upper limit switch [ don't worry It's my mistake that it didn't work first place ] ...
I really need little advice here before buying another switch and testing manually again ...

If I have a 10turns feedback pot centered and is directly connected to the output gearbox axle ... that takes only 3 turns to give me the linear movement distance required ... [50cm in 3 seconds] that is 6.6"/sec speed from upper limit switch to the lower one ... also centered ... and as per described in your first page for the feed back pot parameters ...

prilad wrote:3. Parameters of feedback sensors (potentiometers)

This firmware implements the following algorithm for processing feedback signals received from the potentiometers.
For each axis of the introduction of two thresholds - SensLo and SensHi. If the sensor readings will be less than the value SensLo (or, respectively, greater than SensHi), the engine stops. And will only move in the opposite direction. Thus, the user can limit the working area of the sensor. In this case the remainder of the range of values between SensLo SensHi and converted into a scale of 0 .. 255.

With the help of the coefficients and SensLo SensHi can also of invert value of the sensor. It's enough to set the value SensLo MORE than SensHi
By default, the firmware, the following values of the coefficients for the two axes:

SensLo = 45
SensHi = 210

These settings allow for potentiometers with an angle of 270 ° to keep the working area of 180 °. In this work area is located in the center of the potentiometer.

If you want to "flip" the sensor, set it SensLo = 210, SensHi = 45

These policy guides are designed to prevent mechanical damage to the sensor in the "flight" through the axis of the extreme positions.



You gave this example based on a 270 degree pot. ... adjustments also are made by degrees ... [lower limit 45 + working aria 180 + 45 upper limit = 270 degree ] ... 45+180=210 +45=270 degree ...

If I'm using a 10turns pot that uses 3 turns only as working area due to the above described mechanical adjustments ... when scaling down each Full turn to see how much degrees it will take from a virtual 270 pot ...that would give 1turn = 27 degree ... If I'm using 3 turns then the working aria will be = 81 degree ... the reminding values are 270 - 81 = 189 degree divided by two = 49.5 upper and lower limits to center the working area between them ... that would give the SensLo = 49.5 and SensHi =49.5+81=175.5
and a 0-255 command positions will be scaled to the 81 degree that are actually 3 turns out of the 10 turns pot ...

Is this actually practical in the xSimCTRL program ... or should I use the ADC pot on the AMC board to reduce the 10 turns into 7 or 5 turns first then calculate the degrees again ?

regards
User avatar
speedy
 
Posts: 148
Images: 4
Joined: Thu 19. Apr 2012, 06:46
Location: Alexandria, Egypt
Has thanked: 14 times
Been thanked: 2 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby prilad » Sat 20. Oct 2012, 08:36

Hi Speedy !

speedy wrote:You gave this example based on a 270 degree pot. ... adjustments also are made by degrees ... [lower limit 45 + working aria 180 + 45 upper limit = 270 degree ] ... 45+180=210 +45=270 degree ...


No, my friend, it is not so. Firmware does not know anything about pots degrees. Only voltage on ADC and AREF inputs. And calculation should be next:

Example for 5V on AREF for 270 degrees potentiometer.
- Output diapason (0..5V from potentiometer) = 270 degrees. It's mean that one degrees = 5V/270 = 18.5 mV.
- Input voltage (diapason 0..5V AREF) ADC converts to digit value (one byte 0..255). It' mean that ADC digit value for 1V = 256/5V = 51.2
- For Working area (180 degrees) you should to set low threshold = (270-180)/2 = 45 degrees.
In voltages 45 deg * 18.5 mV = 0.8325 V.
In ADC value 0.8325V * 51.2 = 43.
- Summary for 5V AREF and 270 deg pots for setting 180 deg working area you should to set SensLo = 43 and SensHi =212 (255-43).
It's mean that my default values in FW reduces working area to 176 degrees (instead 180) :)

Example for 5V on AREF for 10 turns potentiometer.
- Output diapason (0..5V from potentiometer) = 10 turns. It's mean that one turn = 5V/10 = 500 mV.
- Input voltage (diapason 0..5V AREF) ADC converts to digit value (one byte 0..255). It' mean that ADC digit value for 1V = 256/5V = 51.2
- For Working area (3 turns) you should to set low threshold = (10 - 3)/2 = 3.5 turns.
In voltages 3.5 turns * 500 mV = 1.75 V.
In ADC value 1.75 V * 51.2 = 90,
- Summary for 5V AREF and 10 turns pots for setting 3 turns working area (in the center) you should to set SensLo = 90 and SensHi =165 (255-90).

This is in theory. BUT IN THIS CASE YOU REDUCE FEEDBACKS ACCURACY, because you will use only 3/10 of ADC diapason.
There are two ways to solve this problem. Increase voltage on potentiometer or decrease voltage on AREF pin. First way is dangerous.
For better accuracy I recommend to you next way: reduse AREF voltage to 2.0V. And use as wirking area of potentiometer turns 0.5..3.5. If AREF = 2V max voltage for ADC will be reached at the end of the fourth turn. we can consider the pot as 4 turns

Example for 2.0V on AREF for 10 turns potentiometer.(use 0.5..3.5 turns as working area)
- Output diapason (0..5V from potentiometer) = 10 turns. It's mean that one turn = 5V/10 = 500 mV.
- Input voltage (diapason 0..2V AREF) ADC converts to digit value (one byte 0..255). It' mean that ADC digit value for 1V = 256/2V = 128
- For Working area (3 turns) you should to set low threshold = (4 (used only 4 turns) - 3)/2 = 0.5 turn.
In voltages 0.5 turn * 500 mV = 0.25 V.
In ADC value 0.25 V * 128 = 32,
- Summary for 2.0V AREF and 10 turns pots for setting 3 turns working area (0.5-3.5 turns) you should to set SensLo = 32 and SensHi =223 (255-32).

Ooph... :D

Best regards,
Ale
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby speedy » Sat 20. Oct 2012, 14:18

Hi Mr. Prilad ... :
Excellent calculations my dear ... Excellent results ...Very well designed FW


[Note every one ... I damaged my hardware because I didn't know what I have here ... Here comes the power of this FW ]

sorry for being late to reply ...

I was just writing the details of the last GOOOOOOAL ... :lol: :lol:


Using these options off power to emulate what will be the response is really good ... really really like that ;)
I did these steps to avoid further damage ... the mechanical system is so powerful 52Nm on the output shaft that could cut my finger ... :cry:



here what I did ... ==================================================================================================
The motor is OFF [ safety first ] ... on the AMC turned the ADC pot CCW "counter clock wise " to reduce the AREF ... used a MM to measure the 2V on pin32 of the ATMEGA8535 ... it came down to 2V after 9-10 turns of the ADC pot. :? [10K Ohm multi-turn ADC pot ] ...

Then opened the xSimCTRL ... selected send, receive, display data ... set the numbers as explained really simple principles above ... to SensLo =32 and SensHi = 223 both motor channels " pressing enter on keyboard for each number " and saved to the AMC and restarted the AMC [ press reset ] ...

Noticed that the blue line on motor 1 disappeared and a red NOK on the bottom of the blue bar ... So I used the second empty channel of the AMC as it has another 10turn pot ... centered it and marked with a pen ...

with slow moving and watching the numbers of the LCD second line ... it gives 1 by 1 incremental up and down on LCD a very good resolution ;) ... and [1.5 turn ... to reach the [0 on LCD value ] for one direction ... and 1.5 turn to reach the [ 255 on LCD value ] on the other direction ...

On the xSimCTRL the response to these 1.5 turns up and down it makes the motor2 blue bar moves to be exactly just before the NOK red mark appear ... impressive option my Dear Prilad ... 8-) clap clap clap clap to you Prilad ... .

Soon now for me a matter of time ... it is just a mechanical issue to fix the limit switchs and test with power ON ... [ just stay with us ] :lol:

I wonder what surprises you're hiding for us on the other up coming options ... ???

with the best of the best regards
spe ;) edy
User avatar
speedy
 
Posts: 148
Images: 4
Joined: Thu 19. Apr 2012, 06:46
Location: Alexandria, Egypt
Has thanked: 14 times
Been thanked: 2 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby prilad » Sat 20. Oct 2012, 14:51

Hi, my friend!

speedy wrote:here what I did ... ==================================================================================================
The motor is OFF [ safety first ] ...

Yes and yes, safety and accuracy :D :D :D .

And, as you can see, when pot position in the "red" zone - motor will be stopped and can go only to opposite direction. Check phase of motor power supply (from H-Bridge) for setting right direction ;)

Best regards and good luck.
Ale
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby speedy » Sat 20. Oct 2012, 15:35

Hi Mr. Prilad .. :
prilad wrote: when pot position in the "red" zone - motor will be stopped and can go only to opposite direction.

Impressive ... that's a SW limit switch too . ;)


Next ... Now about tweaking these ... to get some .5cm safety of the real actuator travel distance away from the real safety switch for end points overshooting If happens .

[ SensLo <<<-- bigger centered working aria -->>> SensHi ]... [ SensLo >>> -- smaller centered working aria --<<< SensHi ]

1-To get at least 2 steps centered bigger working aria <<-- bigger working aria -->> ... By decreasing down the SensLo value by one step ... and increasing up the SensHi value by one step .
2-to get >>-- smaller centered working aria --<< do the opposite of the above ... increase up the SensLo by one and decrease down the SensHi by one .
how about that ?

And don't worry sure I'll check every thing again ... I'm Not using H-bridge :lol: ... I'm using a frequency inverter VFD :twisted: ... it's rotation direction is controlled with a circuit connected to the limit switches in a way that cannot be reversed ;) .

regards
spe ;) edy
User avatar
speedy
 
Posts: 148
Images: 4
Joined: Thu 19. Apr 2012, 06:46
Location: Alexandria, Egypt
Has thanked: 14 times
Been thanked: 2 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby prilad » Sat 20. Oct 2012, 17:16

Hi Speedy
speedy wrote:I'm Not using H-bridge :lol: ... I'm using a frequency inverter VFD :twisted: ... it's rotation direction is controlled with a circuit connected to the limit switches in a way that cannot be reversed ;) .

I hope you will soon make us happy with running simulator video ;)

speedy wrote:Now about tweaking these ...


I can create on xSimCTRL form two "tweak" buttons - one for increasing (symmetrical) working area, and second - for decreasing one.

Regards,
Ale
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby speedy » Sun 21. Oct 2012, 15:40

Hi Mr. Prilad:

confirming on every thing is working fine ...
Here is the video ... sorry for the bad quality ... sorry for the sound discovered that my finger moved on the mic :lol: :lol:




I have a little issue about this rear axes ... that there are always a remaining -240 PWM on the LCD ... I don't know where they comes from ... the actuator is really centered ... moving it up or down won't make this remaining value disappear ...

what would be the problem ... ?

Regards
spe ;) edy
User avatar
speedy
 
Posts: 148
Images: 4
Joined: Thu 19. Apr 2012, 06:46
Location: Alexandria, Egypt
Has thanked: 14 times
Been thanked: 2 times

Re: Alt. firmware and GUI for Thanos's AMC1.5 & AMC1.6

Postby prilad » Sun 21. Oct 2012, 18:08

Hi, Speedy !!!
speedy wrote:I have a little issue about this rear axes ... that there are always a remaining -240 PWM on the LCD ... I don't know where they comes from ... the actuator is really centered ... moving it up or down won't make this remaining value disappear ...

what would be the problem ... ?


Try to control your actuator by xSimCTRL (with meander position generation). And check the graphics information for setting and reading position (and make video for me). I think your problem is overdriving, because Kp is too big.

Regards, my friend.
Ale.
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

PreviousNext

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 2 guests